Author Topic: Modbus TCP communication  (Read 2095 times)

Holmux

  • Newbie
  • *
  • Posts: 34
    • View Profile
Modbus TCP communication
« on: January 01, 2019, 07:30:47 AM »
Hi All

Programming PLC's for over 20 years, with ton of serial comm and never used Modbus :) I guess that's from mainly using AB PLC's.

Anyway I have this load cell module with Modbud TCP, where I would like to do some communication via the AdvancedHMI, I have been reading ton of manuals the last few days but is still stuck :( If I was a hardcore Modbus expert I guess the manual that came with the module would be easy to decode, but for a Newbie it is not black and white.

From what I understand, I send a request to the module and it replies with the data I was asking for, for example to get the Gross weight out of the module I will have to send "GG" to the module and it will return the value of the Gross weight.

If anyone could point me in the right direction, it would make my start at the new year a lot easier :)

Here is a link to the module i am trying to communicate with: https://www.flintec.com/electronics/weight-indicators/dad-141-1

Happy New year
/Holmux

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5317
    • View Profile
    • AdvancedHMI
Re: Modbus TCP communication
« Reply #1 on: January 01, 2019, 07:56:49 AM »
According to the manual the gross weight is a floating point value at index 2000 hex (8192 decimal). This would be read as a holding register, so the address would start with a 4. Since it is a float and not the normal 16 bit integer that Modbus is based on, you will need an address modifier of F". Modicon addresses start at 1, so the index/offset needs to add 1. So the final address to use would be:

F48193

Or with version 3.99y

48193@F
« Last Edit: January 01, 2019, 08:28:34 AM by Archie »

bachphi

  • Hero Member
  • *****
  • Posts: 653
    • View Profile
Re: Modbus TCP communication
« Reply #2 on: January 01, 2019, 08:11:46 AM »
Does he need to send GG command?
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Holmux

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Modbus TCP communication
« Reply #3 on: January 01, 2019, 08:22:07 AM »
Hi Archie

Thanks a lot, it would have taken me a ton of trail and error getting from 2000 to 48193@F :) (you added another 1000 to the version 3,99Y, is this correct ?)

I was hoping I could set this up in a DataSubscriber and transfer the value to a local tag in the AdvancedHMI, can I set this up so i send the "GG" command via
the DataSubscriber ?

Thanks again
/Holmux

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5317
    • View Profile
    • AdvancedHMI
Re: Modbus TCP communication
« Reply #4 on: January 01, 2019, 08:26:05 AM »
Does he need to send GG command?
I'm not sure where the GG comes into play because I only quickly looked through the manual on the Modbus tables. It looks like something that may be for raw serial access.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5317
    • View Profile
    • AdvancedHMI
Re: Modbus TCP communication
« Reply #5 on: January 01, 2019, 08:28:10 AM »
Hi Archie

Thanks a lot, it would have taken me a ton of trail and error getting from 2000 to 48193@F :) (you added another 1000 to the version 3,99Y, is this correct ?)

I was hoping I could set this up in a DataSubscriber and transfer the value to a local tag in the AdvancedHMI, can I set this up so i send the "GG" command via
the DataSubscriber ?
Version 3.99y changed address modifiers from being a prefix to being a suffix with the @ symbol. This was done to make it universal across all drivers. The added 1000 was a typo of mine. I went back and corrected it.

To use that with a DataSubscriber, simply put 48193@F in the PLCAddress property.

bachphi

  • Hero Member
  • *****
  • Posts: 653
    • View Profile
Re: Modbus TCP communication
« Reply #6 on: January 01, 2019, 08:34:27 AM »
Does he need to send GG command?
I'm not sure where the GG comes into play because I only quickly looked through the manual on the Modbus tables. It looks like something that may be for raw serial access.

I agreed. It seemed counter intuitive to send a command to read some weight, after all it's a scale, right.
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Holmux

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Modbus TCP communication
« Reply #7 on: January 01, 2019, 09:23:04 AM »
Reading this manual again, it looks like the register 2000 is sending the last gross weight obtained by the module, I will keep going at until I get a value true .

Thanks aging
/Holmux