
AC (Customer) asked a question.
Formula to write voltage to analog output over Modbus
Need to set 0-10v on a CO-04DA-2 analog output using a Modbus driver. Is there a formula?
Thanks in advance

AC (Customer) asked a question.
Need to set 0-10v on a CO-04DA-2 analog output using a Modbus driver. Is there a formula?
Thanks in advance
Copyright © 1999-2023 AutomationDirect. ALL RIGHTS RESERVED
Hi AC,
There really is no formula. You would set up your analog output card with scaling to indicate the range from 0 to 10 volts.
I hope this helps you out.
Regards,
Garry
https://accautomation.ca/series/click-plc/
What about the formula to set the registers? For example if I want to set the output to 7 volts I currently write 16608 to address DF5 with my Modbus driver. Works great. However the scale does not appear to be linear. If for example now I want to set DF5 to output 2.3 volts, it's not clear what values I would write. Is there a formula to convert 0-10v to register values?
Hi AC
You are needing to write 16608 because this is a floating point value. If you use the DS registers as indicated above 0 to 1000 = 0 to 10VDC.
Modbus does not transfer floating point very well.
Here are a couple of threads that may help you out understanding of the odd values you are entering.The float 32 must be converted to hex and then put back.
http://www.plctalk.net/qanda/showthread.php?t=103843
https://gregstoll.com/~gregstoll/floattohex/
Regards,
Garry
Ah OK:) Thank You