I have a piece of OEM equipment that stores all boolean values in Modbus holding registers using bit flags. Is there a way to configure the periphery address for a database bool to read a specific bit of a word? The only alternative I can think of is to read in the word as an integer and use a scrip to extract the necessary bit and write that out to a boolean in the database. Are there any better or recommended solutions for this?
Thank you for your help.
Modbus Flag Bits
- Gertjan van Schijndel
- Posts:634
- Joined: Mon Aug 02, 2010 10:37 am
Re: Modbus Flag Bits
You can specify a subindex in the address config to read a single bit from a word.
- fmulder
- Posts:330
- Joined: Wed Feb 03, 2010 9:46 am
Re: Modbus Flag Bits
Translating a word into bits can be done via a dp function but this has a mayor disadvantage. The problem is that the quality is not taken into account.
When you pull the cable to the PLC then the word will become 'bad' but the bits will still remain 'good' !!
In general, use the subindex when possible
When you pull the cable to the PLC then the word will become 'bad' but the bits will still remain 'good' !!
In general, use the subindex when possible
- adambutt
- Posts:6
- Joined: Wed May 20, 2015 6:05 pm
Re: Modbus Flag Bits
I tried using the subindex to select the bit I want, but I get an error indicating that I can only use polling with a subindex of 0. If I can't put this address in a polling group, how will it update?
Thanks.
Thanks.