Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

monitoring pulse generation

Hi all,

I am using a USB-6210 card and measurement studio with VStudio2003. I would like to drive a stepper motor (which turns a miror in a spectrometer) by sending digital pulses to a motor driver. Using another channel on my card, i would also like to read a voltage (from an IR detector) every time i send 100 pulses to the stepper motor on the other channel. The purpose is to be able to log the voltage against the position of the motor.

I am not sure what the correct method is... I can think of different options :
  1. Use \National Instruments\MeasurementStudioVS2003\VCNET\Examples\DAQmx\Counter\Generate Pulse\GenDigPulse + incrementing a variable that counts each time i send a single pulse. When the variable reaches 100, i take a reading. This concept is simplistic, however with this method i am concerned about having to often start/stop the task.
  2. I have seen interesting examples in the following directories, using a continuous pulse train + counting digital events.
    1. \National Instruments\MeasurementStudioVS2003\VCNET\Examples\DAQmx\Counter\Generate Pulse\GenDigPulseTrain_Continuous
    2. \National Instruments\MeasurementStudioVS2003\VCNET\Examples\DAQmx\Counter\CountDigEvents\
    • How can i integrate these two examples to be able to count the pulses? Shall I just physically connect the counter pin and the pulse generation pin on the connector block of my card?
    • To decide whether the motor has arrived to the aimed position I could use the a "counting" class to drive (=start/stop) a "pulse generation" class ?
    • However the counting methods are driven by a Timing function (which runs every 50ms max), so i will always end up being slightly over positionned because of the lag time of the OnTime method? (i guess it doesnt really matters, as long as i know where i am)
  3. Use a finite pulse train. This imply using my two counters and then i would not be able to know where my motor is if the software was to end prematurely.

Does anyone know what is the right way to do this?

Thanks
Laurent
0 Kudos
Message 1 of 2
(6,190 Views)
0 Kudos
Message 2 of 2
(6,179 Views)