Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i generate buffered handshaked output from one PXI-6534 card & acquire same data through another PXI-6534 card?

Hi,

I am testing an interface card which acquires 16 bit digital data at every 5 microsecs along with Dvalid pulse. Dvalid signal is high to low edge signal each time indicating the presence of 16-bit data with OFF time 1 microsecs (variable) & ON time of 4 microsecs (variable) making total of 5 microsecond period in all the possible cases. Interface card stores this input data in temporary buffer. It has got sync circuit which has REQuest signal & Acknowledge signal to have 2 way handshaking protocol.


I am using 2 PXI-6534 modules, Ist acting as source of data, IInd acting as data reader.


In Ist PXI-6534 card, I am using Co
ntinuous handshake output Vi, i have connected CPULL to +5V pin to make it default high. I m fetching a signal of frequency 200KHz (5 microsec period) to REQ1 of this card. ACK1 is connected to Dvalid pin of interface card.


In IInd PXI-6534 card, I have connected REQ1 & ACK1 signals to respective singals of interface card. I am using Continuous Handshake output vi, i have connected CPULL to +5V pin to make it default high. Whenever data comes from the Ist card, interface card generates high to low REQuest signal connected to REQ1, IInd 6534 card acquires data asserting ACK1 signal after acquisition. This cycle repeats.


Now problem is that i m storing the generated & acquired data in 2 binary files & later i am comparing them. Here i observe that i am missing some data in between. What could be the reason? I have tried to set all the signals status in hardware & vi. Still i am not able to match the generated & acquired data. I am attaching both the vi.


Thanx in advance fo
r your help,


Best Regards,
Nirmal Sharma
Download All
0 Kudos
Message 1 of 5
(3,889 Views)
Hello Nirmal,

When you say that you are missing data, are you referring to data at the beginning, at the end, or spread throughout the acquisition?

Looking at your code, it is generally a good idea to move file I/O outside of loops. Try writing to an array and then writing that data to the file outside of the loops.

Also, I'm not entirely sure what is going on in your DIO Write custom.vi. How has it been modified from the general DIO Write?

Scott Romine
National Instruments
Scott Romine
Course Development Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,889 Views)
Thanx Scott,

I am missing digital data sometime in the beginning or at the end. I have tried the same program without File I/O, still i m missing data.

In DIO write Custom vi, i have changed the execution properties of this vi. i have made it reentrant & as a subroutine to make it faster & reduce any clash in the data.

I will just elaborate the problem..lets say i m writing continuously 0-255 on port 0 & 1 each time through cont handshake output vi. when i am reading through cont handshake input vi, i get sometime 0-190, rest data from 191 to 255 is missed out.

I have tried all possible methods..but not successful in reading complete data. In my application, its very critical to get all the data without missing any single data.

Hope
for some solution,

Regards,
Nirmal
Email: nirmalsharma@autotecsystems.com
0 Kudos
Message 3 of 5
(3,889 Views)
Nirmal,

The size of the buffer is determined by the number of scans/updates that you specify for DIO Config. For handshake outputs, you have it set equal to the number of updates and for handshake inputs, you have it set to 100,000. Then, in the DIO Start VI, you specify to acquire continuously by wiring the number of samples to 0. This means that the operation will run continuously or until you clear it. If you leave the value in DIO Start unwired, though, it will use the default value that you specified in DIO Config. Try leaving these unwired, and see if the process is being cleared prematurely.

Have you tried using DMA transfers to write the data instead of IRQs? IRQs cannot occur until the CPU is ready to transfer the data. So, a
ll of the data may not be getting transferred into the buffer. DMA transfers bypass the CPU and write data directly to memory. Try using DMA transfers to acquire the data and then see if the data written to the files match up.

Let me know if this doesn�t clear things up, or if you have any further questions on this issue.

Scott Romine
National Instruments
Scott Romine
Course Development Engineer
National Instruments
0 Kudos
Message 4 of 5
(3,889 Views)
Thanx again Scott for your prompt response,

I will just explain some points:

1. Cont handshake output: Buffer size is equal to no. of updates bcoz i wish to output only 256 no. of maximum data but for safe end, i m creating buffer of 1024 points .

2. Cont handshake input: Buffer size is 100000 bcoz on the other end i dont know how much data is coming, so i m creating a buffer of 100000 no. of points not to miss any single data or avoiding overflow of data.

3. DIO start vi: I have written no. of samples to 0 to continuously write data from one side & continuously acquire data from other side.

4. DMA/IRQ transfer: Sometime i need to transfer only 2 bytes of data which causes problem incase of DMA transfer..i think tha
t less than 32 bytes, it can not handle data. So by applying IRQ method, i am able to transfer any no. of data greater than 2 bytes.

By mentionig above points, i m trying to clear the whole picture & my concepts also. If any of my above points are wrong, pl. guide me.

Let me try your methods on customer site. After that I will give feedback.

Best Regards,
Nirmal
0 Kudos
Message 5 of 5
(3,889 Views)