Transaction Groups with Null Values

Hey all,

Is it possible to create a transaction group that will only record a changed value for the tag that changed and write nulls to everything else? Something like this:

code1 code2 code3
Null 81 Null
32 Null Null
Null Null 65

I have 26 inverters I’m trying to collect error codes from but everytime one error code changes it writes all of the values from every inverter into the row even if the error code did not change.

Well, I guess you could with quite a bit of work:

  1. Make all of your opc items read-only.
  2. For each opc item, make an expression item:
if(hasChanged({opcitem}),{opcitem},toInt(null))

The “toInt” is a bit of a hack to work around a type checking problem in the “if” statement right now. If you just put null, it will complain that the type isn’t right.
3) Have that expression target the column you want to write to.
4) For the trigger, you could use the async mode (select the expression items), but then you’ll get a secondary record with all nulls after the real row logs. So, you need a trigger expression item:

if(isNull({expression1}) && isNull({expression2})..., 0, 1)

So, if all items are null, return 0, else 1.
5) Trigger on that item being >0.

Note: all of those expression items are “run-always”.

Now, maybe a simpler thing to do:

  1. Create a block group, put all of your items into a single block item called “values”. Write to some column.
  2. Copy and paste the block item, and change the value property to “path”. Write to a different column.
  3. Set the group to insert changed rows.
    This will log changes into a table like ‘path, value’, with a row for each change.

Hope this helps,

The second way of doing it would work perfectly, but I can’t find a property named “path” anywhere in the group settings. There is a “Name” property but it seems to put the same values into the second column as the first “value” block group does. Am I missing a setting somewhere?

You’re right, I meant “Name”.

What version of Ignition are you using? There was a bug with that feature prior to 7.2.8, but I believe the fix made it in that release.

Are you using SQLTag references or OPC Items? I’m guessing SQLTags… since the bug only related to those. Is it possible to try with direct opc addresses?

Also, just to confirm that it’s set up correctly: When you change the value property to “name”, the item gets a new icon (a little “f(x)”) under the “properties” column in the table, right?

Regards,

I am using 7.2.8 and I am using SQL Tags. I do get the f(x) symbol in the properties column when I select “name” so I’ll try it with OPC tags and see if that takes care of it. If it does work I’ll let you know, thanks!

Beautiful, it does indeed work with OPC values. Thanks, Colby! I guess that bug wasn’t fixed in 7.2.8 :stuck_out_tongue:

Er, ok, I’ll have to make sure it’s really in for 7.2.9.

Regards,

Im doing this same thing but in reverse, i am reading a DB value to an OPC tag. The problem is that the DB uses NULL values, when the NULL values are written to an OPC tag it fails. How can I incorporate the expression but reading the DB column in a transaction group?

Thanks,
Drew

It has been a while - Drew, is this still an issue for you?