Modbus configuration issues

Discussion of configuring and troubleshooting communication to PLC's or other devices using iX Developer.
Post Reply
asccloutier
Posts: 8
Joined: Sat Oct 19, 2013 6:19 pm

Modbus configuration issues

Post by asccloutier »

First off, I'm new to most of this: iX, Modbus and PLCs. So any patience is greatly appreciated. Secondly I have poured over the documentation for just about everything related to what I'm doing and am still stuck.

I am currently working on my first HMI project for a small hydro site (family owned). My background is in software so the C# foundation in iX is what drew me to it. Here's my setup:

iX T12B (not that it's relevant at this point)
Ethernet Network
Koyo/DirectLogic DL06 with H0-ECOM100 Ethernet Adapter.

Since iX only communicates with Koyo via Serial, I have chosen to go with Modbus which the Koyo supposedly supports just fine.

As part of my debugging, I used two different utilities (Modscan64 and Simply Modbus TCP) to verify that I could retrieve register values via modbus over ethernet. I was concerned that the DL06 ECOM100 adapter was not being configured correctly. By pointing the utility at the PLC's IP address, setting the slave ID to 1 and using the modbus command 03 to access register 44106 (decimal) or V10011 on the DL06, I was able to retrieve the BCD value of 610 which was the current value set via the DirectSoft 5 debug tools.
Modscan utility showing correct value at requested register.
Modscan utility showing correct value at requested register.
modscan.JPG (51.76 KiB) Viewed 15344 times
Having verified that registers were available via Modbus I moved over to iX Developer. I set up the MODICON MODBUS MASTER controller in iX as shown in the attached screenshots (ModbusController). I proceeded assuming that the "node" value corresponds to the typical modbus slave ID. I set up the PLC IP as the station.
Modbus settings in iX
Modbus settings in iX
modbus config.JPG (69.63 KiB) Viewed 15344 times
Modbus Stations in iX
Modbus Stations in iX
modbus stations.JPG (52.14 KiB) Viewed 15344 times
Under Tags I have 44106 set under the ModbusController Column. The data type is set to int16. It's BCD on the PLC but I figured it would come across as an unconverted INT and I could deal with it later if I got it working. It was my understanding that nothing else was needed. So to test I created a text field and bound it's Value to the TagId ("TestTag").

Unfortunately, when I run the project I get nothing. The text field reads "0". I'm not sure where to go from here. I've poured over the DL06 and ECOM100 documentation but that side seems to be working. I've also dug through the iX manual reading about controllers and tags. I've read the modbus driver documentation over and over but find that the driver does not seem to correspond to everything else I'm reading about modbus. For example, is the modbus command (03 for example) handled behind the scenes?

I've played with most of the settings in the modbus controller with no effect. I feel like I must be missing something small.

If anyone can provide any advice or suggestions I would be HAPPY to hear.

Thank you!

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: Modbus configuration issues

Post by mark.monroe »

You have the Modbus Master addressing set to use Decimal. Which means that the address range for the Holding resisters is 400000.0 - 465535.15.

By using the 44106 address you are referencing the Coil status registers (000000 - 065535), which I do not think you want to do.

The controller driver documentation tells you the address ranges when you have the driver set to use Hex or Decimal. I think you need to change the Modbus Master addressing to Hex.
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

asccloutier
Posts: 8
Joined: Sat Oct 19, 2013 6:19 pm

Re: Modbus configuration issues

Post by asccloutier »

Thank you for your reply. I think this is the right track but it's not quite right. The address I'm using, 44106, is a decimal address converted from Octal. In the PLC the address is V10011 which converts to 4105 in decimal which gets added to 40001 according to the automation direct documentation which creates the 44106 that I'm using.

In the two modbus debugging tools I'm using 44016 provides the result I'm looking for. I've tried turning it into 444106 to see what happens but I had no luck. I've also just tried switching to HEX and using 44106 with no luck. Based on the modbus debug tools I don't see how I can get another significant digit into the address.

I'm continuing to dig into this line of thinking but the addressing scheme in the modbus driver documentation seems to be consistently 10X what the AutomationDirect addressing scheme is. The AD scheme seems to work with generic modbus tools so I know that address works in some form. Am I using the right modbus driver?

Thanks.

asccloutier
Posts: 8
Joined: Sat Oct 19, 2013 6:19 pm

Re: Modbus configuration issues

Post by asccloutier »

So after some additional experimentation I now am able to retrieve the value that I was after. My explanation is frustrating but it seems to be working.

The DL06 PLC modbus documentation states that the Octal Address (V10011) should be converted to decimal (4106) and added to 400001. Which gave me 44106, which would never work. Upon the suggestion of a colleague (who is NOT familiar with iX) I changed my address to 44105 and was suddenly able to read the value.

Apparently my PLC start address is 1-based. :(

Changing the start address setting to 1-based now allows 44106 to work properly.

I'm not sure why the documentation states that it needs 6 digits for the address. That doesn't really make sense but I'm up and running now.

Thank you for the suggestions!

Aaron

Alexey_Z
Posts: 2
Joined: Wed Aug 21, 2019 12:05 pm

Re: Modbus configuration issues

Post by Alexey_Z »

Hi there.

It seems I've got same issue as the topic starter did.

I'm building the program for X2 extreme 7 HMI which should replace QTERM G72/A7 in our equipment.

Now I'm trying to establish communication with the PLC (it is Schneider Electrics SCAPAPack32 in my case) and read MODBUS data. No luck so far. PLC has IP address set to 10.0.0.80. I know PLC is working, accessible, and my target registers (40100 and 40101) have values.

Now what I have in my test iX Developer program.

Fist, controllers. I have two controllers added, one uses Schneider Electrics Modbus driver, another one - MODICON Modbus Master one:
02 - controllers.PNG
02 - controllers.PNG (15.55 KiB) Viewed 7059 times
Here are the settings for Schneider controller:
03 - schneider.PNG
03 - schneider.PNG (35.52 KiB) Viewed 7059 times
Here are the settings for MODICON controller:
04 - modicon.png
04 - modicon.png (40.22 KiB) Viewed 7059 times
The message doesn't allow to add more than three attachments, so I'll break it into two parts.

Alexey_Z
Posts: 2
Joined: Wed Aug 21, 2019 12:05 pm

Re: Modbus configuration issues

Post by Alexey_Z »

Now tags:
05 - tags.PNG
05 - tags.PNG (32.6 KiB) Viewed 7059 times
All tags have Data Exchange Directions both From and To checkmarks set. I won't be doing the screenshot for this, to save space.

Here is the screen I designed for test purposes:
06 - screen.PNG
06 - screen.PNG (53.21 KiB) Viewed 7059 times
You can see the text object on first line should read contents of register 40100 using MODICON controller. Text object in line 2 should read register 40101 from same controller, and two other ones should read same registers using the Schneider controller. Last block should display connection error message as you can read from the label.

But when I start simulation on my PC, I get exactly no data. I.e. all registers show zeroes, and there is no communication error message:
07 - runtime.png
07 - runtime.png (24.27 KiB) Viewed 7059 times
The question is What am I doing wrong?

Thank you in advance for your input!

Alexey.

Post Reply