S7-300 send data to PC with Ignition/OPC-UA

Hi

I’m very new into this, but also very keen to learn new stuff.
I’m currently practicing on a test setup with a few DI and DO’s.
I would like the plc to send data from a DB to the PC and use Ignition to create a project.
I’ve played around with the ignition designer and the dairy simulator and getting some basic graphics to work is the least problem right now.

I’ve setup the 343-1 Lean with correct IP and network. And the OPC-UA server on the PC is connected to the PLC over ethernet.

I’ve made an AG_Send FC5 in the PLC programme, stated that data in DB11 should be send.
Looking at the status bits in the PLC of the FC5 block I’m not sure the data is actually being sent.

And for sure, when trying to add tags in Ignition designer, the device has no tags to choose from.

What am I missing here? Anyone has the patience to help a newbie :wink:

The S7 protocol doesn’t support browsing, so tags have to be added by hand in the designer.

Create a new SQLTag, and for the Item Path you would specify something like “[MyDeviceName]MyAddress”, where “MyDeviceName” is whatever you named your device when you set it up in the gateway and “MyAddress” follows the address format for the kind of device you are connecting to.

The manual page for the Siemens driver describes the address formats a bit. Addressing a tag in a DataBlock would be something like:

[MyDevice]DB11,B0

which would address DataBlock 11, offset 0 as a Byte.

Thanks, I didn’t know that about the browsing.
But I got the designer setup now, to poll data from the DB in question.

Thanks for your help.

hi,I’ve another question regarding this topic :
is it possible to directly access the PLC symbols from the Ignition opc-ua server without using OPC client and SQLTags ?

I mean, I’d like to develop an OPC-UA client that directly accesses the datapoints in the same manner as described in Siemens Drivers addressing page (inductiveautomation.com/support/ … ssing2.htm )
thank you for your help
Eric

[quote=“RicoCh”]hi,I’ve another question regarding this topic :
is it possible to directly access the PLC symbols from the Ignition opc-ua server without using OPC client and SQLTags ?

I mean, I’d like to develop an OPC-UA client that directly accesses the datapoints in the same manner as described in Siemens Drivers addressing page (inductiveautomation.com/support/ … ssing2.htm )
thank you for your help
Eric[/quote]

You can develop your own OPC-UA client and connect it to the Ignition OPC-UA server, if that’s what you’re asking.

hi kevin,
yes that’s what I mean but the problem is not here.
when I connect to the Ignition OPC-UA via a generic OPC-UA client, I can only see “_meta:Diagnostics” and no datapoints from the PLC, when I can fully see all the datapoints from another AllenBradley PLC.
ok, I saw that S7 protocol doesn’t allow browsing , yet I thought I’d be able to access my DBs in the same way like [myPLC]address .
Eric

[quote=“RicoCh”]hi kevin,
yes that’s what I mean but the problem is not here.
when I connect to the Ignition OPC-UA via a generic OPC-UA client, I can only see “_meta:Diagnostics” and no datapoints from the PLC, when I can fully see all the datapoints from another AllenBradley PLC.
ok, I saw that S7 protocol doesn’t allow browsing , yet I thought I’d be able to access my DBs in the same way like [myPLC]address .
Eric[/quote]

You can, but you have to figure out how to force the UA client you’re using to read or subscribe to nodes with the right NodeId, which you’ll have to enter manually. They won’t show up in a browse.

hi Kevin, thanks for your support.

the problem is exactly there : what is the nodeID format accepted by the Siemens Driver module that can be passed to S7 protocol ?

I’ve attached a capture of what I see with both the Ignition server and the Simatic opc ua server.
could you give me a hint on this right nodeId thing please?
thanks again
Eric


The addressing format is going to be like it’s specified in the Ignition user manual: inductiveautomation.com/support/ … ssing2.htm

You’ll also have to make sure the NodeId is in namespace index 1, and you prefix the above Siemens address with “[DEVICE_NAME_IN_IGNITION]”.

So, for example:

[MyS7300]IB0
[MyS7300]DB1,DI8

etc…

Just to make sure there are no misunderstandings:
The Siemens OPC Server supports importing symbolic addresses from a STEP7 project, so these symbols (like CPU1:MyDB.MyTag) can then be used by OPC clients instead of the address.

The Ignition OPC Server does not know the symbols, so you always have to use absolute adressses here.

thanks both for your help,
yes Chi, I totaly agree cause Siemens OPC server uses XDBs to resolve symbols names :wink:

and to answer you Kevin, I totally agree with you on namespace index (1) and NodeId format string.

I think the problem I encounter is with the "Simple OPC UA client " from Siemens in which i don’t see how to formalise this namespace index.
when I use Siemens’s OPCUA the correct string is “S7:”, yet I can’t find the corresponding one for the ignition server :smiling_imp:
(yes , the name given here - LiaisonOPCUA_S300) is the one of the S7 connection bewteen the PLC and the OPCUA server and should not be used in the [S300]address string :wink: )

I’m about to going back to Prosys Sample Client … and try to find the correct method to send my “ns=1, NodeId” reference string
keep in touch then :slight_smile:
Eric


Ah, the simple client… A very good example of how not to make an OPC-UA client. :smiling_imp:

The namespace you are looking for is:

uri://ip.ip.ip.ip/Ignition%20OPC-UA%20Server


