Hello,
I am new to ignition programming, and I am trying to create analog tags that have the format xxxx.yy, where yy are two decimal digits that must be separated by a dot.
In most formats, I see that ignition uses the "comma" as a decimal separator, the idea would be to even store it in the history with the decimal separator dot.
thank you.
Yeah, don't do that. The dot is used in Ignition tag references as the separator between a tag's name and the properties of the tag. You simply cannot use a dot in a tag name. There are a variety of reasons why you should not use tag names that contain any punctuation, or spaces, or other special characters. Even though Ignition might let you in some cases, there be dragons laying in wait for such.
Stick to tag names that fit all programming languages as variable names: start with a letter or underscore, all following characters being digits, letters, or underscores.
Sorry for my bad explanation @pturmel, actually I'm not referring to the name, I'm referring to the stored value, for example 327.7 instead of 327.7
Thanks
Oh. Okay. You just need to set the format string for the tag appropriately. The default ends in 0.##
, which allows two decimal places, but cuts trailing zeros. If you use 0.00
those trailing zeros are always shown.
See the documentation for tag properties here:
https://docs.inductiveautomation.com/display/DOC81/Tag+Properties#TagProperties-StandardTagPropertiesTable
Format string is a the bottom of the list of numeric properties.
Just in case it's not clear already, don't do that. You'll be storing numbers as strings and that will cause problems with indexing, maths, and further number formatting. Always store them as native data types and format them at the point of display.
I don't know where you're seeing that. The default would be a '.' for decimal separator and ',' for thousands separator but should be modified by chosen locale. This is a problem on some components for European users where the standard is the opposite when the component doesn't sense the chosen locale correctly. I suspect that this is more of a problem with Perspective.
1 Like
The problem is that I don't see how to change this format that shows me ignition for the TAG value and place a period as the decimal separator. If you look at the example, the decimal separator is the comma.
actual value 327,77 (comma)
required value 327.7 (dot)
thanks
It's not clear what the problem is.
- OS?
- OS locale?
- Tag data type? (I'm just checking that it's not a string.)
- Data source?
Can you show a screen grab from the tag browser and the tag configuration? Crop it nicely!
OS: Windows server 2019
Tag data type: Float
Data Source: OPC

Only the first value shows the formatting problem but it's the only one with scaling applied, as far as I can see.
I also note that this is a Modbus OPC tag so I'd double check that your register format is correct. Modbus Addressing - Ignition User Manual 8.1 - Ignition Documentation
- Why have you got float tags in a folder called STRINGS?
- Is the STR in the tag names indicating string data type as well? (It shouldn't!)
- What is the actual value in the PLC for the first and second tags?
@transistor, Strings refers to a solar panel term, not to it being of the string data type. The first two values in the PLC are of type integer and are:
INV_STR1_AMP: 38445 (scaled value as shown in the figure, the idea for this value is to display 384.45 with the point as the decimal separator)
INV_STR2_AMP: 38457 (unscaled value)
Thanks
additional to show in the HMI the idea is to store in the database as 384.45 (dot) but the TAG shows 384.45 (comma)
I suspect that the problem is that you've defined the tag as a float which is expecting four bytes but only receiving two as it's a Holding Registers with 16 bit unsigned integer conversion.
I'm checking what's the right way to do this ...
To me this looks like a localization problem and that scaling is working as expected. I would check the OS localization for how number formatting is handled.
1 Like
Actual values do not have commas. They're not stored with commas or dots or any other separators. They don't have a format at all. They're just bits.
The separator only appears when the value is displayed, according to formatting rules set by whatever displays the value.
It is REALLY important to understand that what you see is not what is stored - and that's not only an ignition thing, it's true for everything in computing.
It's an usual source of confusion, particularly with dates.
2 Likes