Quality ready made and affordable custom software



PHP Serial
Easy Control
Rack Designer

Quick Texts
Wallpaper Slideshow


All articles
WS2300 weather station PHP project
Your own terminal in 17 lines
PC PIC Voltmeter
Network messenger in 22 lines
Phone Dialer




Copyright 2001-2024
© Cosmin Buhu

  Multiple racks

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:

openrack (rack1.res)
openrack (rack2.res)

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:

openrack (first.res)
if (pbutton1==1)
openrack (second.res)
if (pbutton2==1)
openrack (first.res)
goto again

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:

openrack (first.res)
if (pbutton1==1)
openrack (second.res)
goto second
goto first
if (pbutton1==1)
openrack (first.res)
goto first
goto second

I think is very simple and with some imagination one can build very powerful instrumentation.

Enjoy !