Hi,
How do I break down an int type tag into a bit type tag?
in vision
The double type tag called "A" must be split into bits.
I saw something about this on the forum before, but when I looked again, I didn't see it. If anyone knows the location, please provide a link. I will look further.
thank you
If you just want an expression function to give a true or false for a specific tag bit then try getBit | Ignition User Manual.
I know about getbit. But I want to know setbit.
You must receive it as a word or double and divide it into bits to read/write. This is due to the limit on the number of tags in PLC. So, I am planning to use it by making it with udt.
OK, but your original question is not clear and neither is your second post. Give some further information:
- What PLC?
- What OPC server are you using?
- What PLC data type are you reading and into what Ignition tag type.
- Why must the word or double be divided into bits?
- What is the real problem you are trying to solve.
Try to answer each question.
answer:
- ABB PM5630 PLC
- Modbus TCP Server
- PLC: Dint 32bit , Ignition : Holding Register(int32)
- Due to the redundancy of ABB PLC, the number of tags is limited to 3000 and must be divided into bits.
- Each bit divided above must be set/reset.
There are many devices, but the bit order is constant, so I want to make it into udt so that I can use it by only changing the source tag.
Does this mean Ignition’s OPC server and Modbus driver?
Yes, ignition OPC ua server
Instead of getBit and setBit you can just create additional Ignition OPC tags that use the bit addressing syntax.
[Device]HRUI1.0
, [Device]HRUI1.1
, etc...
The only problem is writing to bits requires that the device support the Mask Write Register command.
Does this mean that when the Ignition OPC UA server and Modbus TCP driver specify the data type as Holding Register (int32) and a tag is created in Vision, the address is created as [device]a.0?
What should I do if my PLC does not support the Mask Write Register command?
You do the masking yourself through derived tags.