242 43-TV-25-35 GLO Iss.4 Dec 06 UKA5E01001767-04Full Maths & Script ProcessingScript Function Application Examples(Scripting is not available on the SIREC D200).To enter a script for a Pen, ensure that “Maths Type” in the Pen Menu is set to Scripting.Example 14 flow meters are fed into the recorder to trend, totalise and record daily flow. The applicationrequires that the user must know and record which flow meter is outputting the highest flowat any particular time. This can of course be derived from the four lots of recorded data, butnot only is this extra analysis later, but a real time display is required.The application is easily solved by using the Script Function in the recorder, represented inpseudo code the script is as follows:If input 1 is bigger than all the others, then make the global variable (1) equal to channel 1,and display and record input 1.If input 2 is bigger than all the others, then make the global variable (1) equal to channel 2,and display and record input 2.If input 3 is bigger than all the others, then make the global variable (1) equal to channel 3,and display and record input 3.If none of the above are correct then Input 4 must be the highest, so make the global variable(1) equal to channel 4, and display and record input 4.Display the global variable (1) on another pen to show which channel is biggest at any giventime.Pen 5 is chosen to record the highest channel input, and channel 6 is chosen to record whichinput is the highest.The greater than “>” is used, the AND “&&” Boolean is also used, and the global variableGLBV1 is used to hold the current highest channel number.Converting this to an actual script gives the following:If ((A1>A2)&&(A1>A3)&&(A1>A4)) This tests if flow meter 1 is more than 2, 3 and 4{GLBV1=1; If yes, then set display indicator to meter 1return A1; And return the current flow reading}elseif ((A2>A1)&&(A2>A3)&&(A2>A4)) This tests if flow meter 2 is more than 1, 3 and 4{GLBV1=2; If yes, then set display indicator to meter 2return A2; And return the current flow reading}elseif ((A3>A1)&&(A3>A2)&&(A3>A4)) This tests if flow meter 3 is more than 1, 2 and 4{