DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Global Variables While Using Sequencer

I'm missing something from the process of using global variables as semaphores between my MainMenu worksheet, the task worksheets and the Sequencer file. Each of my task worksheets have the same global variables defined by the Options -> Define Global Variables screen (each name used and variable number is consistent from worksheet to worksheet). Also, the MainMenu worksheet also has the same Global Variable numbers defined for the same names. I've noticed that when I go back to the sequencer file after loading and attempting to run from the MainMenu that the Sequencer loads the global variable names I entered have been replaced by "VAR_998" and "VAR_999". While the Sequencer file was open I even went into the Global Variables screen and made the same global variable entries. But these Global Variables were missing from that screen later. Do I have to create a new Sequencer file, or can I edit the global variables and expect it to retain them and refer to them correctly? I suspect that I may not have adhered closely to creating my Sequence file and may have made changes to the worksheets and then gone back to the Sequencer file to do more editing. I guess my question is, how critical is it that the Sequencer file be created only after the MainMenu and task worksheets have been frozen against changes? Also, when I'm adding new worksheets to the Sequencer file do I have to "Load Worksheet" for every New Worksheet I add? I couldn't find the Load Worksheet operation discussed. Thanks
0 Kudos
Message 1 of 6
(7,074 Views)

DASYLab variables and strings always exist, whether you have configured them or not. There are always 999 variables.

 

When you use a variable as a semaphore, DASYLab is really just storing the variable number. The name is a convenience to help you to keep track of your variables. 

 

All that matters is that the running worksheet and the Sequencer have the same variable number. The Worksheet sets it somehow, and the Sequencer reads it, and acts on it, as you have defined. 

 

The Sequence file doesn't store the Global Variable settings, but displays the names that are stored in the current worksheet. If there is no worksheet loaded, then the sequence just uses the ${VAR_xx} placeholder. If a worksheet is loaded, and the variable name is defined, then you should see the place holder change to the ${NAME}.

 

If each worksheet uses a different name for each variable, then the Sequence display will depend on the loaded worksheet's settings.

 

If you really want to be consistent with naming, use the Worksheet Options menu to Export the Variables to a file, and then Import into each one of your worksheets. That's how I did the example that I set up for you.

 

When I've worked on sequences, I find that I work iteratively... get the worksheet working, create the sequence, change the worksheet, update the sequencer... and so on. The only rule is that the worksheet must exist to add it to the Sequencer. After that, you can edit as much as necessary.

 

To add more worksheets to the Sequence, you right click and Add a New Worksheet. 

 

Load worksheet simply opens the selected worksheet, and is the same as going to the worksheet view and using File... Open.  Once loaded, you can go to the worksheet view and edit the worksheet. 

 

 
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 6
(7,067 Views)

I've recreated my Sequencer file and duplicated the same global variable naming convention in this file as all the other worksheets referenced. That all appears to be good now.

 

I exit DASYLab, re-load it, load the Sequencer file and then when I run it from the task bar nothing happens except that the MainMenu task is clearly running, but no task selections that I make are working and I cannot exit the Sequencer when I click on the MainMenu's Stop button. Other than still a possible missed connection between Global Variables and switch modules. Am I following the correct procedure for loading the sequencer and attempting to run it from the task menu and expecting everything to work after that?

0 Kudos
Message 3 of 6
(7,055 Views)

Bill... I think you've exceed my capabilities to diagnose via Forum.

You can either post your complete set of worksheets (zip them please), or, contact Measurement Computing (in the US) for technical support. Your local reseller (not the US) may be able to help as well. 

 

MCC -- 508-946-5100 x2

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 6
(7,045 Views)

Thanks CJ. I've attached the Sequencer, the Menu worksheet/layout and the task worksheets. Currently, when the Menu is running nothing happens when the On part of the On/Off button is clicked. Expected operation is explained in the steps below. Clicking Off does terminate execution of the Menu worksheet.

 

I'm pretty certain that the problem(s) exist in the Menu worksheet in configuring that Action Module and the On/Off switch. I'm hoping the Black Box module that I built and used in each of the task worksheets is embedded in that worksheet's "code", since I know of no such Black Box worksheet where it resides. Here's how it's supposed to work. Once the sequencer is loaded and run from DASYLab:

1) Select a Frequency's letter (A, B, C, etc.) from the coded switch.

2) The corresponding frequency's code is written to the global variable WV998.

3) Clicking the On button starts the measurement based on the value of the global variable WV998 whose task worksheet is loaded and run (as referenced in the sequencer file).

4) The selected task work sheet either concludes or is Aborted by clicking the Abort button and the Menu worksheet is reloaded and run.

5) Goto step 1.

 

Any help in understanding the problem(s) would be appreciated.

 

0 Kudos
Message 5 of 6
(7,039 Views)

The variable 998 is not getting set for two reasons.

 

the wv998 module is not setting 998. It's configured for 999.

 

regardless, it's the Write Variable module is configured for "On Action", but there appears to be no Action module that sets it.

 

so, it just sits there. 

 

Verify the variable number in each worksheet, too. The one I looked at was setting Var_1, not 999, as the Sequencer is looking for. 

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 6 of 6
(7,037 Views)