Need help storing and manipulating data set

Hello,
Ignition beginner here, working on a machine control Edge HMI project for a building component saw.

Here's what I am trying to accomplish:

  1. Import data to Ignition from a text file on the hard drive. This data contains machine setup information for jobs. The text file has no line breaks, no separators of any kind. It has to be parsed out into rows (row = setup info for one part), and each row gets split into about 29 individual tags (columns), mostly integers and a few strings. Typically there will be 10 to 30 rows.

  2. The operator needs to be able to essentially select a row, and use the data in that row to set up the machine. I think I basically need to indirectly reference the row data based on a row index, and copy that data to the machine operating variables.

  3. The data is each row contains dimensions and angles for a part to be cut. I want to to generate a basic 2D geometric shape based on these dimensions, as a visual for the operator.

  4. I want to be able to display a scrollable list of these visuals, so the operator can easily choose the part he needs.

What I need help with for now:

  1. What's the best way to store this "part setup data", in order to be able to easily reference it by row index and view/use it? The columns never change, but the number of rows will change depending on how many parts are in the setup file.

  2. I'm thinking that I need to make a template with a Paintable Canvas for my visual, and then use a template repeater to display a list of these visuals for all the parts (rows) extracted from my setup file. Does this sound reasonable?

What I've already figured out:
I've gotten the scripting done for loading a setup file via a file browser, load the file contents into a String tag in Ignition, split it into rows, and extract the columns for each row.

Hopefully this makes some sense!

Here is a snippet of a sample setup file that I'll be loading into Ignition.

Here's roughly what I want my part visualization's to look like. The numbers shown here for the angles and lengths come from the rows in the part setup files, and will be used to generate the shape via Paintable Canvas, hopefully.

A dataset is by far the best option for this. As long as the number of rows is not going to get very large and you're not going to be storing any non-native types, then this can be "saved" as a Dataset tag. Of course that largely depends on if the data needs to be persistent.

For parsing that information into a dataset it sounds like you've already got some code that extracts the column information for you, so you're most of the way there. Check out the DatasetBuilder class.

I believe this is the correct path. It was what came to my mind when reading through what you are trying to accomplish.

2 Likes

Sorry, I'm not sure I follow. I do want the data to be persistent. If I load it into a dataset memory tag, it would be persistent, right? Or does that depend on the size of my dataset?

If the data needs to be persistent, then for small amounts of data a memory tag is fine. That data is stored in the internal DB and so if it grows to large it can bog down your system.

If the dataset is going to get very large, then a Database is a better option, of course with Edge it gets tricky as far as what can and can't be done.

Yes, but the allowance is large. In a fairly recent version, the limit is 256MB.

(It used to be much smaller, and big datasets would break.)

It's not tricky. Edge's license simply forbids the use of a database.