LabJack LJM analog waveform output

@histed

Hi Mark,

Support for analog waveform output on LabJack LJM devices is now available in the MWorks nightly build.

To perform waveform output, you need to add an analog waveform channel to your device definition. The waveform channel specifies the output line to use (i.e. DAC0 or DAC1), the variable from which to read the output samples, and whether or not to loop the samples. The sample output rate is set by the device-level analog_waveform_data_interval parameter. To start and stop waveform output, use the labjack_ljm_start_analog_waveform_output and labjack_ljm_stop_analog_waveform_output actions, respectively. I’ve attached an example experiment that demonstrates the basics of outputting a periodic waveform.

As we discussed, it’s also possible to trigger the start of waveform output via an external signal. To do this, set the trigger line via the analog_waveform_trigger_line parameter.

I spoke to someone at LabJack support regarding your questions about start-up timing. In the context of an MWorks experiment, once the labjack_ljm_start_analog_waveform_output action completes, the actual output will begin within one analog_waveform_data_interval. (If you’re using a trigger to start the output, it will begin within one analog_waveform_data_interval after a rising edge is received on the trigger line.) So, if you want a latency of <=1ms between completion of the “start” command and the actual beginning of output, you’ll need to set analog_waveform_data_interval to 1ms or less.

I hope that all makes sense. If you have any questions or run in to any issues, please let me know!

Thanks,
Chris
analog_waveform_example.zip (1.2 KB)

Amazing! This makes our life enormously easier. It will take me a month or two to write the code to convert this over and test it. Will keep you posted.

Mark