# Displaying Recorded Tag Values Into Tables With Scripting

**URL:** <https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570>\
**Category:** Ignition\
**Tags:** vision, scripting\
**Created:** [June 5, 2023, 2:10pm UTC](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570 "2023-06-05T14:10:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joshua\_Myers](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@Joshua\_Myers](https://forum.inductiveautomation.com/u/Joshua_Myers)\
**Post date:** [June 5, 2023, 2:10pm UTC](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570/1 "2023-06-05T14:10:13Z")

</div>

Good morning everyone! Ignition newbie here. I am trying to create a testing program in Vision and could use some help. The basic rundown of what I'm trying to do is as follows:

I would like the operator to be able to run through a site cause & effect check by only having to press one button.

For this example, we will use 5 devices. I want there to be a table where the operator can click check boxes for which devices are present on the left hand side, then at the top of the table, I want the same check box enable function for the effects. I want the operator to then be able to press the button and have Ignition start with Device 1 and write a value above the setpoint to that device. I then want to record the states of the boolean tags that are enabled at the top of the table and record their current values to that same table (or to a report would be fine.) I then want Ignition to move on to the next device and do the same thing, repeating until all devices are finished.

All tags are crated and I already have buttons that can write values to large numbers of tags and do a reset for the site using indirect tagging with a text field.

The main issue I am struggling with is making a script that can be configured to run sequentially for only the devices that are present and then recording the state of the corresponding tags and freezing that row of data, allowing me to reset and see their states after changing the second device while still maintaining the original data.

I want this to be as simple as possible and able to be deployed in the field on a closed network, so SQL queries are not an option.

Any help would be appreciated. Thank you!

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [June 5, 2023, 3:04pm UTC](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570/2 "2023-06-05T15:04:49Z")

</div>

Welcome to the Forum!

What have you tried and what didn't work?

You will want to run this on a background thread, there are several posts around the forum on properly utilizing [system.util.invokeAsynchronous()](https://docs.inductiveautomation.com/display/DOC81/system.util.invokeAsynchronous) and [system.util.invokeLater()](https://docs.inductiveautomation.com/display/DOC81/system.util.invokeLater)

You can use [system.device.listDevices()](https://docs.inductiveautomation.com/display/DOC81/system.device.listDevices) to get a dataset of the configured devices and loop through that to run your checks.

---

<div class="post-metadata">

**Author:** ![Joshua\_Myers](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@Joshua\_Myers](https://forum.inductiveautomation.com/u/Joshua_Myers)\
**Post date:** [June 5, 2023, 3:19pm UTC](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570/3 "2023-06-05T15:19:19Z")

</div>

Thanks for the reply. I will look at those functions for sure.

To be honest, I haven't been sure what to try. I am still working my through Inductive University but have also been assigned this task in the meantime.

I had originally created a table with the Bool tag values I wanted represented in the table and that plus my scripted button that writes values to the tags works fine. The problem is the entire column of Bool values is the same and they will all change instead of recording the values then moving to the next row.

I've been playing with Historian and Reporting but haven't made it to Reporting in IU yet so I'm not completely sure what all I am able to do. I am also a novice with Python syntax so I'm trying to pick up as much as I can as fast as I can.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [June 5, 2023, 3:22pm UTC](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570/4 "2023-06-05T15:22:13Z")

</div>

> [@Joshua\_Myers](#):
>
> The problem is the entire column of Bool values is the same and they will all change instead of recording the values then moving to the next row

I'm not sure I understand exactly what your issue is. Can you elaborate on this, maybe provide some example data or screen shots of what you're looking for?

---

<div class="post-metadata">

**Author:** ![Joshua\_Myers](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@Joshua\_Myers](https://forum.inductiveautomation.com/u/Joshua_Myers)\
**Post date:** [June 5, 2023, 3:35pm UTC](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570/5 "2023-06-05T15:35:29Z")

</div>

Sure, to clarify a bit,

I am trying to create a table like this in my runtime. The table will have checkboxes above each column and to the left of each row.

An operator will be able to check off which devices in which rows and columns are present.

Once the boxes have been checked for which devices are on site, he will then press a button in the runtime. That button will execute a script that will write a process value to the correct tag for the device in the first row. When that process values goes above its setpoint, the logic in the PLC will change the values of all the Boolean tags that are represented in the columns.

I want to change the values in the intersecting cells (where the x's are currently) for only the row of the device currently being tested. Then once all the values have changed, I want to record those values and save them as they are. Then the script will reset the site and proceed with the same process for the device in the next row - driving the process value above the set point and recording the Boolean values for each column that intersect with that specific row, leaving the rows above and below it alone.

I would like this to take place for every row and every column that had been previously checked by the operator.

The parts I am having issues with is having the script see which rows and columns would have that Boolean value from the check box and then having only the values in a specific row change.

Take column XY\_0001 for example. Each cell under that column is represented by the same tag value so currently the value will be the same in each column. I want the values to be saved as the results of the test for its own column instead of the realtime value.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/9/79be896140fc2a3b78610e430884566354013aad.png)

---

<div class="post-metadata">

**Author:** ![Joshua\_Myers](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@Joshua\_Myers](https://forum.inductiveautomation.com/u/Joshua_Myers)\
**Post date:** [June 5, 2023, 3:40pm UTC](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570/6 "2023-06-05T15:40:53Z")

</div>

1. Operator checks off columns and rows that are to be part of the script.
2. Operator presses button.
3. Button executes script.  
A. If HS\_0001 row has been checked, script will write value to the tag, driving it above its set point  
B. Once the value is above the set point, the values of the boolean tags of the columns will change.  
C. If the value is a 1, it will check the cell, if it is zero, it will uncheck it.  
D. Once the values change, the script will move onto the next row if it has been checkd off until the  
script has run for all rows with a TRUE value in the cell before it and for all columns with a TRUE  
value in the cells above them.

I have the scripting down for writing values to the tags that I need. The issue is currently that I can only figure out how to assign the realtime tag values to each cell vs. having it save the values at that specific point in time in the script to the cell in that specific row before doing it again for the next iteration of the script in the next row.

If the logic calls for the value of XY\_0001 to be TRUE for the row for HS\_0001.Shutdown but FALSE for HS\_0002.Shutdown I wanted it to be represented like that its respective cell.

I'm sorry, I'm doing my best to be as clear as possible about what I'm trying to accomplish.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [June 5, 2023, 4:07pm UTC](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570/7 "2023-06-05T16:07:14Z")

</div>

> [@Joshua\_Myers](#):
>
> Each cell under that column is represented by the same tag value

I'm a bit confused by that.  
How are you filling this table ?

---

<div class="post-metadata">

**Author:** ![Joshua\_Myers](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@Joshua\_Myers](https://forum.inductiveautomation.com/u/Joshua_Myers)\
**Post date:** [June 5, 2023, 5:21pm UTC](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570/8 "2023-06-05T17:21:11Z")

</div>

The table that I screenshotted is just one I created in Excel.

I have an existing Cause and Effect document that is where the data will ultimately come from.

Currently, I would fill the rows and columns manually to match the existing excel spreadsheet and assign each cell to the correct tag, but this results in each column under the right side having the same tag value which just changes to match the tag value instead of matching the tag value that existed during the portion of the test that corresponds to its row.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [June 5, 2023, 6:02pm UTC](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570/9 "2023-06-05T18:02:35Z")

</div>

I'm sorry, the whole thing confuses me way too much.

So, let's try turning the verbosity level down just a little bit:

- you have a table, where each cell is bound to a tag (ultimately, for now you're just putting in values by hand)
- operators can select rows and columns
- columns are devices and rows are statuses/events/something else entirely ?
- clicking a button starts the execution of a script that runs tests on selected devices, for each selected row
- the results of the tests are put in the cells at the proper row/column intersection

Is this about right so far ?

---

<div class="post-metadata">

**Author:** ![Joshua\_Myers](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@Joshua\_Myers](https://forum.inductiveautomation.com/u/Joshua_Myers)\
**Post date:** [June 5, 2023, 6:06pm UTC](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570/10 "2023-06-05T18:06:38Z")

</div>

Yes that is essentially what I am after.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [June 5, 2023, 6:49pm UTC](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570/11 "2023-06-05T18:49:20Z")

</div>

How will you know which device tag is represented by the row, column combination? Is there some repeatable naming convention?

---

<div class="post-metadata">

**Author:** ![Joshua\_Myers](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@Joshua\_Myers](https://forum.inductiveautomation.com/u/Joshua_Myers)\
**Post date:** [June 5, 2023, 6:59pm UTC](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570/12 "2023-06-05T18:59:20Z")

</div>

There are pre-existing tags that have their own names and naming convention already. The row will list out the specific device and tag that is being tested in its own column on the left. I.e. HS\_0001.Shutown

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [June 5, 2023, 7:01pm UTC](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570/13 "2023-06-05T19:01:32Z")

</div>

So just to be sure were on the same page one column will be the **Ignition** Tag Name?

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [June 5, 2023, 8:12pm UTC](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570/14 "2023-06-05T20:12:39Z")

</div>

Then can you try to clarify what that means ?

> [@Joshua\_Myers](#):
>
> this results in each column under the right side having the same tag value which just changes to match the tag value instead of matching the tag value that existed during the portion of the test that corresponds to its row.

I fail to see how one operation could affect several cells.

---

<div class="post-metadata">

**Author:** ![Joshua\_Myers](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@Joshua\_Myers](https://forum.inductiveautomation.com/u/Joshua_Myers)\
**Post date:** [June 6, 2023, 12:56pm UTC](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570/15 "2023-06-06T12:56:09Z")

</div>

So if you reference the screenshot I posted towards the top, the 2nd label - XY\_0001 represents a tag that is a permissive. Every cell underneath XY\_0001 is the same permissive tag.

When the tags in the rows on the left trip, i.e. HS\_0001.Shutdown, it will either leave that permissive in a TRUE state or a FALSE state depending on the logic.

Each separate tag on the left could have a different effect for XY\_0001.

HS\_0001.Shutdown could leave it TRUE while HS\_0002.Shutdown leaves it false. In this case, during the test, the intersecting columns would be reading the same tag for XY\_0001 but in each case the result will be different and I need to show the individual results of the test rather than the live value of the tag.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 6, 2023, 12:59pm UTC](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570/16 "2023-06-06T12:59:20Z")

</div>

Basically, you want snapshot the tags into rows of a dataset? And display it in a table? And then do what with it?

---

<div class="post-metadata">

**Author:** ![Joshua\_Myers](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@Joshua\_Myers](https://forum.inductiveautomation.com/u/Joshua_Myers)\
**Post date:** [June 6, 2023, 1:04pm UTC](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570/17 "2023-06-06T13:04:58Z")

</div>

That's it. I just want to run the script which will test the different shutdowns and alarms, snapshot the data into their corresponding cells, then display the table on the screen for the operator to visually check against their reference spreadsheet

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [June 6, 2023, 1:15pm UTC](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570/18 "2023-06-06T13:15:30Z")

</div>

Don't bind the tags to the cells then. Just write their values once they have been evaluated.

---

<div class="post-metadata">

**Author:** ![Joshua\_Myers](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@Joshua\_Myers](https://forum.inductiveautomation.com/u/Joshua_Myers)\
**Post date:** [June 6, 2023, 2:22pm UTC](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570/19 "2023-06-06T14:22:55Z")

</div>

Is that possible with a regular table or would that have to go into a report?

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [June 6, 2023, 2:29pm UTC](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570/20 "2023-06-06T14:29:29Z")

</div>

The table holds a dataset, you're just going to build the dataset. The table will then display it.

[Next page](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570.md?page=2)
