Ignition OPC UA Compatibility

As suggested by your support team… It seems that this is the place to ask my questions. My goal is mostly to check the OPC UA capabilities of ignition and its compatibility with the OPC UA for Machine Vision companion specification:

https://opcfoundation.org/markets-collaboration/machine-vision/
https://opcfoundation.org/developer-tools/specifications-opc-ua-information-models/opc-unified-architecture-for-machine-vision/

First some general questions about OPC UA.

  • Do you have any plans of providing support for Alarms and Events with OPC UA? (With reading the data contain in the event)
  • If Alarms and Events support is not possible then will a better approach be to create my own OPC UA Module that provides support for this features ?
  • Do you have any plans on providing out of the box support for Part 100 (DI) of the OPC UA specification?
  • Do you provide support for any Companion Specification information model within ignition ?
  • Are you aware or support any of the current standardization efforts by the OPC Foundation? (e.g. Robotics, Harmonization, Machinery, Machine Vision, etc…)

Second here are some questions about OPC UA and scripting with ignition . I am using Ignition 8.1 for my testing:

  • [OPC UA] Do you support reading/writing complex data types (Structures, Enums and OptionSets) in a generic way?
  • [OPC UA] Do you support reading/writing optional fields on complex data types ?
  • [OPC UA] Do you support reading/writing variable array types (by themselves or inside a structure)? BaseDataType array.
  • [OPC UA] Do you support calling methods that input/output complex data types ?
  • [OPC UA] It seems to me that you are not able to set a node id that does has a different namespace index than 0 or 1 using the format ns=X,… were x is the namespace index. I see that you need to provide that complete namespace string. Is this correct and if so why do you do it that way?
  • [OPC UA/Designer] I created two tags that monitor two LocalizedText variables. I get the text something “LocalizedText{text=XXXX, locale =}”. I want to only display the XXXX part of the text, how can I do that ?
  • [Script/Python] Is it possible to add additional Python libraries to your environment ? If so how do I add one?
  • [Script/Gateway/OPC UA] When testing the browse opc functions I was able locate the methods of my server object but it was unable to find the methods or variables of objects that were on a different namespace. It seems that if the method is in a namespace index different than 1 or 0 it am not able to find the methods/variables, it was only possible to find object instaces. (I was also not able to find my variables but the quick opc ua client was able … not sure what is up with that.)
  • [Script/Gateway/OPC UA] It seems to me that when browsing you always only start from the “Objects” folder I also cant specify a object instance as starting point for browsing which I find strange, but this might be more related to previous point why it doesn’t work.
  • [OPC UA] Where do I need to specify the browse name/path to locate a variable.? Do you support that feature ?
  • [OPC UA] Is it possible to get the ObjectType of an Object instance at run time when browsing?
  • [OPC UA] Is there a way I can check if a method has the IsExecutable attribute set before I call it?
  • [Script/Gateway/OPC UA] Since OPC UA methods are only supported on the gateway context. I wanted to know if there is a way that I can use the scripting console in that context. I will like to try my script before I add it to its particular gateway event where is harder to debug some stuff.
  • [OPC UA/Gateway] Since OPC UA methods are only supported on the gateway context. I tried calling a server method on startup event and I get the following error when I try to call my method “Gateway script MessageHandlerException, project ‘Test’, message handler ‘SelectModeAutomatic’: com.inductiveautomation.ignition.common.script.message.MessageHandlerException: The message handler “SelectModeAutomatic” could not be found! Check your event script message handlers.” I created the event handler and made sure that the name is correct, It still somehow fails.
  • [Gateway] I tried creating two Gateway scripts that should be trigger on a message on a button click from the client, but is not calling the function. Do I need to do anything else other than to set the script call on the button and handle it on the gateway?

Not immediately. It's not clear what the integration with Ignition would look like and nobody who has inquired has been able to explain what they would expect to see either.

Good luck? Not sure what exactly you're looking for. Maybe you can explain more.

No, no, yes. Ignition's OPC UA server is primarily for providing access to data from various protocol driver implementations, most of which don't have a data model covered by any companion spec. The OPC UA client is fully generic and there's no reason to use any companion specs there. Our BACnet driver is attempting to use the sorta-in-development BACnet companion spec but I'm not yet convinced that decision was the right one.

Yes.

Yes.

Untested. Reading and writing might only work from scripting. Not sure. I doubt the tag browser would be happy with an array of heterogeneous values - I think support has encountered a server like this before an was unable to do anything with the value.

Yes, from scripting only. There have been some posts about it here on the forum. It can be tricky.

You can use any namespace index you want with that syntax. When dragging and dropping from the OPC browser is where you'll see Nodes from namespace index 2+ get assigned a namespace URI instead. This is because some servers, like aggregating servers, will inadvertently "shuffle" their namespace arrays on startup based on the order the underlying servers connect. The only way to maintain correct NodeIds is to use an absolute id with the namespace URI rather than a relative id using the index.

Ignition's support for some of the built-in OPC UA types is lacking in some cases, such as LocalizedText. You probably shouldn't have to try to extract that value, we should just present it as a String and discard the locale. The alternative is that we would convert it to JSON and you could extract it from that.

Yes, with some limitations. There's more information about this in the user manual and here on the forums. You're limited to Python 2.7 compatible libraries that do rely on CPython or external DLLs.

There shouldn't be any limitations by namespace. The browse will return Variables, Objects, and Methods of any forward hierarchical referenced type.

Scripted browses start from wherever you specify. The OPC Browser starts from the Objects folder but configuration on the connection allows this to be changed to Root.

I don't know if you're talking about the TranslateBrowsePathsToNodeIds service or not, but I think the answer is no. Any OPC tag in Ignition is identified by its OPC Item Path, which is the NodeId when the underlying server is an OPC UA server.

