Hide screen elements if not needed


CamEra

Recommended Posts

Hi,

Is it possible to hide screen elements that are not to be used.

The reason for my question is that I am setting up a control system for 6 tanks controlled via a Carel Modbus Gateway. No trouble in setting that up and it is happily talking to the Carel Contollers and to DaqFactory and allowing me to get the temperature information from the tanks as well as set the setpoints in the Carel Controllers. The idea is that the tanks will be cycled through a typical daily temperature regime, so each hour (or as often as required) the set point in the Carel Controller for each tank will be changed based on a csv file, the Carel Controller then controls a large heat pump which controls the temperature in the tank. The Carel Controller handles all the hard work keeping the tank to the correct temperature as well as switching the relays for the heat pumps - in reality a very simple system to set up and maintain.

Depending on the experiment that is to be run not all the tanks maybe used so I was wondering if it was possible to have a dialog when the DaqFactory file is loaded where the user chooses what tanks are in operation - series of radio buttons or whatever, and then the main screen that shows all the present temperatures from all tanks and their set points would be adjusted so that only those tanks in operation would be displayed. same would go for screens with graphs on, only those tanks being used would be displayed.

Thanks

George

Link to comment
Share on other sites

Sure, but you need to name all the components that you want to disappear. My recommendation is to create one set of graphs/displays and name all the components with 0 at the end, so tankgraph0, tankleveldisplay0, etc. Then, if you select all those controls and duplicate them, they will auto-increment the 0 to a 1. To name a component, select it, then right click and select Change Component Name.

Now then, once you have it named you can make it invisible by setting its Visible parameter to 0:

Component.TankGraph0.Visible = 0

Set it to 1 to make it visible again. I recommended naming them the same but changing the last value because you can then create a function to hide any particular set of components:

function ShowHideTank(tanknum, show)
   execute("component.tankgraph" + doubletostr(tanknum) + ".visible = " + doubletostr(show))
   execute("component.tankleveldisplay" + doubletostr(tanknum) + ".visible = " + doubletostr(show))

The execute() function executes the string I concatenated up using the two parameters to either show or hide all the components for a particular tank. Just add more for each component. This script would go in a sequence called ShowHideTank, and you'd call it from another sequence by doing:

ShowHideTank(3,0)

which would hide tanknumber 3.

Link to comment
Share on other sites

Archived

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