.....
My intention was to declare all inputs and outputs boolean variables in one (global) place, so I can use it on several POU's.
I know I can use this code MCP1.byOutputsA.0 := MCP1.byInputsA.0; but i'd like to use more meaningful input/output names.
However I still don't know is this
VAR_GLOBALÂ Â in1:BOOL(MCP23S17.byInputsA.0);Â Â out1:BOOL(MCP23S17.byOutputsA.0);Â Â Â END_VAR
correct or not ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I want to create and map custom boolean variable list to point to MCP23S17 input/output pins. Only what I figure out is this.
I have created global variable list like this:
Then in POU's ST code this:
Is this syntax ok? What is the "proper" way to create variable map list to mpc's pins ?
Thank you !
If you want something that works, it may not be exactly what you want but I would just instantiate the device in the globals, like so:
and then use in the ST code of the POU like this:
or this:
Not sure if you can define like you want to in the globals somehow, but I could be wrong..
.....
My intention was to declare all inputs and outputs boolean variables in one (global) place, so I can use it on several POU's.
I know I can use this code MCP1.byOutputsA.0 := MCP1.byInputsA.0; but i'd like to use more meaningful input/output names.
However I still don't know is this
correct or not ?