Creating a report to visualize a data array

Good Morning, I am very new to Ignition and was wondering about the ability to create a report based on a data array of real numbers that I would to print after each cycle of my machine. I have an array in my PLC that gets filled by a real number during the cycle of the machine. I have sensors that point my data to the correct position in the array. My array could look like the example below, but it’s much longer.

0.0 / 0.0 / 1.25 / 20.12 / 0.0 / 0.0 / 20.12 / 1.25
1.25 / 0.0 / 0.0 / 20.12 / 1.25 / 0.0 / 1.1 / 1.1
etc…

I have been through inductive university but I can’t really find an example there that gives me an idea of how I should be attacking this. Any help getting started is appreciated.

Brad

The first thing to do is get your data into a dataset. I guess you aren’t recording these samples? If not, you’ll need to script the generation of the dataset. Something like this (in a script module):

myArrayPattern = '[default]Path/To/Array/Tag/_%d_'

def datasetFromTagArray(size):
    tagPaths = [myArrayPattern % i for i in range(size)]
    values = [x.value for x in system.tag.readBlocking(tagPaths)]
    rows = [[v] for v in values]
    return system.dataset.toDataSet(['MyColumn'], rows)

Then you feed this dataset to a bar chart. If you want an XY chart, you’ll want to make two columns, x & y.

In either case, it’ll matter whether you are using Vision or Perspective.

{ BTW: you didn’t find an example because what you are doing is very unusual. Ignition, like any SCADA system, likes to record stuff, and then show the recordings. }

1 Like

Thank you for the reply, I would like to save this data, so I’m guessing I should start there. Ideally I would like to feed the data into a table rather than a chart that would be 10 columns wide by up to 20 rows. At some point I need to get that data from the chart saved to a .doc/.xls, at this point I would even be fine with creating a table and having my array values written into cells one by one. I have little experience with structured text other than a couple of twincat systems I have modified, so I’m obviously struggling with getting started with Ignition, but it seems like there is quite a lot I could accomplish with it.

If you want to record 10 values together, you should be looking at the SQL Bridge module’s transaction groups. You probably want to record the cycle number in addition to the timestamps in order to distinguish one cycle from the next.

Saving a dataset to excel is well-supported, assuming you are using the latest version.