The CurValue :=24.4 line sets the value that is written to the current value of the database item that is named 'Analog Input Point'. The variable declarations are ended by END_VAR. In this case, it means that the CurValue is the value that is written to the current value of the database item that is named 'Analog Input Point'. The second variable is CurValue which is the CurrentValue of the item that has the same name as the PointName variable. Program 2 automatically detects that it has a string input from Program 1 (there is only 1 input). The data type for the VAR INPUT has to match the data type for the output of Program 1. In Program 2, the input value is called PointName and it is a string. The VAR INPUT keyword instructs the program that it is receiving an input value (the input value is received from Program 1). The first is PointName, which is a string value. The parts of the indirect variable are optional. This is coded into the program and is not affected by the user input/input from another program for the indirect variable.
0 Comments
Leave a Reply. |