Changing output time | LabJack
 

Changing output time

6 posts / 0 new
Last post
WalkerF
WalkerF's picture
Changing output time

Dear all,

Through the U3 I would like to trigger a single pulse of 200ms.

Can this be done by tweaking the timers in the LJ Control Panel?

Thanks!
Francesco

LabJack Support
labjack support's picture
The Waveform Generation app

The Waveform Generation app note describes different ways to make pulses:

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

Any of the methods supported by the U3 will work for a 200 ms pulse.  I'd say the WAIT technique is the simplest, depending on your software.

What are you using for software?

 

WalkerF
WalkerF's picture
I was hoping that sending a

I was hoping that sending a pulse would be possible through the LJ Control Panel or through  the LJLogUD.

 

If this isn't possible I would do it through Python code. Is there any example code available to do this?
In sum, the experimenter should manually input a specific voltage. This should result in 1 pulse of 200ms.

WalkerF
WalkerF's picture
Sorry for my previous message

Sorry for my previous message. I managed to send a pulse with the following code, so all good!

import u3
d = u3.U3()
d.debug = True
DAC0_VALUE = d.voltageToDACBits(2, dacNumber = 0, is16Bits = False)
d.getFeedback(u3.DAC0_8(DAC0_VALUE))
d.getFeedback(u3.WaitLong(Time = 11)) #Time = 11
DAC0_VALUE = d.voltageToDACBits(0, dacNumber = 0, is16Bits = False)
d.getFeedback(u3.DAC0_8(DAC0_VALUE))

LabJack Support
labjack support's picture
With LJControlPanel you can

With LJControlPanel you can create a frequency with a certain pulse width using a timer, but it is continuous until turned off. Using the test panel you can toggle digital I/O, but there is no timing you can set. The test panel update rate is 1 second.. LJLogUD only performs readings.

Looks like you figured it out with LabJackPython. Keep in mind that you are using 3 sets of USB command-responses which have USB delay per call. For better pulse accuracy, combine your three Feedback calls into one for only one USB command-response for the pulse. For example (based on your code):

 

import u3

d = u3.U3()

onBinary = d.voltageToDACBits(2, dacNumber=0, is16Bits=False)
offBinary = d.voltageToDACBits(0, dacNumber=0, is16Bits=False)

# WaitLong: 12 * 16384 = 196,608 us
# WaitShort: 26 * 128 = 3,328 us
# Wait Total = 199,936 us
command = [u3.DAC0_8(onBinary),
           u3.WaitLong(Time=12),
           u3.WaitShort(Time=26),
           u3.DAC0_8(offBinary)]
d.getFeedback(command)

 

Also, if you can use 0 and 3.3 V logic for you pulse, you can use a digital output instead of a DAC.

WalkerF
WalkerF's picture
Thanks, great suggestion!

Thanks, great suggestion!