LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DaqMX turn off equipment whilst sampling

The logging bit is fine, because if i use a sequence structure it works ok, in that it turns off teh device then logs 200 samples, it just logs too late.

 

I have attached an image of the measurment & automation config.   --- Its set to give me 200 hardware timed samples @1kHz in one array.

 

Zac.

0 Kudos
Message 21 of 41
(1,145 Views)

Here's a 2009 compatible version for you and the image. I sent the code to you so you can use context help to see what VIs I've used etc...

Mahdieh G
Applications Engineer
National Instruments UK&Ireland
Download All
0 Kudos
Message 22 of 41
(1,142 Views)

Can you also add the Merge Errors & Simple Error Handler VIs to your code so we can see if there are any errors along the way.

Mahdieh G
Applications Engineer
National Instruments UK&Ireland
0 Kudos
Message 23 of 41
(1,131 Views)

Thanks, i've been trying to get your code to work but i'm not sure about the "phsyical channels" box.

 

I normaly configure all that in the measurement & automation explorer. Is it just an actual channel like AI3 etc..

 

Or does it refer to something that has to be setup in measurement & automation explorer ?

 

And where do i find the box in the controls pallete?

 

I have attached an image of my attempt....

 

Thanks, Zac

0 Kudos
Message 24 of 41
(1,119 Views)

You just have to choose the physical channel you want to measure from your device, e.g. USB 6210, AI0. You should easily be able to choose this from your front panel from the drop down menu.

 

The reason for your error wire is that you don’t have it connected to the correct input. If you bring up context help (Ctrl + H) and hover over you VI, you can see which terminal you need to use. Right click the Physical Channel input on the DAQmx Create Channel VI -> Create -> Control. You can just copy the piece of code I sent you too.

 

Don’t forget to use the same architecture that I suggested before, i.e use your error wire to control the data flow and make the 2 processes parallel. Also add a Simple Error Handler VI so you can see any errors appearing.

 

The most important thing to do once you have wired everything is to create an indicator for your DAQmx Read VI (as explained before).  This will help us in monitoring the data readings. Let me know if you can see any data on this indicator.

Mahdieh G
Applications Engineer
National Instruments UK&Ireland
0 Kudos
Message 25 of 41
(1,107 Views)

Hi,

      i tried the example you gave, but it didn't work.

 

I got a DAQmx error (see attached image) and the indicator just showed 0 (as it didnt get as far as aquiring data)

 

I have attached an image of the error msg, and the code.

 

Thanks, Zac

Download All
0 Kudos
Message 26 of 41
(1,073 Views)

What happens if you just try running your data acquisition part of the code in isolation from the rest of your application? You can create a new VI with just your data acquisition code and run it on your USB 6210. Do you still get an error?

 

What have you chosen as your physical channel? What do you have connected to that channel?

 

I think you will need to use highlight execution (the light bulb at the top of your block diagram) to actually understand where your error is occuring. You should also put a probes on the wires you want to monitor to see the dataflow. For instance your error wire and data wire. SInce I do not have acceess to your whole set up it is very important that you try these debugging techniques.

It might also be a driver error, what version of the drivers do you currently have?

Please can you download the latest version of the DAQmx driver: https://www.ni.com/en/support/downloads/drivers/download.ni-daq-mx.html

 

Let me know how you get on with this.

 

 

Mahdieh G
Applications Engineer
National Instruments UK&Ireland
0 Kudos
Message 27 of 41
(1,034 Views)

Hi,

      i don't think its a driver error, as when i use a sequence structure it turns off then loggs the data without any problems.

 

I will some de-bugging and get back to you....

 

Thanks, Zac

0 Kudos
Message 28 of 41
(1,026 Views)

Hi,

      i tried running the code as a seperate VI.

 

It allowed me to run, but still missed the first part of the data (ie it starts to log too late)

 

See attached.

 

 

Thanks, Zac

0 Kudos
Message 29 of 41
(999 Views)

I re-wired the error wires to after the "start task" box, and it worked !

 

Is it possible to delay the "off" command further using the error wires, so it happens closer to the middle of the log file ?

0 Kudos
Message 30 of 41
(984 Views)