Recommended Posts

Hi,

I am trying to control an analog output channel (DAC0_fanout) which varies with time, with the following piece of sequence:

global step
private j

step = (FanSetPoint-DAC0_fanout[0]) / FanRampTime
j=0

while (j<FanRampTime)
   DAC0_fanout = DAC0_fanout[0] + step
   j++
   wait(1)
endwhile

... so basically it is suppose to update the new value for DAC0_fanout with a value equal to the previous value of DAC0_fanout plus an increment (step), every one second. On inspection of the time history of DAC0_fanput, the update time intervals range from 10s of ms up to approx one second (which confuses me also but is not the main point of my dilema). It seems that when the value of DAC0_fanout is updated to a new value, if there is a small time interval until the next update of the channel, it seems to revert back to the value before the recent update (like the new value didnt have time to register or something??).

I hope I have explained well enough so you know what I am getting at...

Thanks for any help...

Ben

Link to comment
Share on other sites

Can you post a sample, or at least tell me what hardware you are using? I've attached my sample that shows it working properly, but with a Test channel. It might be dependent on the driver. At what wait() value does it stop working properly? I'm assuming you understand the perils of using wait() instead of delay()?

ramptest.ctl

Link to comment
Share on other sites

OK - well that was weird.

I had a slider displaying the value of DAC_FanOut[0] and for some reason (??) that was messing with the time intervals for updating the output channel DAC_FanOut[0] (if I executed the sequence when on another page everything worked fine, but if I tried to use the button to start the sequence that's on the same page as the slider, the output channel updated at strange time intervals rather than every second as the sequence was instructing (wait(1)) ). I have now removed the slider from that page, and everything works fine - man that took me a while to figure out... (Thanks for your sample file though...)

btw, I am using a LabJack UE9.

cheers,

Ben

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.