Crimson 3.0 Modal popups and tag attribute copy

tetsu0

Member
Join Date
Jan 2016
Location
CT
Posts
2
Scenario:
I have a set of tags I would like to edit with a modal popup window. I want the user to only enter a SP within a certain range of it's current value. For example if the SP is 50, only want a bump of 20, the user would only be able to enter a new value between 30-70. And I want to show the old and new values before the user hits the Accept or Cancel button.

So I have a numerical entry (display only) with a User Defined Action: (removed some superfluous code)
Code:
Entry.Old_Value = Setpoint; // show old value
Entry.New_Max = Setpoint + 20; // set max range
Entry.New_Min = Setpoint - 20; // set min range
If(showmodal(ENTRY))
Setpoint = Entry.New_Value;
The Cancel button returns: EndModal(0);
The Accept button returns: EndModal(1);

It all works perfectly however the formatting does not carry over to the modal window tags. My SP tag has 2 decimal places and a format of kPPH.

Questions:
Is there a way I can dynamically reference formats between tags?
I would like to use this modal window for each data entry.. for %, DegF, kpph. All of those have different decimal formats and units.
 
If you are assigning the value of the referenced tag to the value of the tag that appears in the pop-up, then you could also assign the units property at that time.

I am not sure if the number of decimal points is available as a property you could access at run time. If you could post a stripped down version of the Crimson file you have working, I would better understand what you describe.
 
I can set properties such as min and max value but I'm unsure if you can copy the format. Plus modifying those 8 or 9 copies and ranges gets tedious the more entries you add.
You'll see in the example that any current value display on the modal popup will never decimal points.

I've considered displaying the current value as a string like:
Code:
Entry.Current_Value = tag.astext
however, that won't help me display the entry field in the proper format.
 
Last edited:
Hmmm. I can get the units added to your existing complex code quite easily, but the decimal places is not so simple.

I think you might need to use a linked format, or some other type of design to be able to have a custom data entry display like you want.
 

Similar Topics

Get ready for some seemingly easy questions! I have a setpoint that pops up a data entry for temperature. I have also instituted a auto ramp...
Replies
1
Views
1,454
Hi all, I'm trying to use the Showmodal function, but I can't make it work. Could anybody show me a sample code that works? Thank you!
Replies
2
Views
2,258
I was looking throught the functions list in Crimson 3, and found the showmodal and endmodal functions. These are used to show a generic popup...
Replies
0
Views
1,421
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
257
Back
Top Bottom