Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI6534 loop on board memory with external clocking

Hi all, 

This could be a simple question:  We are trying to loop a digital pattern (4000 samples) on PCI6534 with external clocking (2MHz). Each loop takes 4 seconds, and within each loop for the purpose of timing we have a pair of digital pulses (1ms wide, seperated by 2ms) to turn on the external clock.   The porgram is attached. 

 

Line 84-119: method for outputing the pattern once, which works fine, correctly timed, and never fails; 

 

Line 122-1130: I was trying to loop the method defined in Line 84-119 a few times.  The output in Loop#1 is always corrected timed, however, within the first 4 seconds, the pattern has been outputed 3~4 times even though the external clocking is still within Loop#1. It just looks like the device received external triggers by itself. Any ideas? 

 

It is true that in Line 122-130, the data set havs been write to PCI6534 onboard FIFO a few times. It is proably better to write the data set only once, and output the pattern whenever the external clock pulse is on. Could anyone suggest an example? 

 

Thanks,

Kunyan

0 Kudos
Message 1 of 4
(4,010 Views)

Hi I am sending an update on this. Suppose we do not loop and just write 4000 samples to FIFO. We first turn on external clock for 1ms, then turn it off and wait for a time t. Finally turn on the external clock for antoher 1ms to output the rest samples. The results are quite strange: 

 

if t<~450ms, then everything works right; 

 

if t>450ms, say t=600ms, the second 2000 samples are out about 450ms afetr the end of first 2000 samples, it just looks like the device can not hold the data for longer than 450ms.  

 

Any ideas? 

0 Kudos
Message 2 of 4
(4,004 Views)

here is an update again. Please ignore what I said in level #2. It turns out to be a timing problem on control of external clock. Now the program works fine in either single output and loop (using the method defined in OutputDataRepeat()).   Now the question is simpler:

Could anyone suggest an example for sending data to FIFO once, and loop a few times, using external timed clock?

0 Kudos
Message 3 of 4
(4,000 Views)

Hi eLions,

 

Here is an example of writing to a port with an external clock. I do not know of an example that does quite what your asking for. You should be able to modify this to use the onboard memory. Let me know if it is helpful. 

 

Regards,

 

Josh Brown

 

Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,990 Views)