Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

USB 6501 DIO

Hello everyone,

 

I would REALLY appreciate it if someone could help me... 

 

I am working on an Integrated Circuit (IC) Automatic Detection System using LabVIEW and the USB 6501 DIO board. The system should be able to automatically detect common IC chips like 7400, 7403, 7408, etc. All these chips have +5V in pin #14 and GND in pin #7. Therefore, there are 12 pins left that I need to set as either inputs or outputs, apply appropiate input signals, and read the outputs to see if they match the expected behavior. If a match is found, I would know the chip that was inserted into the breadboard I am working on.

 

For example, the 7400 chip has 4 NAND gates with 2 inputs and 1 output each. If I set pins 1 and 2 as inputs and apply a logic "1" to both of them, the output (pin 3) should be a logic "0". I can easily do the same for the remaining pins and if all the outputs are logic "0" I would know the inserted chip is a NAND gate. On the other hand, if all the outputs are logic "1" I would know the inserted chip was an AND gate instead, etc.

 

I have NO problem setting the input and output pins and applying and reading the input and output signals. HOWEVER, since I create a separate task for each of the 12 lines, sometimes, I would read the output BEFORE the input signals were actually sent to the chip.

 

Using the same example as before, sometimes I would read pin 3, which is the output, before pins 1 and 2, the inputs, were sent to the chip. Is there ANY way to synchronize the input/output readings so that the output is READ while the inputs are being applied? PLEASE ANY HELP WOULD BE GREATLY APPRECIATED!!!

 

Attached is a VI that shows how I am declaring each pin as either input and output. I still have to apply the input and output signals, but that is not the problem.

 

THANKS!!! 

0 Kudos
Message 1 of 5
(4,370 Views)

Hello Argon!

 

Thanks for your post!

 

So one thing to consider when performing software timed DIO is that your operating system has complete control on when things execute if you program in parallel. So for instance you mention that some times you read your input lines before your output has a chance to driver the correct lines. One "quick" fix would be to put a small time delay in your "false" cases or DI inputs. This way you know for a fact that you are waiting until the output lines have a chance to be driven before you read. The delay could be as small as 1ms of wait. This will still allow you to keep your programing times low. Here are the benchmark times for the 6501. The 6501 does not have hardware timed control so it will depend much on the programing.

 

So with all this said there just needs to be a way in your code so you can have proper execution control. Need to make sure that your output lines are driven before you attempt a DAQmx read. The best way I have found is to use the error lines as all the DAQmx functions have them. Let me know if this helps with your program!

 

Cheers!

 

Corby_B

http://www.ni.com/support 

Message 2 of 5
(4,354 Views)

Argon:

 

Are you trying to test a known chip type or identify an unknown chip type? I was a bit confused since you say that you will already know the input/output pin pattern.

 

That is, unless you have restricted the type of chips to ones that have all of the same input/output pin patterns? Hex inverters and 3 input NAND gates would be a different breed.

 

Not to sidetrack your project, but a machine vision setup with pattern matching/character recognition could probably ID a broad range of chips regardless of pin pattern assignment.

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Message 3 of 5
(4,349 Views)

Corby_B and AK2DM,

 

Thank you so much for your fast response. I really appreciate it your help. I was able to fix my problem by using a "Flat Sequence" structure where I placed the inputs on one frame and the outputs on the next frame. As a result, the inputs are ALWAYS applied before the output values are read. I am only testing known chips, so the input/output pin patterns. Thanks again!!!

0 Kudos
Message 4 of 5
(4,327 Views)
If you would simply use the error in/error out connections, there would be no need for a sequence structure. Using these connections is basic to understanding dataflow. You might want to review some the on-line training options.
0 Kudos
Message 5 of 5
(4,311 Views)