iAddr_Off
The address offset in the PLC
iDataCount
Number of words
Precautions, tips & tricks when using Macros
·
The size of a macro in an eob file is limited by the memory of the OIT.
·
The maximum storage space of local variables in a macro is 4K bytes.
·
A maximum of 256 macros are allowed in an EasyBuilder project.
·
A macro may cause the OIT to lock up. Possible causes are:
·
A macro contains an infinite loop with no PLC communication.
·
The size of an array exceeds the storage space in a macro.
·
PLC communication time may cause the macro to execute slower than expected.
·
Random macro compiler errors can often be corrected by recompiling again, or canceling out of the macro
editor and then reopen and compile again.
·
Some macros don’t work the way they should due to the declaration of some variables and how they get
interpreted. Some Boolean arrays work better when defined as an array of ‘short’s or ‘int’s. When getting
data from an external register, the variable to receive it is best declared as a ‘short’ or an array of ‘short’s.
Com piler Er rors & Er ror Codes
When there are compile errors, the error description can be referenced by the compiler error message number.
Error message format: Macro_name(: Error_message_number ) Error_Message.
·
(1): "Syntax error", "identifier" - There are many possibilities for the cause of this compiler error. Simply
stated, the compiler found a problem with the syntax of the statement
·
(2): Used without having been initialized. - Must define the size of an array during declaration. The array
size declaration must be a constant whole number, not a variable.
·
(3): “Redefinition error: ” - The name of variable and function within its scope must be unique.
Macro_Command main( )
int g[10] , g //<- illegal – redefinition of ‘g’
For g[2] = 0 To 2
g[3] = 4
Next g[2]
End Macro_Command
·
(4): “Function name error:”
‘identifier’
- Reserved keywords and constant can not be the name of a function
Macro_Command If( ) //<- illegal – used ‘If’ in the
name
·
(5): “Statement missing” ; Statement missing “
(
“ or “
)
” - Some part of the Statement is missing, typically it
is a missing parentheses
Macro_Command main ) //<- illegal – missing ‘(‘
·
(6): “Missing expression in ‘If’ statement”
·
(7): “Missing “Then” in If statement”
·
(8:) “Missing “EndIf” ” ;
·
(9:) Unfinished “If’ statement before “End If” “ ;
·
(10:) “Illegal Else statement” ;
1010-1001a, Rev 02
Mac ros
257
Summary of Contents for Silver HMI504T
Page 1: ...1010 1001A Rev 02...
Page 32: ...1010 1001a Rev 02 28 Silver Series Installation Operation Manual...
Page 128: ...1010 1001a Rev 01 124 Silver Series Installation Operation Manual...
Page 156: ...1010 1001a Rev 02 152 Silver Series Installation Operation Manual...
Page 166: ...1010 1001a Rev 02 162 Silver Series Installation Operation Manual...
Page 216: ...1010 1001a Rev 01 212 Silver Series Installation Operation Manual...
Page 251: ...1010 1001a Rev 02 Macros 247 Set Bit Objects Attributes Dialog Project Example of Add 2...
Page 264: ...End Macro_Command 1010 1001a Rev 02 260 Silver Series Installation Operation Manual...
Page 268: ...1010 1001a Rev 01 264 Silver Series Installation Operation Manual...