From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Split Digital I/O 9401 for Bidirectional I/O with two Counters

Hello:

 

I have a NI 9401 DI/O module in a CDAQ-9174 chassis, with LabVIEW 2012.  I want to split the line direction on the DI/O for both input and output, running two counters.  I am attempting to drive a servo-style PWM signal with one counter, and use the second counter as an input for acquiring data from a digital encoder.  I've been searching the forums all weekend for a solution, and have found that many people experiencing issues have implemented a DAQmx Control Task to reserving half the unit for input or output, utilizing a control sequence to control program flow.  I've tried every possible combination of Control Task/Start Task/Flat sequence orientation, but still haven't been able to get the program to run.

 

Upon running the program, I get an [Error -200479 occurred at DAQmx Start Task.vi: Specified operation cannot be performed while the task is running.]  This error is then followed by a [Error -201133 occurred at DAQmx Start Task.vi:]

 

I feel like it must be a fairly simple fix, just something outside of my knowledge (I'm relatively new to this).  Does anybody have any suggestions for getting these two features to run together?  The other modules and chassis slots are taken for this application, so I'm dependant on getting these two tasks to run at the same time. If you need any additional information about the program, let me know.

 

Thanks!

 

Capture.PNG

0 Kudos
Message 1 of 3
(5,566 Views)

I was able to locate an example that somewhat applies to your application:

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

 

I simply modified the code to allow for CI and CO tasks, similar to your VI, and it worked fine.  I've attatched the modified code below.  However, I was unable to run your code without receiving the error you were seeing.  Even after I made the VIs identical (leading up to the Start Task VI), I saw different bahavior.  The VI that you are working on may have been corrupt.  This modified example should be a good starting point.

Applications Engineer
National Instruments
Message 2 of 3
(5,501 Views)

Thanks for the reply.

 

After playing around all day yesterday I finally found a similar example online as well, and slowly modified it one piece at a time towards the program I had posted, testing to see where it which component was wrong.  By the time I got to the end, I had copied an pasted verbatim the program from one VI into the other, and it ran without a problem.  I didn't know files could become corrupted, but that would make sense given I had similar results that you did.  I'm glad I got it working, but there was a lot of headache fighting with a program that "should" work. 🙂

 

Thank you again.

0 Kudos
Message 3 of 3
(5,483 Views)