01-17-2008 01:30 PM
01-18-2008 04:25 PM
Hi,
I would suggest breaking down your project into three parts. Let’s first get the 4 AI channels readings using the PFI 0 as the trigger. From your description you have couple of options for this part: N sample acquisition, programmatically stop the task, use a window trigger to stop the task or programmatically let the code read the 4 AI for an amount of time. For that I would suggest staring from either: “Acq&Graph Voltage-Int Clk-HW Trig Restarts.vi” or “Acq&Graph Voltage-Int Clk-SW Trig Restarts.vi” these programs are included in the shipped examples.
After these part is up and running next step will be making sure we are able to read the values from the encoders so let’s get this code: NI-DAQmx: Reading the Position of an Encoder into a Buffer or DAQmx - Measuring Angular Encoder Position, even though is for angular encoder the connections to the counter are the same for a linear encoder, so channel A and B from the encoder will go to ctr0 source and aux respectively.
After that both of those codes are up and running take a look at the code attach and target it to your RT machine, the code attach is using a software trigger that you can change for a hardware trigger following the first example I pointed.
I hope it helps
01-18-2008 04:25 PM - edited 01-18-2008 04:27 PM
Let me know if it helps