Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

post massage

i'm using a pci 6503 daq card to read input and control outputs. i'm using lab view to do this in. the ouput of the DaQ card is attache to an opto 22 from cyber research though a ribbon cable.
the problem i'm having is that i read two inputs in  qmax read  vi the outputs goes  to an and gate  and than i use a qmax write vi.if the output of the and gate is true  a valve turns on.
all this is in a while loop. so when ever the inputs go low the output goes low and the valve turns off.
 
  as i run the program the output  pulses  very fast at random even if the inputs are low or high.  i have a 100ms wait  if i get rid of the wait it pulses  at a faster rate.    is this card
capable of doing the read and write at the same time?
if it is what do i need to do to stop the output from pulsing?
 
0 Kudos
Message 1 of 2
(2,813 Views)
Hello eleno12r,

It sounds like you may be using some of the Traditional NI-DAQ Easy I/O Digital VIs in LabVIEW (Read From Digital Line, Read From Digital Port, Write to Digital Line, Write to Digital Port).  There is an interesting interaction between these VIs and the 8255 chip that is used on the PCI-6503.  You see, with the 8255, when you configure one port for either input or output, the lines on all ports of that chip are reset.  This is just the way that chip works. 

Now the Easy I/O Digital VIs have port configuration code built in.  So if you are calling one of these VI's repitively in a loop without properly wiring the iteration terminal, you may be inadvertently resetting the digital lines over and over again.  Another potential problem can be seen when using these VI's to configure multiple ports.  In this case, the uninitialized shift register that is used to store the task ID can cause unexpected behavior.  In general, these VI's should not be used in this case.  For a good example of how to properly code this type of application in Traditional NI-DAQ, refer to the LabVIEW example Write to 1 Dig Port(8255).  For more information on the behavior I've described, refer to the following two KB's:

Why Do All My Digital I/O Ports Reset When I Configure One Port?

Can I Use the Write to Digital Port VI to Write to Multiple Ports?

If you are actually using NI-DAQmx to program this appliation, please refer to the LabVIEW example Write Dig Port.

I hope this information helps!

Best regards,
0 Kudos
Message 2 of 2
(2,793 Views)