Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital output with NI-9401 in cDAQ-9174

Solved!
Go to solution

Hi

 

I have a cDAQ-9174 with a digital I/O module NI-9401. Now I want to output dignital signals on line0:3

line0: Boolean 1 after time=10ms

line1: Boolean 1 after time=20ms

line2: Boolean 1 after time=30ms

line3: 20 pulses (period =250us, duty ratio=0.5) after time=40ms

set line0:3 to be Boolean 0 after 45ms

 

Can anybody let me know what I need to work on to solve this please?

Thank you all for your help.

Regards

Bing

0 Kudos
Message 1 of 6
(5,856 Views)

Hi Bing,

 

I would like to learn a little bit more about your application so that I can advise you. How accurate do these timing need to be? If you need a high degree of accuracy I would suggest using the DAQ hardware clock otherwise the OS clock should suffice. Also, what experience do you have with DAQmx programming in LabVIEW? Are you familiar with the lower level DAQmx API?

 

Best Regards,

 

Christian Hartshorne

NIUK

0 Kudos
Message 2 of 6
(5,840 Views)
Solution
Accepted by topic author NCLbingji

Thank you Christian for your quick replay.

I have some experience in programming microcontroller with C. I have learned LABVIEW for about 1 month and followed lots of online demons and tutorials. I know the basic DAQmx Data Acquisition VIs and property nodes.

As I mentioned early about the line0,lin1and line2, they are used the control the relay in my circuit. 10ms could be controlled right with the OS clock. The series of pulsed from line3 is used for IGBT gate signal, which is time critical. I want to use hardware clock to accurately control the line3 and meanwhile synchronise the pulse with analog inputs from another two NI9206 modules in the same cDAQ chasis.

 

I just want to know more about the line digital signal output application for relays, and correlated line finite pulses output synchronized by analog input. Waveform diagram is enclosed.

 

Thank you.

Bing

0 Kudos
Message 3 of 6
(5,838 Views)

I think the line3 pulses can be correlated with the conterinternaloutput clock in thecDAQ-9174 and routed out by the P0.3/PFI 3( CTR 0 OUT) of the NI 9401. Am I right? Thank you.

0 Kudos
Message 4 of 6
(5,827 Views)

Hey Bing,

 

Sorry for the delayed response. You are absolutely correct in that you can use one of the internal counters of the cDAQ-9174 as a hardware clock for your time critical line 3 pulse. You can then also use this clock source to synchronise the line 3 digital generation task with the analog input task on the NI 9206 module.

 

If you are relatively new to DAQ in LabVIEW I would recommend that (in addition to looking through the material available on the NI website) you check out the examples that are available in the NI Example Finder (select Help > Find Examples... in LabVIEW). There are examples which should illustrate how to perform a digital generation tasks which should be applicable to your application, analog input tasks and also synchronised tasks (Synchronisation > Multi-Function). The Multi-Function-CTR Pulse Train Generation for AI Sample Clock example could be modified to also incorporate the digital generation required for line 3. I suggest that you take a look through these examples to familiarise yourself with the functions and let me know if you have any more questions.

 

Best Regards,

 

Christian Hartshorne

NIUK

0 Kudos
Message 5 of 6
(5,737 Views)

Hi Christian,

 

Thank you for your reply

I have learned The Multi-Function-CTR Pulse Train Generation for AI Sample Clock example and run it on my cDAQ9174 with NI9206.

My project is to generate 10 pulses of 1kHz, duty cycle=0.5 from NI9401. Total time to run = 1/1000* 10 = 10mili seconds.

Simultaniously to start to aquire analog samples at 100kHz from NI9206. Aquiring 1000 samples at 100kHz which also cause system time to run=1/100 000 * 1000 = 10mili seconds

However, I have to following errors

Error -200284 occurred at DAQmx Read (Analog 1D Wfm NChan NSamp).vi:1

 

It seems the 10 * 1kHz CO pulses and 1000 * 100kHz AI samples are not to be achieved in the application stated above. Do you think if I should set the same timebase source(DAQmx Timing Property Node) to start CO and AI simutaneously?

 

Please check http://forums.ni.com/t5/Counter-Timer/pulse-generation-with-NI9401-in-cDAQ/td-p/1195969 for my VI.

Thank you.

 

Bing Ji

0 Kudos
Message 6 of 6
(5,702 Views)