DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

Move used variables/strings

Dear all,

I try to use Dasylab to control and collect data from several equipments at lab (thermostat, stirrer, syringe pump, manostat, thermometer...). Now I have prepared several worksheets (each for single equipment) and it +- works (it is necessary to complete with some functionality but for collecting current lab data it is sufficient). The worksheets works, but only for single equipment, but I need to work with all of them. So I rebuild the worksheets that the each equipment is packed at black boxes (each worksheet one black box ant it works). Then I save all of black boxes and put them to one worksheet. Unfortunately, the worksheet prepared this way doesn’t work because there are problems with global string and variables. When I save the black box, I don't save the string/variables definitions. For instance the expression of one string in original worksheet is calculated automatically this way: "R" + SubStr( "000",1, 3-(${VAR_51}>=1000)-(${VAR_51}>=100)-(${VAR_51}>10)) + StrFmt(${VAR_51},8,0)+${STR_52} to prepare output string "R0120\r". I am able to export and import global string and variables but only as whole package of 999 variables. I don’t know how to move only used ones (I am able to move them at TXT format, but I am not able to read them to Dasilab as variables).

 

I have two questions:

1 - Is there any possibility to set "calculate expression automatically" for string/variable during running of program (using some action module or something like that)?

2 - Is there any possibility to save only used strings/variables and collected several packages of variables to one (for instance VAR_1-VAR_50 for thermostat and VAR_100-VAR_150 for thermometer)?

0 Kudos
Message 1 of 4
(5,861 Views)

Hi!

 

To calculate an expression for a variable at run-time, I think the only option is to use a formula module, the connect its output to Write Variable modle. I did not find anything else alike for strings.

 

As for the second question, I think to export partial string/variable list, you can use the copy/save option where they are declared, the import the resulting string file. 

 

Hope this is of some help.

 

Kind regards:

 

Andrew Valko

NIH

Andrew Valko
National Instruments Hungary
0 Kudos
Message 2 of 4
(5,807 Views)

I found that if I used the Define Global Variable dialog, and clicked the Save button, it gave me a choice of saving defined variables (those whose settings are not the default) or variable with descriptions.

 

I saved the file. It gave me a file that included all of the information.

 

I tried to use the Global Variables and Strings Import dialog, but the file was not ordered correctly.

 

I opened it in Excel and changed the columns around to match the Help (see picture). Then, I saved it as a TXT file again.

It imported with some errors - notably the additional settings, such as read at start, do not import. The one formula that I created imported correctly.

 

I think that you can save the used variables from your various worksheets, combine them into one file, change the order of the columns. Since it's a text file, you can change the variable numbers if you need to... 

 

Unfortunately, you cannot import strings this way, as the Help says "DASYLab can only read in strings from VAR formats."  Personally, I agree that this is a major limitation!

 

09-16-2013-PrintScreen-0000.png

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 3 of 4
(5,804 Views)

Thank you both for your advice.
It can partially help, but it is major limitation if it helps only with variables. It is really strange that DasyLab prepare txt file and it is not able again to read it. That it is necessary to transform column at excel, than remove quotation marks that Excel add and than it again doesn’t work because it is not possible to use named variables/strings at expressions because Dasylab it omit and evaluated as "UNKNOWN OR INCOPLETE FUNCTION" and it is necessary to rewrite it by hand...

To ValkoA: The formula module is good tool but it is not able work with string and string functions even though the result is variable (for instance ${STR_1}="a" it is not possible to use at formula module, but it is possible to use at calculation of variable. (May be it is possible, but I don’t know which way.)

Anyway thanks. The information haw import the TXT file was new for me

0 Kudos
Message 4 of 4
(5,796 Views)