Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Sync counter with varying frequency and samples with analog input

Hello Forum!

 

I currently have a counter that varies both frequency and number of steps for my stepper motor.  In my attached code, I use an indexed for loop to run my varying frequencies and steps.  At the same time, however, I would like to acquire analog inputs and I figured I could use the same counter to trigger my acquisition.  I am having difficulty, however, getting the sample clock to work with the varying frequencies.  When I look at the waveform on the front panel, I am seeing a straight ling stuck at +5 and no variance in my amplitude...but my sensor works properly in MAX.  Any suggestions?

 

I have attached my code so please let me know if more clarification is needed!

0 Kudos
Message 1 of 3
(3,287 Views)

Hi ejb3439,

 

Why don't you just set the frequency of your sample clock with the calculated value rather than have a counter that outputs a frequency then use that frequency as the sample clock source?  For analog input, you can use the internal clock for hardware timing. If you need to change the sample rate, you can take a look at this community example.

Regards,
Jim Schwartz
0 Kudos
Message 3 of 3
(3,254 Views)