08-20-2009 12:28 PM
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!
08-20-2009 12:28 PM
08-21-2009 11:35 AM
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.