|
Post by christoph on Mar 31, 2023 8:07:36 GMT
Hello,
I have a two values MODBUS
---> decimal Register 1( MSW)=17045 Register 2(LSW)=32768
I need Floating result result: 74,75
Could someone help me how to convert the data in PIStudio scripts?
|
|
|
Post by redmepham on Sept 16, 2023 6:23:27 GMT
Perhaps you figured this out already, but if not;
On the PI Studio Program, select the "Project" Ribbon; in the "Library" section select "Mapping".
Create a Mapping that reads address, something like 1:40017, which is MODBUS for Read Holding Register 17. (Be sure to use the address of your target) Click on Data Type and set to 32bit Floating. If you know the Endianess of the Target, then either click the checkbox for Big Endian Data, or not. If you do not know your target and want to save time searching through its technical manual, then create two mappings and use Big Endian on one and not the other and map them to different destination addresses, such as HDW10 and HDW12. Must skip one address because 32bit variables are two words. If you are transmitting back to your device then consider using the same Endianess to store in HMI registers to avoid complications.
Create two numeric Input/display objects and set the addresses that you used, such as HDW10 and HDW12.Compile and run your project to determine which numeric display shows the correct Floating point number. Remove the wrong display from your project and recompile. Any other data from your device will probably use the same Endianess, so take note and make any others the same.
Cheers! RedMeph
|
|