It's not.

I don't think so.

That would be nice, but I think you just have to write your script in a library and test with print outs and invocation via a test memory tag changing or something.

3 Likes

[Alarms and Events]
So I have to specific use cases in the Machine Vision CS. When you have a MV server you can get various events that tell about the state of the system, they are essential in controlling the server. To make this short I will just focus on the most important one for the user “ResultReadyEvent”. The ResultReadyEvent is trigger every time my server finish doing a machine vision task ( reading a barcode, , finding defects, finding text, etc…), the event tells me everything i need to know about the task, like what recipe was used, what the system configuration was, etc… If my result data is small/simple enough (e.g. some text and/or a Boolean) I can add that result data to the event itself using a variant array. If for example wish to get those results and push it into a Database to do something with them later there is currently not way for me to get this information into Ignition. The result data is a variant array because different recipes of my vision system can output different result data.

There are other ways to get the result data like using methods or variables but they are not as “nice” as just catching the event and processing it specially if my system is working continuously, doing machine vision task can be very complex, most importantly the processing times are not always deterministic and can change depending on environment variables or the task at hand.

For alarms is just telling my user that something has happen that requires attention, something like “camera 1 is disconnect” for example is critical to the machine.

[Complex Datatypes]
Can you give me a code snipped on how to use complex data types as variables and input output in method calls ?

[Browse Nodes]
Yes, I was talking about TranslateBrowsePathsToNodeIds service. That means that I will always need to know the node id of the variable or method that I want to use correct ?
My server uses forward references “HasComponent” totally normal but I still do not get the nodes from my server when I use browse. I am able to see all my nodes use UaExpert but not when I try to use the browse functions. Maybe I am doing something wrong any ideas ?

How it looks on UaExpert:

image

No methods show on quick client ?

Scripting attempt, notice that now the current state variable does not appear like in quick client and that methods do not appear for my object but do appear for the Server object.

This thread has some examples of calling a method with complex inputs. I don't have a server with methods with complex input arguments set up to test this with and write a code snippet against right now.

Yes. Though we might be able to add some new system.opcua scripting functions in the future for OPC UA specific things like this. I've avoided exposing any kind of functionality involving browse paths because the way syntax requires you to specify namespace indices and reference types is non-intuitive to anybody who isn't pretty familiar with the OPC UA spec and it would likely just turn into a support hot spot.


It might be interesting to capture this browse traffic from Ignition in Wireshark as well as get screenshots of the references panel in UaExpert to see what kind of references each node has at each step. HasNotifier and HasEventSource references are removed from browse results before they are returned. Not sure if that is relevant here, though.

edit: Ah, Methods are not returned by the OPC browsing either. Probably because Ignition can't do anything with them in the QC or OPC Browser. But maybe they should get left in so scripting can see them.


I think overall you'll find right now there are a lot of rough edges when trying to use any of the more advanced OPC UA features in Ignition. OPC UA has a more sophisticated and capable data model and type system than Ignition does.

Hello Kevin,

Sorry for the long waiting time.


[BrowseName functions]

I think even if you provide functions for using browse names most people will just default to using a NodeId directly and the browse functions will only be used by the more OPC UA savvy developers. I think that if you were to provide such a feature it will also make sense to also allow a way to query the type of the Object instance since If I am using browse names it is because I know the standard browse names from the object type. In Machine Vision for example If I want to automatically check if the Recipe Manager object exist for that instance, I can just try to follow the "RecipeManagement” standardize browse name and see if it is there.

[Events]
For simple events I will expect to be able to create a script in the “GateWays Events” section of the ignition designer and to be able to select from a list of the available events from the server. Once I have selected my event, I will like to receive the event content (that is all variables that have HasComponet or HasProperty references in the event) as perhaps a json. As an example if I have an event base on the TransitionEventType I will like to get a json that contains the fromState, toState and transition components.

It might get a little bit more complicated if you want to also support Alarms and Conditions (that are also events) since these have confirm and acknowledge methods that you must call when the “frontend” acknowledge the situation. I think you could work around such complication if you add the node id of the instance and the available methods node ids in the json data somehow for this special case so that I can call those methods at a later time.


For the moment I think that I will wait and stop testing Ignition but If you want me to go more into detail about this topic do not hesitate to contact me directly.

You will want to add to IA’s ideas portal for new feature requests. It would be good to have these listed with these requirements descriptions.

1 Like

I know this thread is a few years old, but I came across this while having an issue that I managed to solve and wanted to post it here for anyone else who stumbles upon it in the future.

I was working on incorporating an opc ua server into a piece of software and testing ignition against it when I ran into the same problem the OP did where ignition would not browse nodes on namespaces other than 0 and 1.

In my setup I have the root node for each namespace referenced by the object node of namespace 0 to allow the default browse to bring them up.

Strangely, after the browse response from my software to ignition, ignition would send follow-up reads for attributes of the nodes in the different namespaces with the correct node IDs including the namespaces above 1, so I know it got them correctly but it still wouldn't show them in the browse results.

I ended up solving it by making sure node {ns=0;i=2255} (Namespace Array) was returning the list of namespaces properly. It has to return an array of strings. It appears that it should be the URI for the namespace, but I found that didn't actually matter (thank goodness) and I was able to just use arbitrary strings (i used a unique namespace "name" for each one - I didn't test what would happen if there were duplicates).

Yes, for NodeIds with namespace index > 1, Ignition will look up the namespace URI and store that in the OPC Item Path instead (when doing a drag n' drop from OPC Browser to Tag Browser, anyway). This means your NamespaceArray must be filled out and consistent. This is a fundamental requirement of OPC UA.

1 Like