Red Lion Crimson Question.

Shiro485

Member
Join Date
Apr 2013
Location
North Haven CT
Posts
103
Hello all,

I am trying to put tag data values within a data box

for instance I have a data box already tagged with an indication tag, depending on the state of that tag it may have other data within the description

Like say n17:3 has a value of 2
The data box would read
Calibration process is performing
Run time remaining = xx <- This part in the description would need to reference another tags data value.

Is this possible within crimson? Its relatively easy with Rockwells Factorytalk.

Thank you very much in advance for your help.

Brian
 
Crimson is very powerful and you can do a lot of programming stuff that is not possible with other HMI softwares.
In particular, what you want to do is easy to implement.
 
The PanelBuilder multi-state indicator with embedded text variables is one of the objects that doesn't have a direct equivalent in Crimson.

One way to do it is with Complex Code and in-line embedding of variables.

For example, make a Data Box, select Complex for the data type, and put something like this in the complex code box:

if (MS_State == 0) return "My Embedded Value is " + AsText(MS_Embedded_Value[0]);
if (MS_State == 1) return "My Embedded Value is " + AsText(MS_Embedded_Value[1]);
if (MS_State == 2) return "My Embedded Value is " + AsText(MS_Embedded_Value[2]);

if (MS_State > 2) return "Error_State";

This requires you to create a tag for the State, just like you would for a Multi-State Indicator, as well as have tags for the values that will be embedded into that string. In my case, I used an array-type Numeric Tag.

There are several different ways to do this kind of thing, including the Two State and Multi-State data format selections for a Numeric tag.

I learned the in-line AsText part from Jeff Kiper.

One down-side of using Complex Code is that Crimson's expression language is similar to Java or Python, but not exactly the same, so you can get confused. In the above example I originally used "=", an assignment operator, rather than "==" an equals operator, and wondered why I couldn't change the value of MS_State from a numeric entry.
 
Last edited:
The PanelBuilder multi-state indicator with embedded text variables is one of the objects that doesn't have a direct equivalent in Crimson.

One way to do it is with Complex Code and in-line embedding of variables.

For example, make a Data Box, select Complex for the data type, and put something like this in the complex code box:



This requires you to create a tag for the State, just like you would for a Multi-State Indicator, as well as have tags for the values that will be embedded into that string. In my case, I used an array-type Numeric Tag.

There are several different ways to do this kind of thing, including the Two State and Multi-State data format selections for a Numeric tag.

I learned the in-line AsText part from Jeff Kiper.

One down-side of using Complex Code is that Crimson's expression language is similar to Java or Python, but not exactly the same, so you can get confused. In the above example I originally used "=", an assignment operator, rather than "==" an equals operator, and wondered why I couldn't change the value of MS_State from a numeric entry.

An even easier method is to put the same info in the Multi-state Text values.


Value 0 Text Column would contain the following... ="Invalid Value"
Value 1 Text Column would contain the following... ="My Embedded Value is " + AsText(TagContainingAppropriateValue1)
Value 2 Text Column would contain the following... ="My Embedded Value is " + AsText(TagContainingAppropriateValue2)


And so forth for as many Multi-states as there are.
 
Last edited:

Similar Topics

How do you install update on Red Lion Crimson ver 3.1. Do I just need to run the exe file on the host server?
Replies
1
Views
103
Hi, I am trying to increase the size of the user login pop up using a Red Lion CR1000 7” HMI with Crimson 3.1 software. The login pop up is very...
Replies
2
Views
665
Hello, We are currently running a bunch of g310's connected to their SLC5 PLCs through ethernet. I've attempted to upgrade the program from 2.0...
Replies
1
Views
1,111
Hi I have been using Red Lion products for some time, I had a thought over the bank holiday weekend, As you do. It would be nice if whenever a...
Replies
4
Views
1,012
Well, I have yet another question for the great minds on this forum! We have a red lion HMI for one of our machines and every time I hook my...
Replies
11
Views
1,660
Back
Top Bottom