Script Function Application Examples - Siemens SIREC D200 Manual

Display recorders
Hide thumbs Also See for SIREC D200:
Table of Contents

Advertisement

Script 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 1
4 flow meters are fed into the recorder to trend, totalise and record daily flow. The application
requires that the user must know and record which flow meter is outputting the highest flow
at any particular time. This can of course be derived from the four lots of recorded data, but
not 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 in
pseudo 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 given
time.
Pen 5 is chosen to record the highest channel input, and channel 6 is chosen to record which
input is the highest.
The greater than ">" is used, the AND "&&" Boolean is also used, and the global variable
GLBV1 is used to hold the current highest channel number.
Converting this to an actual script gives the following:
242
Full Maths & Script Processing
If ((A1>A2)&&(A1>A3)&&(A1>A4))
{
GLBV1=1;
return A1;
}
elseif ((A2>A1)&&(A2>A3)&&(A2>A4))
{
GLBV1=2;
return A2;
}
elseif ((A3>A1)&&(A3>A2)&&(A3>A4))
{
This tests if flow meter 1 is more than 2, 3 and 4
If yes, then set display indicator to meter 1
And return the current flow reading
This tests if flow meter 2 is more than 1, 3 and 4
If yes, then set display indicator to meter 2
And return the current flow reading
This tests if flow meter 3 is more than 1, 2 and 4
43-TV-25-35 GLO Iss.4 Dec 06 UK
A5E01001767-04

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sirec d300Sirec d400

Table of Contents