LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MathScript AI

Hello, 

 

I've got an issue with the LabVIEW MathScript Node. The function that will acquire analogue inputs directly through the MathScript node (aiwf) has an example piece of script in the help file, which can be found online here: http://zone.ni.com/reference/en-XX/help/371361A-01/lvtextmath/msfunc_aiwf/. 

 

However, I can only get this function to actually return data when I put my arguments directly into the function call, i.e. not using intermediate variables as shown in the example. Also when the empty data is returned there is no error code either. The example lists the script as this:

 

 DEVICE = 'Dev1';

CHANNELS = [0,1];

RATE = 1000;

SAMPLES = 2000;

DATA = aiwf(DEVICE, CHANNELS, RATE, SAMPLES);

 

but I just don't get anything out.

 

I have an example attached  that shows the output on a chart from the function using Variables and Direct arguements. Toggle the Boolean control to see the difference.

 

Cheers

 

Tom.

 

0 Kudos
Message 1 of 2
(2,422 Views)

First, the link you posted doesn't point to a valid website.

 

Second, I don't know why you would want to do analog input from within a MathScript node.  That seems like something you should be using purely DAQmx functions from within LabVIEW.

 

Third, if you click on you broken run arrow, you will see why your code won't run.

 

You have a variable named data coming out of the mathscript node, but you call it "DATA" within the mathscript node.  Capitalization matters.  Also you have a variable error that you do not define within the mathscript node.  Fix those two things and you see the code runs.

Message 2 of 2
(2,401 Views)