LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

High Speed Digital I/O using 6533

I would like to have a application sending out bit sequence through port0 of PCI 6533 card, and using port2 recieve those bits, then do a pattern matching.

I set the output bit pattern changes at the 10th iteration of my control loop, however, I got the changed bit pattern at lots of iteration later. I cannot figure out what happened.


I want to achieve the pattern matching in the oder of milliseconds(immediately knows the bit pattern has changed). But it seems my programs structure cannot do that. Please take a look at my program and give me some advice, thank a lot.


Best Regrads,


Stee
0 Kudos
Message 1 of 6
(3,420 Views)
Hi Stee,

I might have a couple ideas why your data might be delayed. But help me understand what you are trying to accomplish. Are you trying to acquire continuous data from port 2? Are you acquiring it using change detection (you want to acquire everytime there is a difference in the data)? Do you want to acquire it with a pattern match trigger?

What I imagine is happening is that you are only acquiring data every so often and the PCI-6533 card by default is transferring this data via DMA. The interesting thing about this is that if you need each sample right away transferred to the PC Memory so you can read it, it might not happen with DMA. This is because in DMA mode on the PCI-6533 the "MITE" chip that packs data for transport waits until it h
as enough samples to send. Therefore, if you are only acquiring so often, you might be trying to read the present data (which is on the board) but the MITE is waiting to pack the data and send it to the PC Memory so you can read it.

What you need to do in this case is use the Set DAQ Device Info.vi to change the transfer mode from DMA to interrupts for the second group (your digital input). In interrupt mode, as soon as you input data, it is sent via interrupts to PC Memory. This means it won't wait for a "packet" to be filled before it sends the data. This means if you are acquiring digital input at rates up to 500kHz, interrupts will allow you to get the data right away.

Anyway, let me know if I wasn't clear in my explanation. Hope that helps.

Ron
Applications Engineer
National Instruments
Message 2 of 6
(3,420 Views)
Dear Ron,

Thanks for your reply. I didn't tried out your suggested method yet, but what I am trying to do is continuously send serial bit patterns through 1 line of port0 and continuously acquire those data from 1 line of port2. The input and output are doing in the same while loop using the same internal clock. I cannot using change detection since my data is serial bits in a certain frame size. I am not sure about the pattern match trigger, can you give me any suggestion on that?
The major problem I am facing is that everytime I change my output bit pattern, I need to wait for a lot of iterations before I can see the changed bits at port2. I shall try the way you suggested and any other suggestion that my program can run faster is welcomed.

Thanks ver
y much for your help.

Stee
0 Kudos
Message 3 of 6
(3,420 Views)
Hi Stee,

One thing to notice in your code is that in your loop, you are writing a buffer's worth of data. You are not writing 1 data value but you are writing 1024 points, I believe. On the input, I also notice that you are not reading 1 point at a time but are reading 1024 points at a time as well. Based on the timing of your device, you are writing a value and then you are reading the value right away. However, since you sent the data to be written in 1 loop iteration, it is not likely that you will be reading in that exact buffer of data that you just wrote. It is more likely that you are reading in the buffer that you wrote out the previous iteration. This doesn't mean that your data isn't perfectly synchronized though. You will hav
e too test it by writing a finite number of points, let's say 10,000 points, and then try reading in 10,000 points as well. Overall, you will read the exact number of points and they will correspond to the same points you wrote and in the same order.

The key in this case is that you start the process off by writing X amount of data (we'll call it x1). In your loop, you write the next X amount of data x2. However, at this point, if you are reading the same number as you wrote out the first time, you will be reading x1's data. So you will be off by 1 write cycle. It also looks like you initially write 4096 points in the first place. This means your data read will be off by 5 iterations.

Anyway, I hope I understood your code correctly. That is what I believe you are seeing though. Have a good day.

Ron
0 Kudos
Message 4 of 6
(3,420 Views)
Dear Ron,
Firstly, thank you for spending time on reading my code. My program is exactly as you said.
The program structure is basically following the examples I can find on the website for synchonized DIO. However, this is not exactly what I am wanting to do.

As I need to achieve a bit rate above 50kbps, if I write 1 data value per loop iteration, my bit rate cannot reach such high level. Also, I do not want the delay caused by the initially wrote data, but I can find no way to get rid of them. Without the initial writing step, the program could not start. I am very interested in the method you have mentioned earlier which is not using DMA but interrupt based on input events, can you give me some examples to follow ? or can you sug
gest some method that I can retrieve the data I just write out so that I can do the matching immediately after the output pattern have been changed.

Thanks very much for your time.

Stee
0 Kudos
Message 5 of 6
(3,420 Views)
Hi Stee,

Help me understand your application. You would like to perform continuous input and output at 50kbps.

There are LabVIEW examples that perform both simultaneous input and output. Here is a link to one of them:

Simultaneous Pattern I/O or Burst Mode I/O Using One 653x Device
http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3F06956A4E034080020E74861&p_node=DZ52319&p_source=External

Give that a try. Hopefully, you don't see the delay on the input. Have a good day.

Ron
0 Kudos
Message 6 of 6
(3,420 Views)