Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Oven control

Your help has been very much appreciated

 

Excellent! I have that working now.  Can you tell me if there is any correlation between the frequency and duty cycle on the counter output  and the frequency and duty cycle on the digital output task? Can they be the same?

 

In one of your first posts you suggested, "Use the 9211 as a software-timed analog input task and write the new duty cycles to your digital task based on the measured values." Would the timing of this analog input be controlled by the counter we just created?  If so, then I should be able to run the counter and then run the analog input  task to verify that's working correctly. If that works correctly then I could move to manipulating the analog input data to generate a new duty cycles?  (Correct, I hope)???

0 Kudos
Message 11 of 15
(4,006 Views)

Awesome, glad to hear it's working.

 

The duty cycle on the counter output is irrelevant (50% is fine, I'd avoid excessively high or low duty cycles)--the digital output task uses a rising or falling edge to generate an update so the overall period (or frequency) is all that matters.  

 

The frequency should decidedly not be the same frequency that you intend for the output signal, but it should be much faster depending on the duty cycle resolution you want.  As an example, a clock (counter output) frequency 100x faster than the desired digital output frequency would give you a 1% duty cycle resolution, while 1000x faster would give you 0.1% duty cycle resolution.

 

 

I wouldn't use timing on the analog input task--you don't need a buffer of data as far as I can tell but rather want to respond to the most up-to-date sample that you can.  So if you configure the task in this manner (software-timed AKA "on demand"), then the timing of the analog input would not be controlled by the counter you created.  Rather, when you call DAQmx Read the 9211 would return a single sample for each channel that you would use as an input to determine the output duty cycle.

 

 

Best Regards,

John Passiak
0 Kudos
Message 12 of 15
(4,003 Views)

John,

 

I have add the call DAQmx Read the 9211 in several configurations.  Below is the latest configuration. All Im trying to do is watch the call data. I get three different temperature reading  before I get this error I  It appears that the program still hangs when ever I generate the Call DAQmx 9211. Thoughts?

 

 

Capture.JPG

0 Kudos
Message 13 of 15
(3,989 Views)

I'm not sure how the analog task is configured (it's hidden inside the DAQ Assistant), but that error still probably indicates that the digital output isn't getting its sample clock.

 

Try this:

 

DO_PWM_Feedback.png

 

 

Best Regards,

John Passiak
0 Kudos
Message 14 of 15
(3,983 Views)

John,

 

You are good, very good!!!

 

Thanks

0 Kudos
Message 15 of 15
(3,955 Views)