HMI Pad Forums Main Forums ScadaMobile Support Reading Modbus Real Numbers

This topic contains 3 replies, has 2 voices, and was last updated by  John 6 years, 1 month ago. This post has been viewed 2270 times

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #19591

    John
    Keymaster

      [quote][b]Quote from MarkB on October 30, 2013, 03:03[/b]

      The one thing I found out was that the structure for the real numbers is different than I am used to. In Modbus, Horner, A/B and other PLC systems when you address a real number it takes up two address, and you usually address it by the lowest numerical address. I.e, if you have a Real Number that is in location say register 1 & 2. Most systems address this as address 1, but I found after much angst that in the SCADAMobile.app it is addressed as HR2. Now that I know it won't be a problem in the future.

      Thanks for the help,
      Mark[/quote]

      #19592

      John
      Keymaster

        Hello MarkB,
        The app already uses the lower numerical address to point to multiple register information, including REALs. Maybe you missed that registers on ScadaMobile (and all our other apps) are referred to as actual register numbers as opposed to addresses. This means that HR1 is Register 1, which happens to be at modbus address 0, and so on. We took this convention as it is the one described in the official modbus specification.
        On the other hand, some modbus devices store REALs (and DINTs) in reversed order than what the spec dictates. You must also check this. The 'word_swap' global attribute on your csv file helps to deal with it given the case. If you are already reading correct REAL values with all the decimals intact, then chances are that you simply missed the 1 offset between register number and register address, and thus you are already pointing to the right address.
        Please let me know if still think there is still something inconsistent for what you expect.
        Thanks

        #19593

        MarkB
        Member

          I am fine with how it is working for me. I have used the single register addresses and they functioned fine. For an example for an integer that was an %R-0321 in my Horner PLC's the offset for Modbus/TCP is 6000, so in MODBUS/TCP it would be HR6321. And this worked fine. But, with the Real number in Horner it would be designated the same %R321 and it would also include %R322. So in Modbus/TCP it is designated 6321 the same as the integer register. However, when I tried to use HR6321 for this application it just gave out weird scrolling numbers. I finally tried the reverse and set the register in the app for HR6322 and it works fine.

          I don't mind it. I just have not seen this before. And I have used other SCADA programs. I don't know if it applies to other PLC's since I haven't used this app with any other PLC's, but I might.

          I really do like this app, it is going to do a whole lot for the company I am using it with. They want to stay totally informed about what is happening with this waste treatment plant at all times. So this will do that for them. I already had this PLC connected to the Internet through a CellPhone interface full time. This allowed them to access machine on their PC's and laptops just like they were at the machine through a program from Horner called Envision. The PLC also sends the emails of the data log daily and the alarm log daily. And to further make this fun it sends out an email to them if there is an alarm that comes on. Attached to the email is a .csv file with the alarm log on it so that they could see what the alarm was without having to go to their PC or laptop and logging in.

          However, with the latest update in IOS to ver. 7 the .csv files became corrupted when they tried to open them. The files were still good if they were opened in an Android phone or on the PC's. So it was Apple's software not liking the format of the .csv file. I know there is a difference between a .csv file for Mac and Windows, but it never made a difference until the IOS 7 update.

          That was why I came looking for something to help out. And I found your solution. And like I said it is going to work out great. I can't wait to present it to the engineers and chemist at this company.

          Thank you,
          Mark

          #19594

          John
          Keymaster

            Hello Mark,
            I appreciate your comments and feedback. However please let me insist: addressing a REAL from its second register is *wrong*. You must point to the first register also on ScadaMobile. The reason it works for you is most probably because your reals are positive natural numbers. Try to add decimals or sign and this WILL fail. Please change your csv project by addressing your data starting at the first register.
            If a real uses HR6321 and HR6322 then you must enter HR6321 on column C. If you enter HR6322 then ScadaMobile will read HR6322 and HR6323 for that value. Now if HR6323 eventually is Zero and your real (In HR6321 and HR6322) is a positive natural number you may *appear* to have the right reading, but it is not. This will fail as soon as anything but Zero is in HR6323 or your REAL number is not a very simple one.
            Instead, please try to set word_swap=true; on Column D. You can place it on any row as this is a global attribute.
            It is very common for a lot of PLCs and specially small RTUs to store 32 bit values -such as REALS- in reversed word order -least significative word first-
            I hope this helps.
            Thanks

          Viewing 4 posts - 1 through 4 (of 4 total)

          You must be logged in to reply to this topic.

          Copyright © SweetWilliam, S.L 2009-2013. All rights reserved.
          Science and Technology Park of the University of Girona, Emili Grahit, 91 (NarcĂ­s Monturiol building, Office P3-B03) 17003-Girona. Phone +34972183244