montyk Posted December 9, 2008 Share Posted December 9, 2008 I have an applictation were I am reading data from 16 different units but the screens are exactly the same. Is there a way I can use one screen for all 16 units istead of copy the page 16 different times. Link to comment Share on other sites More sharing options...
AzeoTech Posted December 10, 2008 Share Posted December 10, 2008 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.