Displaying Recorded Tag Values Into Tables With Scripting

So, I'd do something like this.

  1. selection of devices/tests
  2. button click to run script using the selected devices/tests:
devices = event.source.parent.getComponent('Device_selection_component').data
tests = event.source.parent.getComponent('Test_selection_component').data

results = [
	[
		run_test(dev, test) for test in tests
	] for dev in devices
]


dataset = system.dataset.toPyDataSet(tests, results)
# add a column with the devices name if wanted:
dataset = system.dataset.addColumn(dataset, 0, devices, "devices", str)

event.source.parent.getComponent('Table').data = dataset

Note that this is pseudo-code in python/vision style.
This assumes your tests are executed with a function call run_test(device, test).
If you have several functions, you could use a mapping, or who a few other different solutions.

oops, supposed to be return True :slight_smile: and yes, removedSuccessful, while I've never actually used it, is there to be able to retry only those that failed. I actually don't know where i'd ever use it though

1 Like