Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Need To Sample 6023E analogs and two 6601 Channels

Using PCI-6023E and PCI-6601 - need to synchronize
two counter channels in buffered position mode to
the analogs of the 6023. Tried routing AI_SCAN_START
with RTSI 0 on the 6023E and setup the 6601 to have
both counter 0 and 1 on same group and do AI_START
on 6023E. The analog AI READ returns data as expected
but there is no data in the CTR READ BUFFER. Do I need
some other type of gate input? When the 6601 is tested
w/ the position vi sample it works ok but the buffered positional sample returns no data.
0 Kudos
Message 1 of 6
(3,018 Views)
Greetings,

It appears that you want to correlate your position measurements with your analog input data. Is this correct? I think you are on the right track. You need to route AI Scan Start, the scan clock, to one of the RTSI lines. You then need to use this RTSI line as the GATE for both of your buffered position measurements. Thus, both current positions will be "buffered" every time an analog input scan occurs. With regards to the buffered position measurements, each counter must be in a separate group. I would suggest that you duplicate the code from the Measure Buffered Position (NI-TIO).vi example to accomplish this task.

Good luck with your application.

Spencer S.
0 Kudos
Message 2 of 6
(3,018 Views)
Spencer

You are correct - I want to synch my counters to the analog. I had started w/ the example you suggested
and changed it to AI SCAN START and duplicated the code for the two counter channels. Still nothing returned by the counters. If you have a minute, I've attached the sample code I'm using. There are two
main vi's - one to start the sampling (Clear And
Start AI.vi) and one to read the data later (Scaled
AI Read.vi). In the start routine I can only enable one of the two counter controls. If I do both, I get
a counter control error.

thanks for the help

Rob Clark
0 Kudos
Message 3 of 6
(3,018 Views)
Rob,

I took a look at the attached VIs. First, I want to make sure that you are specifying two different counters with Clear and Start AI.vi. It looks like both the "counter 1" and "counter 2" controls are set to 0. Other than that, your code looks correct. Which error are you receiving?

Spencer S.
0 Kudos
Message 4 of 6
(3,018 Views)
Spencer

Thanks for the look. Here is what I learned:

1) Main problem was my EE connected the RTSI
cable to the wrong card!

2) Once #1 was fixed I could read counter zero
OK and then my next problem. I got a DMA error
on setting up counter 1. I figured out the 6601
only has 1 DMA. I've ordered a 6602 to handle
buffering two counters.

One more question - is it normal for the Counter
Buffer Read to take several seconds to transfer
the buffer? It's killing my cycle time.

Thanks for the response
Rob
0 Kudos
Message 5 of 6
(3,018 Views)
Rob,

I am glad you have been able to resolve the majority of your issues. With regards to point #2, I wanted to make sure that you were aware of the fact that an NI 6601 can perform multiple buffered operations simultaneously, but you will need to use interrupts with the additional counters, as opposed to DMA.

With regards to your last question, if the requested amount of data is available when Counter Read Buffer.vi is called, it should take very little time to execute. Otherwise, the VI will wait until the data is available or the time limit expires. I would suggest that you review the value you have wired to the number to read input. Most likely, lowering this value will solve the problem.

Spencer S.
0 Kudos
Message 6 of 6
(3,018 Views)