I am useing ModbusTCP library with RaspberryPI. I am using Input registers as WORDs and BOOLs. There is no problem with words.
I get a compile problem with BOOLs: Type 'BIT' is not equal to type 'BOOL'...
Why BIT type? The digital type in ModbusTCP Input registers is BOOL. I do not understand this. Any solutions?
Hello everyone,
I am useing ModbusTCP library with RaspberryPI. I am using Input registers as WORDs and BOOLs. There is no problem with words.
I get a compile problem with BOOLs: Type 'BIT' is not equal to type 'BOOL'...
Why BIT type? The digital type in ModbusTCP Input registers is BOOL. I do not understand this. Any solutions?
Best regards
You could use the WORD_TO_BIT, BIT_TO_WORD or just call the BITs directly on the word variable as wVariable1.0 where ".0" is the first BIT of the WORD
I wrote an example of doing MODBUS-TCP communication in Codesys: http://disorder.dk/wonderware/2020/10/07/modbus-tcp-between-codesys-controllers/