LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Configuring an NI cDAQ-9174 chassis

Hi All,

 

I've just recently purchased a NI cDAQ chassis, along with a analogue input BNC module and thermocouple module. I'm looking to take readings from both modules simultaneously. I've created a vi to run this simulation but I can only get temperature to run properly from the chassis.

 

When I run the voltage, it records sample data for a very limited no. of samples.

 

It does this even if asked to record 1k's worth of samples at a given frequency. The simulation will tend to run for a maximum of 600ms at best. Is there something I'm missing?

 

I'm very new to LABVIEW so any help would be most appreciated.

 

Thank you

0 Kudos
Message 1 of 7
(3,852 Views)

show some VIs, it will be more likely people can help you here.

There are nice examples in LabView how to do DAQ with DAQmx VIs:

start LabView -> Help -> Find Examples -> Hardware input and output -> DAQmx -> Analog input.

And you can try the Voltage - Continuous Input.vi for example...

0 Kudos
Message 2 of 7
(3,847 Views)

Thanks for your keen response. Please find the VI I have so far! I will have a look at the examples you've discussed

 

Best Regards

Craig

0 Kudos
Message 4 of 7
(3,832 Views)

Oh boy.  Well yes I highly recommend going through some of the links I showed when you get a chance.

 

General comments:

 

You should never ever use the Run Continuous button in the toolbar

You should never ever use the Abort VI button in the toolbar

I highly recommend not using DAQ Assistant or Express VIs, but I can't say it is wrong to use them.

I highly recommend not using dynamic data type, but I can't say it is wrong to use them.

 

Go to Help >> Example Finder, and search for Voltage Continuous Input.  It shows you how to take voltage readings, set up timing and triggering, log to file, and display it with a proper stop not an Abort.  

 

EDIT: You will not be able to configure the task to read both of your channels in one task because they are on two cards that aren't syncronized, and besides you wouldn't want to.  Temperature will come in much slower than a normal AI.  So you'll need to make a VI that makes two tasks, one for each measurement type.  The example shows how to setup for one measurement type.

Message 5 of 7
(3,826 Views)

hello,

 

I put together a simple example. Note, this only uses software timing, recently 10Hz. I have no idea what your hardware is capable of, read the spec sheets (max sampling, HW timing, etc.). Also, I only tested this on a simulated cDAQ device.

Also, if you want to do more, you should really learn LabView basics first. If you have licence, you get free access to the self-paced online learning material (Core 1, etc)...

 

EDIT: actually in this example, the create task VI is not necessary at the beginning, but does not hurt...

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

Actually I would modify my VI a bit, find it attached.

Since we read 1 sample per channel at every iteration in the loop, the DAQmx Read can be set "NChan 1Samp" mode.

Also, I think it is always advisable to use the "Start Task" and "Stop Task" VIs before and after the while loop, because otherwise the task is started and stopped repeatedly inside the while loop. This is not an issue at low rate, but still not nice. I am not sure about this however, maybe someone with better knowledge in DAQmx could confirm this? Also, I wonder why some cDAQ voltage AI modules throw an error for this VI (see the saved error code in the VI)? In my case here I have simulated cDAQ module NI-9239, and it does not work together with the thermocouple. Why it cannot be software timed?

 

I hope morell21 you do not have this module...

 

 

0 Kudos
Message 7 of 7
(3,796 Views)