Author Topic: MODBUS TCP/IP  (Read 7301 times)

peterjung

  • Newbie
  • *
  • Posts: 15
    • View Profile
MODBUS TCP/IP
« on: February 03, 2016, 09:42:50 AM »
Hi there

Can someone please help me out with addressing a MODBUS TCP/IP slave device from Advanced HMI?

I have been able to set up comms and put pushbuttons and indicators on a basic HMI but when it comes to putting the PLC address in the properties of the HMI control item I am a bit lost.  I am not clear on what format  the MODBUS address should be?

I keep getting errors on the comms - what is the correct format to put the MODBUS address - do I need the MODBUS control code as part of the address.

Any help would be very much appreciated!

Thanks in advance....

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: MODBUS TCP/IP
« Reply #1 on: February 03, 2016, 02:45:33 PM »

peterjung

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: MODBUS TCP/IP
« Reply #2 on: February 04, 2016, 04:07:40 AM »
Archie

Many thanks for the reply - I read through the thread you linked and downloaded the sample programme however none of it helped I am afraid!

My question is really simple - what is the format and place to enter a Modbus address for a single bit?

Here is an example of what I am trying to do:

Create a simple Pilot Light
CommComponent Set to: ModbusTCPCom1
PLCAddressValue set to: 01:1029

I though that this shoould read the bit at 1029 and control teh pilot light accordingly but nothing happens?

I have teh correct IP adress and I can see teh PLC online with another pice of software.

Hmm...any pointers what I am doing wrong here?


Thanks

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: MODBUS TCP/IP
« Reply #3 on: February 04, 2016, 04:14:05 AM »
It could be any one of these depending on what bit:

11029
01029
1:1029

peterjung

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: MODBUS TCP/IP
« Reply #4 on: February 04, 2016, 04:41:43 AM »
Archie - you are a Star!

It is the format 11029!  The other thing I have just learned is that we are using Modicon stype 1 based addressing....so the actual address is 11030!!

Eureka!

Thank you very much indeed...have been pulling my hair out with this!

peterjung

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: MODBUS TCP/IP
« Reply #5 on: February 04, 2016, 05:01:15 AM »
Hmm

Tried the same format to write to a bit from a Momentary PB but no dice....

Bit address is 1025, when I use 51025 I get "Invalid Address51025 - Invalid first digit in Address"

peterjung

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: MODBUS TCP/IP
« Reply #6 on: February 04, 2016, 05:17:24 AM »
Is there anywhere I can get some documentation on the MODBUS TCP driver?

Still having problems figuring out how to correct map address and function code

peterjung

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: MODBUS TCP/IP
« Reply #7 on: February 04, 2016, 07:25:10 AM »
OK... I worked it out.  I just figured out that I do not need to send the MODBUS function code - I guess it is implicit in the type of control......doh!

So If I want to read from Bit 1025 I need to address it as 11025
If I want to write to Bit 1025 then I need to address it as 01025

Simple when you know how I guess.....!!