More than one rack in same script
Shows how and why to use multiple racks in same script.
Can Easy Control handle more than one rack in same script? Yes !
But for what ? Maybe you don't want to clutter one rack window with all controls at a time.
Or maybe you must follow a specific program flow. Maybe you want some controls to change
appearance or functionality on a specifc action or data.
How to do: a simple code like that:
will open rack1 and then rack2. This is useful when you want to switch racks based on some
data, say if voltage is greater than xx then change to rack2 where a different scale for
an instrument is used.
If you want to switch racks on user action you must provide a control to test for this action.
A small example:
Build in Rack Designer two racks, say first.res and second.res. Put in first.res a power button
named pbutton1 and in second.res a power button named pbutton2.
Write an EasyControl script like this:
This example will open first rack, and will wait user to click on pbutton1. When this happens, second
rack will be open, and will wait user to click on pbutton2, switch to first rack, and again, and again...
It is possible to name the controls in racks with the same name, but the script must be changed in
this way, where power buttons was named pbutton1 in both racks:
I think is very simple and with some imagination one can build very powerful instrumentation.