Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI-DIO-96 digital I/O

Hi,
 
I have a strange problem with the digital I/O of the PCI-DIO-96 board:
 
I made output a signal with a 50 ms high and 50 ms low using the port0/line0. And at the same time, using a wire I connected that output (from the port0/line0) to the port1/line0 that I configured as an input. In LabVIEW I connected the data of the DAQmx Read to a LED boolean. The problem is:
- The LED does not flash as the output signal that I sent out from port0/line0, it flashs almost randomly. Below is my VI.
 
Please, anybody can tell me why the LED doesn't flash consistently with the output signal ?
 
Thank you very much.
0 Kudos
Message 1 of 3
(2,913 Views)

Hi vietwave,

Welcome to the NI discussion forums.  I have two suggestions. 

First suggestion:


The first is that you have both the read and the write in the same while loop. Because your digital write is executing in a stacked sequence structure, for each loop iteration your program is going to write two values and read only one value of the digital input. You can run your program with Highlight Execution to see this behavior.  You can put the digital read in a separate while loop.  This will allow the read to truly execute in parallel.

Second suggestion:

Because this application relies on software timing, Windows is controlling the execution order of each process. For example, if your Anti-virus or other program comes on while you are running your VI, there is no guarantee when Windows will let each program run.  You will never get a really accurate 50 ms digital pulse using software timing.  For some applications, the accuracy from software timing is good enough. You may be able to get something that is accurate enough for your needs.

A similar issue may be that LabVIEW creates a separate thread for the user interface and the code running on the block diagram and I believe assigns a lower priority to the user interface.  When running really fast loop rates LabVIEW will give more priority to executing your code then updating the buttons on the front panel.

I have attached a simple example program (a modification of yours) written in LabVIEW 8.0. To make sure it was working correctly, I ran the VI using a 1 second timing and could clearly see that the input was reading the output correctly on the front panel. 

Jared T.
0 Kudos
Message 2 of 3
(2,890 Views)
Hi J_Thomas
 
Thank you very much for answering to my message and helping me to solve the problem.
 
Thanks,
 
 
0 Kudos
Message 3 of 3
(2,870 Views)