1
Support Questions / Re: Float Register with Modbus
« on: March 20, 2024, 08:39:42 AM »
Yes! i just test It. As always thank you!!
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
The PLCAddressSelectColor2 works on a boolean value, so you can program the comparison in your PLC to set a boolean value.
The other option is to use some code:
- Add a DataSubscriber to the form
- Set PLCAddressValue to the register you want to use
- Double click the DataSubscriber to get back to code
- Enter this code:Code: [Select]if e.Values(0)=101 then
BasicIndicator1.ForColor=Color.Red
else
BasicIndicator1.ForColor=Color.White
end if
in conjunction with the subtract you want to use a logical AND.
ModbusTCPCom1.Write("40001", Value AND (65535 - 2 ^ (b_Num - 1)))
I can't test that right now, but the 65535 assumes it is an unsigned 16 bit integer, it may need to be a 32767