Applies To: |
|
Summary: |
How can I display the status of each of the individual bits which make up an unsigned integer? |
Solution: | |||||||||||||||||||||||||||||||||||||||||||||||||||
The logic operator which will mask everything but the required bit is 'BITAND'. In a real world project it would be best to create a digital tags on a disk device in the project and run an event to update the digital tags with values from the integer on a regular basis. That will provide a single location for the conversion code should any changes need to be made in the future. Example: Expression = Tag1 BITAND 0xXX where: Tag1 is an unsigned integer, and
Note: This should only be used for reading from a PLC or integers in the PLC which will only be writen by Citect. That is because writting a change to a single bit will write the Citect values to all the bits. |
Keywords: |
Related Links
Attachments