DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

Initialize Value for Control

Is there a way to initialize the values of a slider or switch when a worksheet starts running? Ideally, this could be used either from a constant or a global variable that is then written to an .INI.

 

Thank you!

0 Kudos
Message 1 of 8
(6,517 Views)

For the slider, you can use a global variable for the initial value, and configure it to load at Measurement Start. 

 

For the switch... it may need an action module to read the value of a variable and set the switch.

 

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 2 of 8
(6,516 Views)

Thank you. Does that load happen as the first event, or will the first set of data use the initial value before the "read global" is instituted?

 

0 Kudos
Message 3 of 8
(6,514 Views)

If you set the Global variable options to read at measurement start, it happens before the first data point is generated.

 

The Action is more problematic for the switch, because it needs data to do the first action.

 

I do use the Measurement Start event to force my switches to OFF, typically. That seems to happen before the first data point is generated.

I tried a couple of ways to set the switch based on a variable, and it really didn't work correctly. 

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 4 of 8
(6,509 Views)

I tried doing this to turn the Record switch off, but it still tries to write the file if it crashed the original time. I have to do a very quick F5 - switch- off if the program crashed due to the file problem. 

 

Action Module is set to swithc off at measurement start. I attached the screenshot of the module control.

 

Thank you for all your help with this.

0 Kudos
Message 5 of 8
(6,506 Views)

Hmm, why is that switch in ON position?

Load the worksheet, do not start the experiment, turn off the switch, save the worksheet.

Now, regardless what happens, the experiment will start with the switch turned off.... until you save the worksheet with the switch in ON position.

M.Sc. Holger Wons | measX GmbH&Co. KG, Mönchengladbach, Germany | DASYLab, DIAdem, LabView --- Support, Projects, Training | Platinum NI Alliance Partner | www.measx.com
0 Kudos
Message 6 of 8
(6,499 Views)

This occurs if the worksheet is stopped mid-test, such as with a write error. In another hread,  have a question pertaining to the error handling that may render that a little less important. 

 

The worksheet will be accessed by only occasional users, so I'd like to make it as robust as possible without needing to resort to workarounds .

0 Kudos
Message 7 of 8
(6,487 Views)

I've had good success with the Measurement Start Action... connect it to a switch, not to the data flow, and see if it works any better. 

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 8 of 8
(6,424 Views)