Another question: If I want to use physical address with AT instruction, how can I avoid overlap address? Many PLC have a tool able to show which physical addresses are free o busy. Does codesys too?
Thanks
Luca
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi to all,
I'm searching a way to do something like that:
If I try to build this code, the compiler give me errors. Any suggestion to do it?
Thanks to all
Luca
Hi. Use function PUTBIT / EXTRACT from Util library.
Hi,
You can acces a bit into a word (or other type as UINT, INT, ...) only with a direct value, a constant, or a BIT data type into a structure.
Please see : https://help.codesys.com/webapp/_cds_operands_variables_accessing_bits;product=codesys;version=3.5.15.0
For your example, you can write :
VAR_GLOBAL CONSTANT
iMyBit :UINT:=2;
END_VAR
(Program)
wOutputs.iMyBit := TRUE;
wOutputs.5 := TRUE;
BR
Hi,
I'm thinking that putbit function is what I need.
Another question: If I want to use physical address with AT instruction, how can I avoid overlap address? Many PLC have a tool able to show which physical addresses are free o busy. Does codesys too?
Thanks
Luca