Error on writing to tag associated with enum

My PLC is setted up like this


Mode in which the press will aim to reach a state where physical access ;
this may (or may not) require human intervention depending on the case
stop_and_secure := 0,

Normal run mode. Loading may be automatic or manual : see relevant
configuration variable for more information.
run := 10,

Set-up mode. Allows tool to be put on the press and clamped.
setup := 20,

Expert (maintenance) mode allowing control of individuel actions.
expert := 99

When I try to write value to my tag I got an error… My tag is Integer.

Maybe someone will recognise what you’re referring to, but for the rest of us, what PLC are you talking about?? I haven’t seen enums used in any of the PLCs we use (then again, I’m also not a PLC guy)

Also, how is your tag configured in Ignition? (screenshot?)

We code with CODESYS. We are now in test, so we use CODESYS SOFTPLC.

Does this happen if you write to it in the Quick Client?

In the Ignition Gateway find the logger(s) for OpcUaConnection and set them to TRACE and then write again.

It might also help to get a Wireshark capture after changing the SecurityPolicy of the OPC UA connection to None.

I have activate log trace on OPCuaConnection, nothing append when I try to write.

Same problem in Quick client…

You may need to call support then. There should be messages in the gateway logs when the write happens (after turning the logger to TRACE).

I have tried with UA Expert and all works great. I got too my list of enumeration. My datatype in my enumeration is short. Does Ignition can support enumaration like UA Expert ?

Ignition does support enum values from OPC UA but it won’t list the symbolic name for each member. They are integer values when used in Ignition OPC tags.

Why I unable to write to it?

I don’t need the list, only the values.

Why I can read but not write?

I don’t know. Turning that logger to TRACE should have logged something in the gateway logs.

If you can get a Wireshark capture of the write instead I can take a look at that. The connection has to using SecurityPolicy None while capturing.

Hope is it what you need… (42.8 KB)

I don’t see any OPC UA traffic in the capture.

Will retry…

How can I be sure capture I send you contains OPC UA traffic?

Are you running Wireshark on the machine with the Ignition gateway installed?

The capture should contain traffic between the gateway IP and PLC IP on port 4840 or whatever other port the OPC UA server is running on.

Everything runs on same machine… (Wireshark, Ignition, PLC)

This time I have recorded loopback traffic (619.1 KB)

Okay, it’s failing because the server returns Bad_TypeMismatch when Ignition writes an Int32 value.

The server reports the DataType as identified by NodeId |type|CODESYS Control Win V3 x64.amt_machine_30.AMT_AS0153.AS0153_TRIM_PRESS_MODE, so need to figure out what underlying DataType that resolves to.

If possible, can you browse in UaExpert under Types > DataTypes > BaseDataType, and start looking for this Node? You mentioned it’s an Enumeration, so I’d expect to maybe find it under the Enumeration Node somewhere. If you can find it a screenshot of the browse hierarchy in UaExpert will be useful.

Also, if you can use Wireshark to capture the successful write from UaExpert that may provide a useful comparison.

Hmm, actually I have a guess at what might be wrong. The WriteRequest from Ignition includes a StatusCode in the value, which many servers do not support. It’s strange that the error reported is Bad_TypeMismatch but possible.

That the StatusCode is included with the value is a bug that only happens if coercion to the target datatype fails. There must be some problem reading the DataType tree from this server or using it to resolve the target type.

Turning these loggers to TRACE may yield more information:

  • com.inductiveautomation.ignition.gateway.opcua.client.connection.OpcUaClient
  • com.inductiveautomation.ignition.gateway.opcua.client.connection.DataTypeTree
  • com.inductiveautomation.ignition.gateway.opcua.util.Conversions

What version of Ignition are you using? There should have been a message from the Conversions logger in between those 2. I can’t really see any reason for this not working right now though.