Signed Integers and Table Row Colours

Hi all,

Just trying to get a little support on a project I’m working on. The first issue I have is with an Integer I am reading from a CompactLogix PLC.

I’ve got the project reading lots of tags and a lot of those tags are Integers that show negative values. But I have one group of tags that won’t show up as signed. On the current Citect system the tag is setup as an INT with scaling of 0-1000 raw to 0-100 actual. The running project shows the tag as having a value of “-28%”. Yet no matter what option I use for the tag in Ignition, it will always show it was 65,000 or something (basically an unsigned integer). Does anyone have any suggestions as to why Ignition would not show it as signed or how to force it to show signed?

The second question I have is with rows. Is there a way to make a whole row background change colour depending on a value in a column? E.g. I’m pulling a device index number from a database, and whenever a specific index number shows in a row, I want the whole row to change colour.

Thanks, Marc.

You’ll have to give a better explanation of how the tag is configured as well as the component you are using to show the value.

If you use the power table component, open the scripting and there is a “configureCell” extension function, it provides an example of alternating row colors depending on if the row is odd or even. You would need to modify this to read the index and evaluate if the value requires a different row color or not.

From the manual, bottom of the page

# Code for the configureCell Extension Function on a Power Table
# Set the background color of a row to red if the "Overdue" column is true in that row.
data =
if data.getValueAt(rowIndex,"Overdue") == 1:
    return {'background':'red'}
    return {'background':'white'}

Thank you for the reply. I forgot to mention it’s running Ignition 7.8.3 using the Allen-Bradley Logix Driver.

The component the tag is applied to doesn’t matter. When you view the tag in the tag browser and look at the .value of the tag it shows the issue. I have the tags setup as a floats so I can get a decimal point (they’re both scaled 0-1000 raw to 0-100 eng).

This is the setup of a tag I’m using in ignition that shows a negative value.

This is the one that doesn’t show negative values (no matter what configuration I put here).

The one that doesn’t work shows as a signed INT in Citect.

What is the data type of the tag in the PLC program?

Hi Kevin,

It’s a DINT (I just accessed the program). It did seem that they were INT’s at some point but someone made the array into DINTs.

I tried changing the Source Data Type to Long, Double etc. As well as adding negative values into the scaling.

There has to be something simple I’m missing.