Creating tags for Modbus TCP in Designer

I’ve followed the Modbus tutorial to created a modbus TCP device. The device is now connected.

However, I’ve problems on creating the tags where the value displayed was null. I’ve the following address with me

  1. 409219
  2. 408452
  3. 409734
  4. 409729
  5. 410753
  6. 410754
  7. 410755
  8. 40001

According to the manual, HR = 40000, so at the OPC item path, I should write it like this ?

  1. [Modbus]HR9219
  2. [Modbus]HR8452
  3. [Modbus]HR9734
  4. [Modbus]HR9729
  5. [Modbus]HR10753
  6. [Modbus]HR10754
  7. [Modbus]HR10755
  8. [Modbus]HR1

I tried writing all the addresses as mentioned above but the result I get was null. I checked on the Tag Diagnostics but Quality is either ‘Unknown’ or ‘Not Connected’. The modbus device was connected though. How do I get my tags running?

Before going to Designer, for Modbus TCP you need to follow this steps:

  1. go to ignition gateway (localhost:8088 or whatever port you are using)
  2. i assume you already configured your Modbus device
  3. under OPC-UA SERVER/Device find your Modbus device and click “More” then “Addresses”
  4. you need to map your addresses here… play around a bit… the import/export tool is quite useful
  5. once you finished mapping your addressses, then go to ignition designer
  6. your modbus tags should be available by browsing the default OPC-UA server

let me know if you have issue in step 4)… i can share with you sample exported file from my running project…

good luck!

These are correctly formatted for a device address=0. If not 0, you need something like this (for device #1):

    [Modbus]1.HR9219
    [Modbus]1.HR8452
    [Modbus]1.HR9734
    [Modbus]1.HR9729
    [Modbus]1.HR10753
    [Modbus]1.HR10754
    [Modbus]1.HR10755
    [Modbus]1.HR1

Address mapping like this is entirely optional – a convenience for OPC browsing.

2 Likes

Rendi and pturmel,

Thank you for the suggestions.

I figured my deive id is 1. I tried pturmel method and it worked!

However, I can only add one tag at a time as adding in more tags will turned the Quality to Bad and the new added tag value is null.

Why is that?

If the second tag you add is the only tag, does it work? Or is it still null?

If I delete the other tags, and only leave one tag, it’ll not become Null.

I’m not sure if my question was clear. If you delete the other tags, will a tag you added that was null while other tags were there become good quality and start showing the correct value?

it only works and will not turn Null if there was only one tag regardless if I change the register address. For example, I ONLY created one tag:

PV : [Modbus]1.HR9219

and there was value shown.

But if I created another tag, say SV, so now there’ll be two tags:

PV : [Modbus]1.HR9219
SV : [Modbus]1.HR8452

The new created SV value is Null, but both tags quality turned Bad.
However, if I change the tag value (from 0 to a number say 15), it appeared that the value at the controller changed too. But the value shown in Designer revert to previous value (stays at 0).

Weird :thinking:

Does this tag work as expected if it is the only tag (rather than PV being the only tag)?

yes it worked

With each individual address working but problems when you have more than one I’d experiment with different values for these advanced settings for the device on Ignition web configuration page:


image

You mean to disable this settings?

Yes, try various combinations.

It might have something to do with the behaviour of the Modbus Slave.

Let’s say you’re trying to read HR8452 and HR9219, Ignition might try to read all the registers in between as well (HR8453, HR8454, …, HR9218, HR9219).

This might have some issues with some Modbus Slave (Siemens PLC typically have this issue):

  • if let’s say some address in the middle (e.g., HR8454) is not configured in the Modbus Slave then when you are trying to read the whole range, the Modbus Slave will give you error
  • some Modbus Slave have limitation on how many registers they can response in one query

The above might explain why you might be able to read single tags, and not multiple tags.

Again, I would suggest you to try the method that I mentioned in earlier reply. With the manual addressing method, you yourself control how many register Ignition will read in a particular query.
This method actually “mimic” what most PLC/DCS do as a Modbus master.

Hope this helps!

Yes, the two advanced settings posted above relate to these scenarios.

Just saw your earlier post, sorry…

Yeah, seems that disabling “SPAN GAPS” should solve the problem.

Disabling “ALLOW READ MULTIPLE REGISTERS REQUEST” seems like very ineffective for actual production, but worth for trying around.

2 Likes

Disable the “Span Gaps” setting and leave “Multiple Registers Request” enabled.

edit: @Rendi.Yohanes is on it :slight_smile:

2 Likes

Everyone, thank you so much for the input. It worked and I’m only left to play around with the scaler.

I’ll also try out Rendi’s suggestion on the manual addressing method so I’ll have other alternatives.

Will ask again if I’m facing problems with this method .

Thanks.