Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

pci 6601 3 encoders

I have a setup where I need to read 3 linear encoders using a PCI 6601. I have looked thru the examples in DAQmx and modified the example to read 1 linear encoder and that works well. Where I run into trouble is adding channels for the other encoders. I know the 6601 has only 1 DMA channel, there are documents/ web posts out there that describe using interrupts instead of DMA, the issue is those documents seem to apply to VI and VB6.0 and I have not been able to find any thing to allow this operation using VS.net 2008 and c#.

 

Can some one point me in the right direction or even confirm that 3 encoders can be read with a 6601 using the 4th channel as the sample clock?

 

Loren

0 Kudos
Message 1 of 2
(3,183 Views)

Hello Loren,

 

Yes it is possible to do this. I will provide some information below to get you started since I couldn't find any example that will do this particular application.

 

1.) First I would start with the .NET 3.5 example called MeasAngularPositionBufferedCont_ExtClk.2008.sln. This example will properly setup the buffer position task correctly.

 

2.) From here, we need to create 2 more tasks for each buffered position measurement. This code will be under the startButton_Click callback. Since all the counters are going to be used for this application, it might be best to change the form so that the counters are constants.

 

3.) Now that we have configured each Counter input, we have to provide each counter the sample clock for each task. In order to do this, use example GenDigPulseTrain_Continuous.2008.sln and combine this code with the Position Buffered measurement. Again, I think it would be advisable to make the user controls constants instead. It is best that the user doesn't have control over this. When combining this, place the configuring the task under the startButton_Click callback.

 

4.) With creating the Digital Pulse train from the counter output task, you will need to specify the PFI line where the clock is created on and specify this PFI to the other Counter Input tasks so they can have a sample clock. In order to specify the PFI line, use COChannel.PulseTerminal function. For more information search the .NET help.

 

5.) Finally, we need to deal with making one of the channels DMA and the other interrupt based. In order to do this, please examine this KnowledgeBase and place this in the Start callback.

 

6.) After this, you will need to place in the reads for each counter task and then close the tasks when the stop button is pressed.

 

I hope this information helps you with programming this and if you have any problems with this, feel free to post.


Jim St
National Instruments
RF Product Support Engineer
0 Kudos
Message 2 of 2
(3,164 Views)