AdvancedHMI Software

General Category => Support Questions => Topic started by: peterjung on February 03, 2016, 09:42:50 AM

Title: MODBUS TCP/IP
Post by: peterjung 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....
Title: Re: MODBUS TCP/IP
Post by: Archie on February 03, 2016, 02:45:33 PM
See if this helps any:

http://advancedhmi.com/forum/index.php?topic=765.0
Title: Re: MODBUS TCP/IP
Post by: peterjung 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
Title: Re: MODBUS TCP/IP
Post by: Archie on February 04, 2016, 04:14:05 AM
It could be any one of these depending on what bit:

11029
01029
1:1029
Title: Re: MODBUS TCP/IP
Post by: peterjung 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!
Title: Re: MODBUS TCP/IP
Post by: peterjung 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"
Title: Re: MODBUS TCP/IP
Post by: peterjung 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
Title: Re: MODBUS TCP/IP
Post by: peterjung 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.....!!