Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital Input using a 6543 (pci) and 6533 (Pcmcia), Visual C++ and NI-DAQ

Hello All

This is a follow up to some of my previous postings. I currently have two cards I am evaluating, a PCI 6534 and a PCMCIA DAQCard 6533. I have a small application that outputs a pattern on PortA and inputs from PortC and D when an external trigger, being used a clock on the REQ2 pin is asserted. Basically the Pattern Generated output generates 200 10uS pulses at a rate of 1 pulse every 100uS. FOr each of these pulses some external electronics provides a pulse on the REQ2 pin which initiates input on PortC and D. Hence for every output pulse I have one input clock pulse. Now this seems to work fine most of the time for both cards.

Now the problem is this. I am using the DIG_Bl
ock_In NIDAQ function to take in a count of 200 inputs. Now I have counted the number of pulses placed on the REQ2 pin and monitored the data acquired. If there are 200 pulses on the REQ2 pin (in an ideal situation) then I acquire 200 samples on PortC and D. That is I fill my input buffer (i16 inBuffer[400]) with 0-199 elements. However, on the odd occasion the number of pulses on the REQ2 pin drops to 199 and I only get 0-191 elements when using the PCI 6534 and 0-197 when using the DAQCard 6533.... Any ideas why this should happen? Is it something to do with the number of bytes transferred by the different cards? Any help would be gratefully appreciated. Now this isn't too much of a problem for one off runs, but I am repeating this process some 3000 times during a patient test and I can get anything around 130-150 incomplete buffer entries.

Kind Regards

Jamie
0 Kudos
Message 1 of 3
(3,322 Views)
Hey Jamie,

Here is a KB that might help explain what is going on in this case.

http://digital.ni.com/public.nsf/websearch/2FB93421FAD8374286256BDF007A78AF?OpenDocument

I hope this helps.

Joshua
0 Kudos
Message 2 of 3
(3,322 Views)
Hey Joshua

Thanks for the help. Just a quick question. I guess I should use DIG_Grp_Mode to configure the REQ polarity to either active high or low but what would I have to specify in the arguments? DIG_Grp_Mode has the following arguments :

deviceNumber - No Problem, have this
group - Again No Problem
protocol - ?
edge - ?
reqPol - ?
ackPol - ?
delayTime - 0

What would I set the arguments to set the REQ polarity to active high, removing the need for an extra clock trigger? ( as in the KB you pointed me to)

Would I set :
Protocol - 1
Edge - 0
ReqPol - 0
ackPol - 1

Any ideas?

Kind Regards

Jamie
0 Kudos
Message 3 of 3
(3,322 Views)