Linked format in Crimson 3, Red Lion.

Elcan

Lifetime Supporting Member
Join Date
Apr 2008
Location
NC
Posts
935
Hi all,
I have a question about "linked format: in Crimson 3.
I'm trying to display temperature values in Celsius and in Fahrenheit, depending on the value of a flag tag (the user will switch a button to select between Fahrenheit or Celsius). My idea is to use a tag "Temperature", and then assign a complex code to this tag, like:
if (Selector = "F")
return Temp_in_F;
else
return Temp_in_C;

This code works for the value.
However, when I try to use the same code for "Format Like", it does not work as expected: does not display the format of the corresponding tag.
What am I doing wrong?

Thank you!
 
Can you just set a flag tag when in F mode?
Then display based on the flag tag.
I assume you want to display units (C or F) next to the actual value.
 
I think there is an easier way...like just putting conversion (complex) code in the scaling of the "Data" tab of the Temperature tag...

Now, if you want to use the Format tab units (suffix) character, then you should be able to do that by writing to the tag.units property. That's the only way I can think of to dynamically change the Format Units at runtime, but there are probably other ways.

The way you are doing it, your complex code is likely returning the integer value of the tag, not a value representing its format...I don't believe there is such a property accessible at runtime.

Hope this helps,
Paul
 
Now, if you want to use the Format tab units (suffix) character, then you should be able to do that by writing to the tag.units property. That's the only way I can think of to dynamically change the Format Units at runtime, but there are probably other ways.

Paul,
I tried to change the units at runtime, but my code was rejected: "you need a writable expression on the left side".
 
It's my understanding he wants to give the end user the ability to switch temperature units at runtime, without using different screens/tags...just one tag that changes how it is scaled and appended depending on the flag tag representing the desired display units.
 
It's my understanding he wants to give the end user the ability to switch temperature units at runtime, without using different screens/tags...just one tag that changes how it is scaled and appended depending on the flag tag representing the desired display units.

Exactly!
I want to use one tag to show temp in Fahrenheit or Celsius (depending on the user's choice). This tag will invoke either tag that stores the value in Fahrenheit or one that stores Celsius, according to the value of a "Units" tag. I know how to select the corresponding VALUE, but I don't know how to select the FORMAT.
Since "Format Like" admits a Complex formula, it should return a format depending on the code in the formula, right?

I know there are workarounds, but I wanted an elegant and less laborious option.
 
I think that the problem is that "Return" sends a value, not a tag. If you only need the units. Make a seperate object, and place it after the tag(with no units). I would use a flag tag for your selector, with an On Value of °F and Off Value of °C. If you don't need to write to the tag, then you could do something with complex code to return a string.

I like Okie's idea of complex code in the scaling, (did not realize you could do that), but you run into the problem of needing an offset with temperature.
 
I would just have two tags, one for each unit, and have them both reference the same PLC tag, so you can display Degrees_F or Degrees_C with a two state indicator (using your flag tag).
 
Your two best solutions are the ones provided by Brijm and OkiePC. You will either need a second object to display the F/C, or simply toggle two tags.

Thanks
Jeremy
 

Similar Topics

Hey guys, I'm not super familiar with Cnet, so I'd like some insight from people with more ControlNet experience than I. We have a controllogix...
Replies
4
Views
914
Hi all, Im having some issues and hope you can help. A customer wants an existing Panelview Plus connected to their Active Directory. At the...
Replies
1
Views
2,319
I have a PID instruction in the ladder logic with tag name pid1 I was trying to follow the youtube to create the PIDE faceplate, however, the...
Replies
0
Views
1,195
At the end of the day today I did my first program edit in my customer's Simatic Manager project. It was the simplest of edits... add a bit with a...
Replies
5
Views
2,342
At the outset, a caveat…the following inquiry is a tad absurd but it is made at the customer’s behest. I have a customer with a Windows XP...
Replies
0
Views
1,038
Back
Top Bottom