LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issues outputting binary data from NI9401 DAQ Card (multiple lines)

Solved!
Go to solution

I am having an issue sending comms through the DAQ card stated above and hope someone can help if possible.

I will try to explain as much as possible so please excuse the long paragraph to follow.

I have attached the main code to this post along with a 'dummyframe (SubVI)' that I will explain further down.

 

I am developing a test fixture that tests one of my companies products. This product runs on our own protocol (a string of 1's and 0's) and I'm attempting to send this to the device being tested for communication purposes.

I currently have the NI9401 set up on a single chassis and I'm using this to send my companies protocol to LabVIEW.

I have this set up and running well to test one of the products. I have selected port DIO0 to send a string of 1's and 0's. I have a subVI that stores the 1's and 0's (attached dummyframe SubVI), which are written and outputted to the device correctly using the DAQmx VI's available. An example of this can be seen in the main code (the upper while loop and inner case structure labelled 'Stage 1 - First Dummy Frame'). As already stated, this is working well and this is successfully communicating with one device under test. The 'dummyframe SubVI' stores the 1's and 0's that the DAQmx writes from.

 

However I now want to develop the code further to test multiple products at the same time. I want these to run independently to each other. In the main code, the lower while loop shows the code for the testing of the second device, which is just a repeat of the upper while loop (with channels and SubVI's changed to suit).

In the DAQmx create channel VI, I have simply changed the input line from DIO0 to DIO1, so that I can wire DIO1 to the next device comm line. When I have done this and ran the software, there is no output from line DIO1. If I run the upper while loop (Test1) on its own, the software still works fine. If I try to run the lower while loop on its own (Test2), there is no output from the NI9401. Do i need to configure this new port (DIO1) or should it just work automatically on my channel selection? Is it possible for the DAQ Card in question to run multiple lines simultaneously?

 

Its also worth noting that when I run Test1 and then start to run Test2 during Test1 running, the comms drops out from Test1 and DIO0.

I require 4 lines for testing 4 products at the same time and there are 8 channels available on the DAQ, but i am already having trouble when just adding the second line and seem to be getting interference between the lines as explained above. Since i first set up DIO1, it has never outputted any comms.

 

I hope I have explained this well enough but please feel free to ask for further explanation and information if necessary. 

Hope somebody is able to help and the feedback would be much appreciated.

 

Thanks

Martin

 

Download All
0 Kudos
Message 1 of 4
(686 Views)
Solution
Accepted by topic author MWeb87

This is going to be a limitation of your hardware.  You may have plenty of DIO lines, but what you *don't* have is enough "timing engines" in the chassis to control 4 clocked DO tasks simultaneously.   Each independent hardware-clocked task requires its own "timing engine" resource and there aren't enough to go around.

 

I only have modest familiarity with cDAQ, and I know such things vary from chassis to chassis,  but I also know I've seen specs for more than one chassis that only support 1 DO timing engine.  I've not sure if I've ever seen 2, but I definitely haven't seen 4.

 

This same kind of limitation tends to hold true in desktop boards as well.  About the cheapest way out I know of is multiple 9401 modules and multiple single-slot cDAQ chassis.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 2 of 4
(632 Views)

Hi Kevin.

Many thanks for your response. The single clock / timing engine makes perfect sense to me. This makes the interference between the two separate loops understandable. 
Quite frustrating how i have 7 other DIO lines available but not to suit this application.

 

I have attempted to split the DIO0 line into both units i am testing and revised the software so it is all running in the same while loop from the same clock at the same time, so they are running in parallel, and this has also been successful.

I’m not sure if this will still function properly after i have added the third and fourth test units, but the extra hardware has been ordered just in case. 

Thanks again for your response, it is much appreciated and it has helped a lot.

 

 

 


 

0 Kudos
Message 3 of 4
(613 Views)

Hi Kevin.

Thank you for your last response.

I now have 2 separate 9401 modules with 2 single cDAQ chassis. I have 1x 9401 controlling two devices, 1x 9401 controlling another 2 devices.

I have them set up on 2 separate loops (as shown in the attached code).

If i run the first loop on its own, it functions correctly. If i run the second loop on its own, this also runs correctly.

However, when i try to run both loops together, there sees to be a comms issue and its as if it cant run both loops simultaneously.

I have tried to add a small delay (2s) in the second loop so it is staggered when the start button is pressed, and this has helped, but hasn't fixed it completely. The first 2 devices from the first loop always work first time with no issues, but the 3rd and 4th device controlled by the second loop is intermittent.

Should the 9401's be capable of running at the same time? I am also using 4x USB-6001's in this set up.

Could this be an issue with my PC? Can 6 DAQ cards be run through a Startech USB 2.0 Hub?

0 Kudos
Message 4 of 4
(562 Views)