One Page to Display Multiple Units


Recommended Posts

There are several ways of doing this. The easiest way is probably using evaluate():

1) create your channels for each unit, ending the channel name with the number of the unit. Something like this if you had two channels for each unit:

mychannel1

myotherchannel1

mychannel2

myotherchannel2

etc.

2) create a global variable called displayedunit and init it to 1

3) create your screen, but anywhere you would normally put mychannel1[0] replace with:

evaluate("mychannel" + doubletostr(displayedunit) + "[0]")

really, you are taking the entire expression and just substituting the global. Its even easier if you make displayedunit a string variable, say "1" or "2" instead of number, then its just:

evaluate("mychannel" + displayedunit + "[0]")

If you have something more complex, like math, do:

evaluate("mychannel" + displayedunit + "[0] * pi() / 180")

4) finally, just change displayedunit to change which unit is displayed.

Note that this only works for display. If you have output channels you need to use the Quick Sequence action and execute() instead of evaluate().

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.