09-08-2014 04:44 PM
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!
09-08-2014 04:54 PM
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.
09-08-2014 04:57 PM
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?
09-08-2014 05:11 PM
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.
09-08-2014 05:25 PM
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.
09-09-2014 01:47 AM - edited 09-09-2014 01:48 AM
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.
09-09-2014 10:46 AM
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 .
09-15-2014 08:44 AM
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.