LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Solved: DAQmx Synchronize Continuous I/O

I'm posting this LabVIEW project demonstrating mixed DAQmx I/O in hopes that it might save someone else some time and that someone might point out a better way to do this or to some documentation that describes the right way to do this.

 

I'm doing a hardware in the loop (HIL) simulation using cDAQ with 4 modules, digital inputs and digital and analog outputs (both voltage and current).  It was not at all clear (from NI documentation), how to do this using DAQmx VIs, so I had to get some help from NI support and a lot of trial and error.  The attached demo uses simulated hardware (exported nce file included), but I've checked something similar on real cDAQ hardware.

 

Since I'm running closed loop, I don't want to use the DAQmx output buffers.  Those buffers can cause some weird results, so I set "RegenMode" = "Do Not Allow Regneration".  However I still had to write initial values (with autostart = False) prior to running "Start Task".   I'm using the INPUT task for the main timing, but I set the timing of the other tasks to be identical, but they run after the DAQmx Read in the while loop, basically "On Demand", but because they use the same clock, the actual triggering should be the same.  The analog outputs, (voltage and current), are combined into a single task and single DAQmx Write.

 

The attached code in the ZIP file was saved in LV2014.

It includes "Get Terminal Name with Device Prefix.vi" (to use the same clock source), from the following:

                  https://decibel.ni.com/content/docs/DOC-12182

Synchronize Continuous Acquisition of Multiple Analog Input Devices

which was posted by user:  EEsRULEtheWORLD

 

Download All
0 Kudos
Message 1 of 3
(3,294 Views)

Hello PointOnePa,

 

Thanks for posting the example! I'm just curious, what did you setup look like and what devices were you using?

 

Thanks,

 

Lauren

Applications Engineer

National Instruments

0 Kudos
Message 2 of 3
(3,242 Views)

I'm not sure what you are asking that is not already provided. 

The PNG and VI in the project list the hardware components:

 

      cDAQ with 9401 for discrete inputs (6)

                        9481 for discrete outputs (3)

                        9265 for analog outputs (current) (2)

                        9263 for analog output (voltage) (1)

 

 

 

0 Kudos
Message 3 of 3
(3,235 Views)