Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating two digital signals and measure analog input

Hi,

 

since Im a bloody beginner with DAQmx. I came up with the question if my task would be even possible:

I need to interact with three channels:

  • Digital output 0: PWM with 2.5Hz, 50%
  • Digital output 1: creating some pattern like 1-0-0-1-1-... @1kHz at every edge of PWM
  • Analog input 0: constantly measuring voltage synchronized from e.g. falling edge of DI 1 to rising/falling edge of DI 0

Is this even possible? My Device is a USB 6343?

 

Thanks for any help or hints!

0 Kudos
Message 1 of 4
(3,376 Views)

Hello neon4444,

 

do you find the examples. You have to create three Tasks.

PWM as the master

C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DotNET4.5.1\Counter\Generate Pulse\GenDigPulseTrain_Continuous\VB

then us the PWM Output as the clock source for this slave task

C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DotNET4.5.1\Digital\Generate Values\ContWriteDigChan_Burst\VB

and also use the PWM Output as the clock for the analog Input slave task

C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DotNET4.5.1\Analog In\Measure Voltage\ContAcqVoltageSamples_IntClk\VB

The master must be started before the slaves.

 

For the function ConfigureSampleClock an external sample clock or the PWM can be used in this function, then with every PWM cycle the DO will be written and an AI will be acquired.

Sorry that i do not post directly an example, because i normally work with LabVIEW.           

best regards
Alexander
0 Kudos
Message 2 of 4
(3,342 Views)

Thank you for your help!

 

But the second example you provided doesnt work, since the USB-6343 doesnt support handshaking I/O...

0 Kudos
Message 3 of 4
(3,330 Views)

Hello neon4444,

what i mean is something like this, that the clock source for the timing funtion is the intenal output of the counter, which generates the PWM, this should work with the 6343.

Unbenannt.PNG

best regards
Alexander
0 Kudos
Message 4 of 4
(3,326 Views)