When using the UA-Expert client, you will see this is entry #1 in the namespace array (aka NS1). In any other client i know, you use the index instead of the value…

Hi Chi :slight_smile:

thanks a lot …; that was so obvious that URI meant “complete URI” that I totaly missed it! :blush:

It went perfectly well with Prosys java sdk sample client and was dealt in 2 lines of code !

static S300nodeIdMW0 = new NodeId(1, "[S300]MW0"); read(S300nodeId1) ;

since XDBs are not very text readable, it may be interesting to be able to imports symbols and DBs into Siemens OPCUA module from some Step7 exports and be able to build internal PLC’s “objects namespace” :wink:
is it somehaow on IA’s roadmap?

cheers
Eric

[quote=“RicoCh”]Hi Chi :slight_smile:

thanks a lot …; that was so obvious that URI meant “complete URI” that I totaly missed it! :blush:

It went perfectly well with Prosys java sdk sample client and was dealt in 2 lines of code !

static S300nodeIdMW0 = new NodeId(1, "[S300]MW0"); read(S300nodeId1) ;

since XDBs are not very text readable, it may be interesting to be able to imports symbols and DBs into Siemens OPCUA module from some Step7 exports and be able to build internal PLC’s “objects namespace” :wink:
is it somehaow on IA’s roadmap?

cheers
Eric[/quote]

I had a parser for the .AWL file format about 80% ready for the initial release of the driver, but then we went ahead and launched without it. The parser has since been sent to the bit dungeon. Maybe someday I’ll work on that again.

one more question for my global comprehension of the behaviour:

we see that, when discovering ignition OPCUA namespaces, the one that indexes Devices (ns=1) is only showing the “top” folder for each connected device.

Then, if we want to access one specific address inside the PLC, we have to prefix it with [device_name_in_ignition_module]
so my question are :
what is the orientation taken by IA for the OPCUA module to access Siemens’s PLC adresses?

Is it by building the namespace with ALL available NodeIds (taken from PLC’s DataBlocks,IOs,Flags, etc.) of the declared/connected PLCs (eg: S300)? and if so, how are managed Hardware bloc extensions (DIO,AIO, etc.)?

or is there a sort of “only one” nodeID (eg: S300) that has a special parsing gateway or feature that extracts the address prior to send it to S7 channel ?

thanks in advance for any info you can share on that :wink:
Eric

[quote=“RicoCh”]one more question for my global comprehension of the behaviour:

we see that, when discovering ignition OPCUA namespaces, the one that indexes Devices (ns=1) is only showing the “top” folder for each connected device.

Then, if we want to access one specific address inside the PLC, we have to prefix it with [device_name_in_ignition_module]
so my question are :
what is the orientation taken by IA for the OPCUA module to access Siemens’s PLC adresses?

Is it by building the namespace with ALL available NodeIds (taken from PLC’s DataBlocks,IOs,Flags, etc.) of the declared/connected PLCs (eg: S300)? and if so, how are managed Hardware bloc extensions (DIO,AIO, etc.)?

or is there a sort of “only one” nodeID (eg: S300) that has a special parsing gateway or feature that extracts the address prior to send it to S7 channel ?

thanks in advance for any info you can share on that :wink:
Eric[/quote]

Our OPC-UA server/drivers will attempt to create UA Nodes “on the fly” as they are accessed. So the Siemens nodes don’t actually exist in the address space until someone attempts to access them for the first time.

There’s no access to the extensions you mention.

hi, kevin,
thank you for this information,

and so they don't either after first access !
when I rebrowse the namspace afert having accessed my node , I still don't see it

I was thinking about doing some PLC nodeId initialization when launching my OPC-UA client, to get them all "under view"
do you think it's worth it ?

another point is : does the newly created Nodes have subscription, historizing, etc. available to my client ?
or, how can we set them to have so?

cheers
Eric

[quote="RicoCh"]hi, kevin,
thank you for this information,

and so they don't either after first access !
when I rebrowse the namspace afert having accessed my node , I still don't see it
[/quote]

They won't ever show up during browsing, but they should still exist. You can use the Read, Write, CreateMonitoredItem, DeleteMonitoredItem, ModifyMonitoredItem, etc... services and target these Nodes like any other node.

Hi.

I have been trying to add tags from a S7 300.

I understand that I need to add them manually, using Ignition Designer>Add OPC tag:

Name: Tag1

Data type: Bool

Enabled: Yes

Acces rights: read only

OPC Server: Ignition OPC-UA Server

OPC Item Path: [S7 300 IP 125]DB7,DBX0.0

Scan Class: Default

After apply and close the pop-up I can not find the tag or connect it with any display of my HMI.

I am sure that I am doing something wrong, but I am very new with Ignition

Thanks

[quote=“adriancampos”]Hi.

I have been trying to add tags from a S7 300.

I understand that I need to add them manually, using Ignition Designer>Add OPC tag:

OPC Item Path: [S7 300 IP 125]DB7,DBX0.0
[/quote]

Is ‘S7 300 IP 125’ the name of the device as you’ve set it up in the Ignition gateway? If not, that’s what is supposed to go in that section.

Additionally, DB7,DBX0.0 is not a valid address. What address are you trying to read? Have you read the user manual section on Siemens addressing? inductiveautomation.com/support/ … ssing2.htm