Precautions, Tips & Tricks When Using Macros; Com Piler Er Rors & Er Ror Codes - Maple Systems Silver Series Installation And Operation Manual

Operator interface terminal
Hide thumbs Also See for Silver Series:
Table of Contents

Advertisement

288
Char (8-bit)
Char (8-bit)
Bool (8-bit)
Bool (8-bit)
When a GetData() or SetData() function is executed using a 32-bit data type (Int or Float), the function will
automatically convert the data. For example:
// get a floating point value from a modbus device
// note that two registers will actually be read,
// since a floating point value occupies
macro_command
main()
float
f
GetData(f, "MODBUS", 4x_BIN, 101, 1)
value
end macro_command
// get (5) 32-bit integer values from the HMIs internal storage
// note that 10 registers will actually be read,
// since each integer value occupies
macro_command
main()
int
Values[5]
GetData(Values[0],
Values[] will contain a 32-bit
end macro_command
Precautions, Tips & Tricks when Using Macros
• The size of a macro in an xob 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.
1010-1007W, Rev 06
1
1
2
1
2
// f will contain a floating point
2
words
"Local
HMI", LW, 200, 5)
integer value
Macro_Command main( )
int g[10] , g
For g[2] = 0 To 2
Sil ver Se ries In stal la tion & Op er a tion Man ual
1
1
1
1
registers
// each element of
//<- illegal – redefinition of 'g'

Advertisement

Table of Contents
loading

Related Products for Maple Systems Silver Series

This manual is also suitable for:

Hm15070thHm15100t

Table of Contents