Execute commands at particular frequency | LabJack
 

Execute commands at particular frequency

4 posts / 0 new
Last post
BR_Innes
BR_Innes's picture
Execute commands at particular frequency

Hi, 

I'm using the Labjack U3-LV with the Matlab UD to trigger a device. I basically use code from the u3_simple demo to set output FIO4 high and low. 
I was wondering if there was a way to set up the LabJack so that these two requests were repeated at a particular frequency (e.g. 50Hz) for a specific number of times (e.g. 100 repeats). Is there a way to set up a timer to do this? 

Thanks 

LabJack Support
labjack support's picture
Consider using a PWM16 timer

Consider using a PWM16 timer and another timer in STOP mode:

https://labjack.com/support/app-notes/waveform-generation

BR_Innes
BR_Innes's picture
Thanks for your answer, I

Thanks for your answer, I followed example code on setting up a timer in stop mode and this solution works for me. 

I was wondering is it possible to extend this to deliver more complex pulse patterns e.g. if I want to deliver 10 pulses at 50Hz every 0.5s (2Hz) for a total of 100 pulses, would I need to set up additional timers to control this?   

LabJack Support
labjack support's picture
There is no way to do that in

There is no way to do that in hardware on the U3.  I suggest you use a software timer in Matlab to make a loop iterate every 500ms.  Each time the loop iterates you have it configure the timers to do 10 pulses at 50 Hz.