Vision and tag design help - 6 cells of real[250] from plc

What I am doing:
At the end of the test, I want to display the results of the selected cell to a table.
I want to be able to easily export all the cells of data or all the cells of data with buttons.

What is the best way to trigger the tag to read real[250] from the plc for each of the 6 cells when I had the cell enabled and the test finishes?

Do I need to use driven tag group with oneshot true when that test was enabled and the test finished?
Driven Tag Group Video at Inductive University]
Or is there another way?

My preferences so far:
I liked that the query tags have an execution mode.
I don't know if I like tag groups though. I don't a tag group every time I want to trigger collecting real array data form plc I think.

If you don't want to have the tags be subscribed to all the time, then you can use system.opc.readValue() or system.opc.readValues() to read the tags directly from the device at the time of need.

Processing those results into a dataset to place in a table, or export is something that is covered all over the forum.

4 Likes

Am I being overly cautious trying to avoid subscribing to 6x 250 real tags?

I have a full gateway.
I am at about 24000 tags.
10% cpu, memory "sawtooths" to 75% these days.

I think I need some benchmarks.

IMO, it's less about being cautious and more about, do you need those 1500 tags, for anything other than this one thing. Are these tags that you care about the raw value at any time other than after a test is performed? Do they need to be on a display/view somewhere? Are you going to bind to them for some calculated value? In other words do you need these tags to have there values persitsed?

If you're asking if you're gateway will handle 1500 more tags, we would need more information, what I can tell you is, I have a gateway with fairly minimal specs that is handling 200K+ tags, no problem. And if you have the right hardware, there are installations out there with 1M+ tags.

But just because the gateway can handle the tags, and you can make them, doesn't mean that you need to or should.

3 Likes

Thanks again

I saw this:
How to create a 5000 element float array in UDT - #24 by jfan]
Jordan posted an example script using a list comprehension to insert a float array to a database.

I tried to read the array to a value.
Going to work with support I think.
Something is an issue with the path or the server name.

To answer your previous edits:

'ns=1' is assumed if you don't include it.

I usually create one tag so that I can hace an OPC path string for reference, then beat that string into submisson.

If you show what you've tried, my answers usually get better. Usually... probably...

1 Like

server 	= 'Ignition OPC UA Server'
path    = '[Machine1]Global.Gross_Average'
value	= system.opc.readValue(server, path)

print "Value: " + str(value.getValue())

I think the server is there.
I need to state which provider?

Tag's OPC Server is identical.
OPC Item Path is different. Has the ns=1;s=[Machine1]Global.Gross_Average

Heard back from support.

7.9: 'Ignition OPC UA Server'
8.1: 'Ignition OPC-UA Server'

Manual for 8.1 needed updating for that he said.


Update
For me on my gateway, I needed a hyphen between 'OPC' and 'UA' for the provider name.

https://docs.inductiveautomation.com/display/DOC81/7.9+to+8.1+Upgrade+Guide#id-7.9to8.1UpgradeGuide-ImportingProjectsintoaFreshInstall

1 Like

I am using 8.1.19.
I never used 7.9.


That page says the opposite of what I did or something that confuses me:

What you heard from support is wrong, or you misheard. The hyphen is out of date.

1 Like

I didn't have a hyphen.

I added the hyphen, it works now.

I am confused why this is.

You are working on a system that was originally created in 7.9, so the name of the loopback connection is what it used to be?

1 Like

I am just a worker bee.
I didn't know that.

It has to match whatever is here:

You could call it foo_bar_connection if someone chose to setup an OPC connection with that name.

Our system started as a 7.7 gateway, and has carried the hyphen ever since.

4 Likes

Alright, everyone change it back to having a hyphen.
Just kidding, thanks for showing me.

Don't sweat it too much. In the dark mists of yesteryear, it was called 'IgnitionOPCUA'. :person_shrugging:

2 Likes

Tomorrow I will be figuring out how to format the data.

valuesIn 		= system.opc.readValues(server, pathList)

t_stamp		=system.date.now()
#for i in xrange(250):
print valuesIn[1].getValue()
	
valuesOut	=[]
for i, value in enumerate(valuesIn):
	valuesOut.append([ i, valuesIn[i].getValue()])

for i in xrange(250):
	print  valuesOut[i]

Got a list of lists of the enumerated number and the value.
Need to decide if I want to write to a tag or update rows in a db.

Should just need something like:

valuesOut = [[i,qv.value] for i,qv in enumerate(system.opc.readValues(server,pathList))]
1 Like