Can anyone point me to the best Ignition equivalent to the Local Message Display object that is available in FTView Studio?
I’m looking to have a step number integer in the PLC and have a string display in HMI which reads the integer and then displays a description of the step as the sequencer advances.
The Multi-state indicator pretty much does what I’m looking for, but I had some questions about it’s capabilities and maybe someone can recommend a different/better object to do what I’m looking for.
Firstly, using the Styles of the Multi-State, I cut it down to just 2 columns, State and Text which is pretty much all I need. Is there a way to save/export/templatize a style…ie can I have a global style with this integer to string mapping and refer to it on multiple displays? For saving the values, I can see the copy/paste from clipboard feature, which lets me copy it into a text file…is there a way to export/import these in a native format or store them to a library?
Second question is whether there is any way to make the text in the style dynamic, ie reference a tag value. So my message could be something like “Step 5 - Timer expires in " & tagvalue & " seconds”. In FTView, the messages object lets you put in a tag reference directly into the string using a browse.
[quote=“GKrueger”]Can anyone point me to the best Ignition equivalent to the Local Message Display object that is available in FTView Studio?[/quote]For a state => text conversion to be commonly used, I set up a two-column database table with the values, then load it (once) in to a client dataset tag. Then anywhere I need it, the lookup() expression function can retrieve the text. Bound to a simple label, as often as not.[quote=“GKrueger”]Second question is whether there is any way to make the text in the style dynamic, ie reference a tag value. So my message could be something like “Step 5 - Timer expires in " & tagvalue & " seconds”. In FTView, the messages object lets you put in a tag reference directly into the string using a browse.[/quote]This is a good bit harder. I would put python string expressions in the table, and pass the lookup to the runScript() expression function. With a poll rate so the variables in your python will get re-executed at a reasonable pace. Bit of a hack, though.
[quote=“JordanCClark”]Now, with, dataset types for SQLTags, you could also store it in a db table. [/quote]Why just now with v7.8? Client dataset tags have always been bindable to SQL queries.
This topic sent me down a rabbit hole hunting for a minimalist way to include tag values in python one-liners, suitable for use with the runScript() function or my objectScript() function.
I thought “could I use python’s getattr() special method for this?” And lo, the heavens were opened and the sea withdrew:
# Read the tag '[default]MyFolder/MyTag' as a python object:
print shared.tag.default.MyFolder.MyTag.value
# And write to it, too:
shared.tag.default.MyFolder.MyTag.value = 123
# Along with the engineeering units, documentation string, opc path,
# and all its other properties, too:
print shared.tag.default.MyFolder.MyTag.engunit
The magic is in the attachment
There’s a minor dependency on the mungeColumnName() function from the Simulation Aids module, but that could be reworked if you need to.
While playing with this, I noticed that client tags, that normally only display Value, Name, and tooltip in the tag browser, will accept writes to some other properties (like engunit), and remember them through project save/close/open cycles. I didn’t test this exhaustively, but it is a really dirty solution to one of my Ignition wishlist items. tag.py (7.2 KB)
Thanks for the info…I just got around to testing the Dataset -> Lookup function and that does the trick for the basic int to string conversion. I’ll post again when I have a chance to try the more advanced embedded tag value approach, but for now the int to string gets me what I need.
Ah, well. I haven’t used this in a while, and 7.9 probably changed something it needs. That’s always a risk when delving into unsupported interfaces. /-:
If you figure it out before I have a chance to look at it, let us all know.