Risposte al Forum Create
I’m sure that there isn’t a specific command in Movicon, able to convert a Script in an any kind of Diagram.
Anyway, this link could be interesting..
in your case doesn’t miss the DO expression but an ‘End If’ after the DateDiff:
If DateDiff(‘s’, LastMsg, Now) > COM_TIMEOUT Then ‘Date difference in seconds between last msg and now
Exit Do ‘Transfers control out of the Do loop.
Try in this way!
usually, the error -Unexpected text ‘Loop’-, is get when miss the ‘Do’ expression. So, first of all, you could verify that the syntax is correct, for example:
Loop Until This.IsStopping OR IsInStoppingMode
Another idea is that you used the expression in the wrong place. How is made your script?
usually you can just create a ‘Double’ variable in Movicon and give this the correct Start Address (eg. SA=0, you will read from Address 0 to 3); anyway, is possible that you have to edit (setting ‘True’ or ‘False’) the Swap of the Byte or Word, because this configuration depends on the device.
In Movicon are not supported structures of arrays and structures of structures.
So when you try to import Structures and UDTs containing more complex data types such as arrays or other structures or UDT, it will be splitted into individual variables.
TYPE UDT 1
Var1 : BOOL;
Var2 : WORD;
Var3 : INT;
Var4 : ARRAY [0 .. 6 ] OF BYTE;
Var5 : INT;
Var6 : BYTE;
The importer will create a structure variable with its prototype made by members Var1, Var2, and var3 and three individual variables (outside the Structure) var4, and Var5 var6 respectively of type Array, Sign Word and Byte.
I hope I explained all clearly!
I know that downloading the latest version of the Driver S7TCP.dll from Progea web site, into the S7TCP.zip file there is the library AGlink40.dll. This file must be copied in the installation folder of Movicon (where there is the Movicon.exe!!).
I usually use array variables in my Script with the syntax: [Array.e#]
But I know also these possibility:
SetVariableValue(‘Array[‘ & IndexVar & ‘]’, 1) (if you want to use it dynamically!)
These methods work with an array variable defined in the Real Time DB.
Redim myArray(Num_Elements) ‘Redimension a dynamic arrayvar
myArray(5) = 100 ‘write on element n°5 the value 100
Now I think you have all the information you need!