LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital Output and Digital Input tasks at same time using NI 9403 at cDAQ

Solved!
Go to solution

Hello,

 

I am trying to write a Labview program that can provide digital output signals (DO) and can read voltages (DI) at same time.

I have cDAQ 9174, and a DIO module NI 9403.

 

For NI 9403,

line 0:3 provide the DO for a motor translation.

line 4 reads the voltage (DI) from an sensor that can decide whenever I should stop the motor to avoid motor damage.

 

I am wondering if I could  use this single module (9403) to achieve DO and DI at same time? And how to handle the sampling rate for the two different tasks?

 

Thanks for the help!

 

 

 

0 Kudos
Message 1 of 6
(3,096 Views)

https://www.ni.com/pdf/manuals/374069a_02.pdf

     "In an NI CompactDAQ chassis, you can use the NI 9403 as only a static (software-timed) digital I/O module".

Digital lines can be used independently (run in parallel simple digital input and output examples for separate lines (not port)), but at low rate (hundreds Hz, software timed loop). 

If it is stepper motor, might work in not critical application, without smooth speed control. You can run clock task in one loop and switch "enable", "direction" only when you need them.

0 Kudos
Message 2 of 6
(3,056 Views)

Hi Alex,

 

Thanks for your reply.

 

I tried DO and DI at a very low rate 50Hz, and it is not working. Also, I need a fast motor translation, and 1.5k Hz at least. Now I am considering the analog input module (NI 9201) for sensor reading. 

 

May I ask if this SINGLE AI module can provide two AI tasks? (One for my other device, and one for sensor readings at different rate)

 

Thanks,

Elliot

0 Kudos
Message 3 of 6
(2,734 Views)
Solution
Accepted by topic author ElliotYY

Hi Elliot,

 


@ElliotYY wrote:

May I ask if this SINGLE AI module can provide two AI tasks? (One for my other device, and one for sensor readings at different rate)


No, the NI9201 uses a MUX to switch between its 8 channels. So it does not support sharing that single MUX between several DAQmx tasks…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(2,728 Views)
Solution
Accepted by topic author ElliotYY

@ElliotYY wrote:

May I ask if this SINGLE AI module can provide two AI tasks? (One for my other device, and one for sensor readings at different rate)


Sample both at the higher rate in one task and downsample the slow one.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 6
(2,726 Views)

Yes. It works for me. I combined the two AI tasks to a single task at high rate.

 

Thanks a lot!

Elliot

0 Kudos
Message 6 of 6
(2,692 Views)