Flag tag button in Crimson 3

kolyur

Lifetime Supporting Member + Moderator
Join Date
Oct 2004
Location
Wooster, Ohio
Posts
1,602
I'm trying to figure out how to create what was previously called a "Flag Tag Button" in Crimson 2. Basically it's a beveled button tied to a flag tag. Hitting the button would toggle the bit. The text AND color of the button (in both on and off states) is defined by the tag format. All I can find in Crimson 3 are the "Bevel Button" and "Data Box" primitives, but I can't get either one of them to work like the good ol' flag tag button. Certainly this can be done with a single primitive... what am I missing?
 
I'm trying to figure out how to create what was previously called a "Flag Tag Button" in Crimson 2. Basically it's a beveled button tied to a flag tag. Hitting the button would toggle the bit. The text AND color of the button (in both on and off states) is defined by the tag format. All I can find in Crimson 3 are the "Bevel Button" and "Data Box" primitives, but I can't get either one of them to work like the good ol' flag tag button. Certainly this can be done with a single primitive... what am I missing?

I don't have time to give you all the details, but will point you in the right direction.

Assume Flag Tag name is myTag

Create a standard Bevel Button.

For the Button Text put =AsText(myTag)

Use myTag.Fore for the text color and myTag.Back for the button color on the figure tab.

The action can be set to toggle the flag tag.

There are other ways of doing this, but this is pretty straight forward.
 
For the Button Text put =AsText(myTag)
This is the detail I was missing. The Bevel Button in C3 seemed more like the old "General Button," with no obvious place to assign a tag. I managed to get what I wanted by putting a Data Box on top of a Bevel Button, but I knew there had to be a better way.

Thanks for the tip.
 
For the Button Text put =AsText(myTag)
When testing this in the emulator I found that this expression puts a 0 or 1 on the button face. I want the button to read OFF or ON, as specified in the data format of the tag. Can this be accomplished with a single object?
 
John,
I just went through this "exercise". I found that if I use GetFormattedTag(FindTagIndex(0)) in the expression worked too. I am guessing as my project only have one tag that is why 0 worked.

What would you use this type of button for? I haven't run across the need to toggle a flag tag yet so I was just wondering where to use it.
 
When testing this in the emulator I found that this expression puts a 0 or 1 on the button face. I want the button to read OFF or ON, as specified in the data format of the tag. Can this be accomplished with a single object?

My mistake.

Use myTag.AsText rather than AsText(myTag).

That should work also and is a little more straight forward than the GetFormattedText() function. I have always preferred the ".AsText" Property over the AsText() function, but folks on this site seem to prefer AsText().

Obviously, there are situations where one works and the other doesn't.
 
What would you use this type of button for? I haven't run across the need to toggle a flag tag yet so I was just wondering where to use it.
I use this type of object all the time, basically for anything that needs to be turned on or off by the operator. Typically in the off state I use colored text on a black background, and vice versa for the on state. I find that this creates a nice contrast between states for quicker recognition by the operator.

Personally I don't like using objects that simply replicate the look of a physical device on the screen (i.e. toggle/selector switches, indicator lamps, 7-segment displays, etc). I don't know why so many HMI makers are obsessed with providing this capability--C3 included--it seems like a step backwards to me.

flagtagbutton.png
 
Kinda confused here. Why not take a primitive and just add data and action. This will allow it to be a push button under action (toggle if you want) and then just use the data tab to add your tag. The tag format for the color and text. A "flag" tag is just a bit so it already defined as "On OFF".
 
Kinda confused here. Why not take a primitive and just add data and action. This will allow it to be a push button under action (toggle if you want) and then just use the data tab to add your tag. The tag format for the color and text. A "flag" tag is just a bit so it already defined as "On OFF".

The only reason to do this is if you happen to want a pushbutton that will look like it is pressed when you touch it. Otherwise, your method is just as good (or better).

I was only answering questions, not recommending that they do it.
 
The only reason to do this is if you happen to want a pushbutton that will look like it is pressed when you touch it. Otherwise, your method is just as good (or better).

I was only answering questions, not recommending that they do it.

Ahhh OK. You can make the button looked "pushed" by setting your format on the primitive to two state and use the Flag tag as the data source. I have attached an example. It uses the raised Panel Raised primitive. I have attached an example
 
Ahhh OK. You can make the button looked "pushed" by setting your format on the primitive to two state and use the Flag tag as the data source. I have attached an example. It uses the raised Panel Raised primitive. I have attached an example

Yea, I do a "Radio Button" function with an array of Raised Panels also. This keeps the "button" pressed to indicate which one is active.

Crimson 3.0 is extremely powerful if you take the time to learn to use *all* the functionality.

I typically only use the Button Primitive when I want to change pages or show popups. The only exception is an occasional use as an alarm silence or something similar. However, if I want a button that acts like a button (graphically), meaning that it looks pressed while your finger is on it, then the Button Primitive is the best way I have found.

By the way, have you tried the IsPressed system Variable with a button, raised panel or an Image? It is useful for changing colors (and other things) too. You may have used it in your example, I haven't looked at it, but you can use a 2-State for the Edge Format and have the Control for the Color Animation be IsPressed.
 
Ahhh OK. You can make the button looked "pushed" by setting your format on the primitive to two state and use the Flag tag as the data source. I have attached an example. It uses the raised Panel Raised primitive. I have attached an example
Thanks, this is exactly what I need. I had looked at the Panel primitive earlier but didn't realize that I had to do Add Text or Add Data to get the associated tabs to show up in the properties. I guess I'm trying too hard to get C3 to work like C2. (y)
 
Yea, I do a "Radio Button" function with an array of Raised Panels also. This keeps the "button" pressed to indicate which one is active.

Crimson 3.0 is extremely powerful if you take the time to learn to use *all* the functionality.

I typically only use the Button Primitive when I want to change pages or show popups. The only exception is an occasional use as an alarm silence or something similar. However, if I want a button that acts like a button (graphically), meaning that it looks pressed while your finger is on it, then the Button Primitive is the best way I have found.

By the way, have you tried the IsPressed system Variable with a button, raised panel or an Image? It is useful for changing colors (and other things) too. You may have used it in your example, I haven't looked at it, but you can use a 2-State for the Edge Format and have the Control for the Color Animation be IsPressed.

Never tried the IsPressed system Variable. I just used the format tab and put 2 color for my pushbutton tag.
 

Similar Topics

Hi, I'm having an issue in crimson 3.0 when I create a programme using a case statement referencing a fault word that each bit needs to change the...
Replies
4
Views
191
I have a device that is communicating to ControlLogix L83E. During apply of online edits to plc, the communication to the device is increasing 4-7...
Replies
3
Views
1,180
Hi, Is there a way to get an alarm ack/active flag in Vijeo Designer to store in a internal var? I found under action there are alarms action you...
Replies
1
Views
1,461
I think in a past life that I ran across a ladder logic developer program that allowed me to put a flag on a rung so I could quickly jump back and...
Replies
12
Views
2,667
i tried to use S:V bit today but keep getting the error. Math status flag not assigned within the rung. i am using studio5000
Replies
4
Views
2,629
Back
Top Bottom