variables are in different status available:
normal vars only work within a function block (or program)
inputs are used to get data from outside the block
outputs are used to give data to other blocks.
in/out can be used in both directions.
just give it a try.
if any questions just ask here no problem.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2011-07-20
Originally created by: Captive Engineer
May I respectfully add that variables listed under the VAR_IN_OUT declaration are passed by reference rather than by value. This fact means that a programmer can address large pieces of data (arrays, structures) inside a function or function block without needlessly increasing actual consumed memory by the implicit copy that is performed when using VAR_INPUT and VAR_OUTPUT.
Kind regards,
The Captive Engineer
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I am new to CoDeSys...
What is the difference between VAR_INPUT, VAR_OUTPUT, VAR_IN_OUT
variables are in different status available:
normal vars only work within a function block (or program)
inputs are used to get data from outside the block
outputs are used to give data to other blocks.
in/out can be used in both directions.
just give it a try.
if any questions just ask here no problem.
Originally created by: Captive Engineer
May I respectfully add that variables listed under the VAR_IN_OUT declaration are passed by reference rather than by value. This fact means that a programmer can address large pieces of data (arrays, structures) inside a function or function block without needlessly increasing actual consumed memory by the implicit copy that is performed when using VAR_INPUT and VAR_OUTPUT.
Kind regards,
The Captive Engineer