How to use system.opc.readValue

I want to read value of followed opcvalue descibed in tree :IgnitionOPCUA /devices/mine/w_i11-10/w_i1 ,I use system.opc.readValue(‘IgnitionOPCUA’,’ [mine]w_i1-10/w_i1’),but read nothing,how can use the param of function system.opc.readValue,thank you

I have solve the problem.

Glad you got it working.

How can I get just the value to return and not the status code, etc?

You can’t, but you can just use the .value of the QualifiedValue that gets returned.

# Reading just one value
qv = system.opc.readValue('Ignition OPC-UA Server', '[ctt]Scalar/Bool')
print 'value = %s' % qv.value

# Reading multiple values
qvs = system.opc.readValues('Ignition OPC-UA Server', ['[ctt]Scalar/Bool', '[ctt]Scalar/Byte'])
just_values = map(lambda x: x.value, qvs)
print 'values = %s' % just_values

I have it working with the Ignition OPC server but not with Kepware are there any known issues with the format?

When reading against Kepware the String you use for item path is going to need to be the full NodeId of whatever tag you want (assuming you’re talking about UA). Try browsing Kepware, dragging a tag into SQLTags, and looking at what the item path looks like.

Am I wrong in using the string that is displayed in the sqlt_meta mysql table? I also copied the string from the “edit tag” path in the designer.

The one from the edit tag dialog would be it, but it’s probably hiding part of it from you. There’s like an ns=1; prefixed to it or something… Not sure exactly how to find out what it really is without looking at Kepware.

I’m striking out with everything I’ve tried when attempting to read the value from Kepware. I read over this article kepware.com/Support_Center/S … client.pdf and tried changing the structure. Didn’t work. I’ve copied the string from the edit tag dialog and tried copying the string from the OPC quick client to no avail.

The structure I have IS working for the Ignition OPC Server…

On page 19 of that document you posted there’s some example addresses, the ones like “ns=2;s=Blahblahblah”. Those are the format you need. Those are the the NodeIds of the nodes in Kepware.

If that doesn’t work/you can’t find those give support a call and they can poke around with you on a GoToMeeting.

Thanks. I tried those formats as well. We can revisit next week. I’m not sure why I keep getting null for the return.

ns=2:s=Channel1.Device1

thats how mine looks in the tag, I havent tried using the opc.readValue

It’s possible that something isn’t working correctly when using system.opc.readValue. Investigation time!

I am now running Ignition 7.2.9-beta5. The Kepware is now working correctly when running the opc.readValue.

However, now some of my Ignition OPC UA Server floats are stepping registers.
Example: request register 7004, returns 7006 etc.

This occurs in the OPC Quick Client from the web as well. Weird thing is that it the SQLTags provider is getting the right values on the scheduled scans… :scratch:

[quote=“jasonpdavid”]I am now running Ignition 7.2.9-beta5. The Kepware is now working correctly when running the opc.readValue.

However, now some of my Ignition OPC UA Server floats are stepping registers.
Example: request register 7004, returns 7006 etc.

This occurs in the OPC Quick Client from the web as well. Weird thing is that it the SQLTags provider is getting the right values on the scheduled scans… :scratch:[/quote]

Call into support and we can poke around and see what that’s about…

Try using the Modbus-v2 driver if you aren’t already. That’s probably the first thing support will have you do.