Crimson 3.0 Adding Subtract Function to Data Entry Box

laserweld

Member
Join Date
Oct 2014
Location
Cleveland, OH
Posts
23
Hi, I have a Red lion HMI using crimson 3.0. I have a data entry box which has a value entered by an operator. I would like to create another data box which an operator can input another value and it will subtract that value from the data box. For example if the data entry box is set to 2000, the value 2000 is displayed, I would like the operator to be able to select a button, and a different data entry box pops up. The operator can input a number in this data entry box (i.e. 100) and that number would be subtracted from 2000 and the new value in the data box which previously was 2000 will now be 1900. I am unsure how to achieve this. Any help would be great. Thanks
 
1. all widgets have a Show tab under properties with a field called Visible, you can put a bool variable in this to have another button control the visibility of other things
2. so make your initial button control a bool tag, then put this bool tag into the visible field of the 2nd data entry and 2nd button (need a button to do the subtract)
3. assign 2nd data entry to a tag, lets say tag2
4. in properties for the 2nd button (subtract button), go to the action tab, choose user-defined, and you can put something in like "tag1 -= tag2;"
 
It could be done without an extra button. You would need tags set up for each data box as Epy explained. In the Properties for the second data box, go to the Entry tab and look for the "On Entry Complete" action. Set this to "tag1 -= tag2" (which is the same as "tag1 := tag1-tag2" if that makes more sense). Now whenever the user enters a valid value and hits enter, the subtraction will be performed.
 
That makes alot more sense then the way I was thinking. Is it possible to use a primitive such as a "bevel button" to act as a data box. For example can I just use the button primitive and have this create a numerical entry pop up and then on enter it will subtract from the original value of the "2000" data box?
 
Also, I am not understanding what you mean Epy by "bool" tag. I should have been more clear.. Data box 1 is already linked to a data tag from the plc. That's the data source. So when a # is entered into this data box a counter value is changed on the PLC. So would I use the tag that is already being used in this data box, and then make another tag to subtract from this tag? Reference image - The "SET COUNT" data box is the one that already has a tag.
The "SUBTRACT FROM SET COUNT" button does nothing right now and is what i would like to be able to hit and for it to pull up a numeric entry box.

11gsqk5.jpg
[/IMG]
 
I've attached an example that (I think) does what you mentioned in your second post. Basically it's my first suggestion but I put a nonfunctional raised panel behind the Tag2 data box to make it look like a button. When you hit the Subtract button, it will prompt you for a value then subtract it from Tag1 which is adjustable in a separate data box. (Tested in emulator.)

To answer your question, no I don't think you can use a Button primitive to adjust a value via a keypad entry window--this can only be done by enabling data entry on a data box object.
 
OK I was wrong, you can in fact trigger data entry from a Button primitive:
1. Create a button, then right click and remove the button text.
2. Right click again and do Add Data.
3. In the button properties, pick the proper tag (Tag2 in this case). You can set the contents to "Label Text" if you don't want to show the value on the button face. Be sure to enable Data Entry.
4. In the Entry tab, put Tag1 -= Tag2 in the On Entry Complete action.
 
Perfect! Thank you very much kolyur. It worked out exactly how I wanted. One last question. Right now the number that I add in the "subtract" data box stays there. For example if I type in 100, hit enter, it subtracts 100 from my original tag, but if I hit the "subtract" data box again, it retains the 100. Is there a way to set that number back to 0 after the box is closed, but keep the subtracted value of the original data box? This isn't that big of deal if it is not easy or not possible to do.
 
Last edited:
Yep, in Crimson you can separate actions with a comma and they will be executed in order. So in the On Entry Complete action, put:
Tag1-=Tag2, Tag2:=0
 

Similar Topics

Hey guys, hoping someone here could give me a little advice. I'm working with a CR1000-04000 in Crimson 3.1 and I was interested in adding the...
Replies
4
Views
124
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
5
Views
230
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
108
Has anyone found a way to convert/replace/update the firmware on old Parker TS80xx series HMIs (i.e. TS8010, TS8006, etc) to accept Crimson...
Replies
0
Views
96
Has anyone setup communications with Red Lion 3.0 MODBUS to Baker Hughes Centrilift GCS VFD? Thanks
Replies
0
Views
91
Back
Top Bottom