Crimson 3 - adjusting decimal places in data field?

kolyur

Lifetime Supporting Member + Moderator
Join Date
Oct 2004
Location
Wooster, Ohio
Posts
1,602
I am displaying inch position values in numerous places on a Kadet G307K2. The display format is three decimal places, i.e. 00.000. I need to modify the setup so the user can display all values in metric (centimeters) by changing a setup parameter. For a variety of reasons, the centimeter display format must be two decimal places (00.00 or 000.00).

I am struggling to come up with a way to do this, or even a decent workaround. As far as I can tell, the decimal places setting in the number format is not adjustable programmatically. I know I could use a string display with a DecToText statement, but this would only work for display-only fields. Many of the fields are data entry, and the values need to be entered in the same format as they are displayed. I could stack two primitives on top of each other, with only one visible at a time, but this seems like a less-than-elegant solution.

Any other suggestions?
 
I would use another tag for each entry. Make it's data source TagA*2.54. Set up the units and decimal format how you like it. Implement scaling to do the units conversion for you. Condition the visibility of the affected display objects with a Units_Metric flag tag, or !Units_Metric depending on which one you want visible. If there are many of them, it might make sense to group them and assign visibility to groups rather than each element within the groups.

Another route would be to have entirely separate pages that get called when Units_Metric == true.

EDIT: To use a tag as a data source for another tag and have it writable, you will have to use the scaling fields instead of TagA*2.54 in the data source fields. And obviously the source tag must be writable.
 
Last edited:
I could be wrong but I believe the built-in tag scaling only applies to tags that are mapped to external devices. In my case all the tags are Internal. There are multiple ways to handle the math; my real problem is how to adjust the decimal point position.

Your suggestion on using separate pages did get me thinking though. I could set up a Master page that would include everything except the specific data boxes that need metric/English conversion. Then create two separate pages based on the master with the properly-formatted data boxes for each unit system. This would allow me the most flexibility with number formats and I wouldn't have to deal with primitives layered on top of each other. Thanks!
 
I could be wrong but I believe the built-in tag scaling only applies to tags that are mapped to external devices.

I stand corrected. I just did a test and your are right. scaling can't be applied to tags with other tags as the data source.

Having your cm tags use the device data source instead of the other tag will probably be just as efficient anyway. You can stick all the tags in a folder, copy and paste the folder, open the folder and change the scaling and decimal point of the first tag. Then copy and paste special those properties to the rest of the cm tags in the new folder. So in under a minute all the tags are created with the same labels and colors and other details as the original...but that is the easy part....not that anything is too terribly hard in Crimson.

This would allow me the most flexibility with number formats and I wouldn't have to deal with primitives layered on top of each other. Thanks!

I also try to avoid layering primitives. Grouping them helps make it easier to edit them, and simpler to apply visibility to the whole group. Making whole pages avoids the layering/editing problem, but then there's a bit of ugly to conditionally call the right page...

There are probably six other ways to tackle this we haven't thought of...
 

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
128
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
262
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
117
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
101
Has anyone setup communications with Red Lion 3.0 MODBUS to Baker Hughes Centrilift GCS VFD? Thanks
Replies
0
Views
94
Back
Top Bottom