AnttiB Posted October 1, 2019 Share Posted October 1, 2019 Hello, I have been running Emotron VFD trough modbus with DAQFactory. All the basic reading and writing is working just fine. Now I´m having a problem converting Emotron floating point format to correct decimal values. I can read the value from 0 to 32767 with the U16 format but after that I don´t know how to continue reading the value. I need to read this value from 0 to 200000. Can I make this work trough "channels" ? Part of the Emotron manual attached. emotron.pdf Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted October 3, 2019 Share Posted October 3, 2019 OK, that is a new, and quite proprietary way of dealing with floating points. I don't know why they just didn't do what everyone else does and use two registers and regular IEEE floating point format.... You have to take the U16 value you get from the PLC and process it like they are floating point values in this weird format. You can tell if they are floating point because the value returned will be > 32767. There is not a simple Conversion you can apply. You would have to use script. I'd probably either use the to.bit function to get the bits and then calculate it, or use some bitwise math to extract the proper values. The tricky part is the sign, which is not in a usual place because the breaks aren't at 8 bit intervals. You will likely need to experiment. Quote Link to comment Share on other sites More sharing options...
AnttiB Posted October 3, 2019 Author Share Posted October 3, 2019 Thank you for the info. I was wondering that could you make me an example script to start the experimenting. Channel name = shaft_power Device type = Tamu1 D# = 1 Channel = 1004 I need the read the channel in standard 16 bit format and when I hit the 32767 (111111111111111) value I need to start the calculating after that. Is this correct? Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted November 5, 2019 Share Posted November 5, 2019 I'm afraid it would take a bit of experimentation so you are on your own. But yes, if the value is less than or equal to 32767 you can just treat it as an integer and use it as is. If it is > 32767 then you have to do the conversion. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.