Need advise on adding tags to Ignition

Hi everyone,

I am new to Ignition so I apologize if answer to my question is obvious...

So I am trying to add a list of 50 "accounts" with non-sequential numerical numbers. Each "account" should have 6 Boolean tags. Like in "invoice received for this month" yes/no.

I currently have this data in excel/CSV file formatted like:
"Account number", "Invoice for this month 1/0", "Invoice for last month 1/0", "Invoice for this month minus two 1/0", etc.
Basically first column for the "account" # and then six columns with 1 or 0.

What is the best way to do it? Manually eneter 50 folders with tags? Create a UDT? Create one, export JSON file, edit it, import back? Some other way to do it?

Thank you for all responses.

Are you required to have each account as a separate folder? Will you ever add or remove accounts?

Also, to make sure I and others understand correctly: Is this a one time occurrence or will you be doing this once every month (or some other time period)? Are you trying to use this CSV to pull data into Ignition?

This honestly sounds like something you could condense into a single dataset tag, with the columns of your CSV lining up with the columns of the dataset.

If you are dead set on using folders for each account, use system.tag.configure to build out the folders and tags via scripting.

For getting the data from the csv into these tags, you can write a script to parse the CSV and build the tag paths to use with system.tag.writeBlocking to write the data to the tags in the folders.

You can go so far as to make sure the CSV will always be in a folder that Ignition can reach and write a scheduled gateway script to parse the CSV in that folder at a specific time each month to grab the new data.

Sounds like a good job for SQL vs tags.

3 Likes
  1. No, it does not have to be a folder for each account. But I need each account to have 6 boolean values connected to it. Add/Remove accounts - yes, but rarely.
  2. Ideally I would do this every month. Yes, I am trying to use CSV to pull data into ignition from a different system. I can either download excel/csv report from there or access it via API.

Can you tell me more or direct me to a resource to learn more about this?

If I understand this correctly, than it's the ultimate goal. I hope to create a script to populate the CSV periodically and then create a script within Ignition to pull data from that CSV.

That's the manual page on the function to create a new dataset.

Just to confirm, is this an actual CSV file or is it an excel file (.xls or .xlsx) with the data formatted in the same way as a CSV?

You can do a search for CSV to dataset here on the forums and get some decent information.

https://forum.inductiveautomation.com/search?q=csv%20to%20dataset

This post looks like it has a basic script for converting csv to dataset:

That class is expecting the result from a file upload component, you would need to modify it to accept the output of system.file.readFileAsString

What is the source of this CSV? Is it being exported from some other program? If so it may be worth seeing if you can get this program to dump this data into a database table. That would make things simpler as you could use a query tag to hold the information and eliminate the script on Ignition's side.

I also understand that you may be limited to only CSV files. My company has several CSV files that we use Ignition to parse and chuck into a DB table on a weekly or daily basis.

Ryan, Thank you for so much info. I am reading through it right now. I really appreciate your help.

Currently it is an Excel file report with weird formatting (a lot of merged and hidden cells for better looks) that I cleaned up to leave only needed columns (account identifier and 1/0 for six months). I am planning to pull the same data via API and save as CSV. The data is pulled from the cloud-based software we use for Utility Billing tracking. I don't think Ignition can pull date over API (at least it was not covered in the class).

as I said, currently it's a built-in report in a different software. But I hope to start pulling it via API eventually, so I might be able to dump it in a database table, but it is much further down the road.

I guess, my goal is to do something similar.

Yes, it can. Start here: system.net.httpClient()

1 Like