hugojose Posted May 23, 2013 Report Share Posted May 23, 2013 Hi all. I am trying to configure VTS Trihedral Scada system with a V120 PLC configured as slave, for monitoring a lift station using Modbus protocol. I can read/write from VTS to registers MBs and MIs, however am having a hard time with the floats (MFs registers). According with Unitronics Modbus Slave Table, the Modbus register for MF 0 starts at 7700. I am trying to read MF 20 and I've tried in VTS 47721, 37721, 407721, and 307721 with no results; the VTS Modbus driver does not seem to understand this addressing and simply draws a blank. What am I missing? I've googled and tried researching this issue but have not found much on Unitronics Modbus floats. Any help would be greatly appreciated. Hugo Quote Link to comment Share on other sites More sharing options...
Gabriel Franco Posted May 24, 2013 Report Share Posted May 24, 2013 MF20 must be 7720 Quote Link to comment Share on other sites More sharing options...
hugojose Posted May 28, 2013 Author Report Share Posted May 28, 2013 Thanks, for your reply, Yes, I tried that too, but it does not work either. Modbus starts counting on 1 not 0, so generally you have to add 1, By reading deeply in the Unitronics help found that I have to add xx/FLOAT to the address, so I was able to bring at least a number that changes by using 7741/FLOAT. The 41 is because a read a post in the forum where somebady was able to read ML registers in Modbus by using (MLx2+1)+45100 (5100 is for MLs), thus applied same formula for MF plus the \FLOAT. However I am reading in VTS a very low ridiculous number that changes, when I change it in the MF Unitronics register. I have the feeling that what am reading is the two 16 registers that makes the float in reverse order, and have to find a way to swap them. Thanks again. Quote Link to comment Share on other sites More sharing options...
AlexUT Posted June 3, 2013 Report Share Posted June 3, 2013 Hi, You have to swap these 2 16 bit numbers in your SCADA. Then it will be right Float representation. B.R. Quote Link to comment Share on other sites More sharing options...
MVP 2014 Simon Posted June 5, 2013 MVP 2014 Report Share Posted June 5, 2013 If you needed to swap the bytes in the PLC, as far as I can see you can do it in two steps: 1. Use the "Vector" -> "Struct" block to take the MF bytes and copy to a DW. This copies the bytes as they are, instead of interpreting them as a number 2. Use the "Vector" -> "Swap Bytes" Function and use the "32-bit" option to swap the upper and lower words of the DW value. To read the value via SCADA you have two options Use the SCADA "read float" function, but point it to the address of the DW in the PLC OR Use the "Vector" -> "Struct" block again to copy the bytes of the new modified float back into an MF register (note this will show a strange number when viewed as a float in Visilogic, becuase the words have been swapped). Then point the SCADA function to the MF register. I hope this helps. 1 Quote Link to comment Share on other sites More sharing options...
hugojose Posted June 10, 2013 Author Report Share Posted June 10, 2013 it did work, as advertised above. Thanks Simon, AlexUT, and Gabriel. I appreciate the help grealy. Hugo Quote Link to comment Share on other sites More sharing options...
MVP 2022 Joe Tauser Posted November 30, 2016 MVP 2022 Report Share Posted November 30, 2016 I'm using Visilogic 9.8.31. I'm running into the same problem, but Vector->Struct no longer allows an MF data type as a source address. Did this disappear? Joe T. Quote Link to comment Share on other sites More sharing options...
MVP 2022 Ausman Posted November 30, 2016 MVP 2022 Report Share Posted November 30, 2016 It's not available in 9.7.55/0 either, in case it helps. cheers, Aus Quote Link to comment Share on other sites More sharing options...
MVP 2022 Joe Tauser Posted December 19, 2016 MVP 2022 Report Share Posted December 19, 2016 Bump. Creators - Vector->Struct doesn't list MF as a data source. Is this coming back? Joe T. 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.