The following information will help you understand the differences between passing argument tags to parameters by reference or by value.
 | Aspect | By Value (Input or Output) | By Reference (InOut) | 
|---|
| Value | Synchronous - the argument's value does not change during Add-On Instruction execution. | Asynchronous- the argument's value may change during Add-On Instruction execution. Any access by the instruction's logic directly reads or writes the passed tag's value. | 
| Performance | Argument values are copied in and out of the parameters of the Add-On Instruction. This takes more time to execute a call to the instruction. | Parameters access argument tags directly by reference, which leads to faster execution of instruction calls. | 
| Memory usage | Most amount. | Least amount. | 
| Parameter data types supported | Atomic (SINT, DINT, INT, REAL, BOOL). | Atomic, arrays, and structures. | 
0 comments :