« Close

Datasheets and User Guides

App Notes

Software & Driver

 

4.2.18 - eDAC()

An easy function that writes a value to one analog output. This is a simple alternative to the very flexible IOType based method normally used by this driver.

When needed, this function automatically enables the specified analog output.

Declaration:

LJ_ERROR _stdcall eDAC (  LJ_HANDLE Handle,
                          long Channel,
                          double Voltage,
                          long Binary,
                          long Reserved1,
                          long Reserved2)

Parameter Description:
Returns: LabJack errorcodes or 0 for no error.
Inputs:

  • Handle – Handle returned by OpenLabJack().
  • Channel – The analog output channel to write to.
  • Voltage – The voltage to write to the analog output.
  • Binary – If this is nonzero (True), the value passed for Voltage should be binary. For example, pass 32768.0 in the double parameter for mid-scale output.
  • Reserved (1&2) – Pass 0.

4 comments

is eDAC not available in the Matlab Driver for some reason?

It looks like at some iteration in our Matlab download some of the .m files for newer functions (including this one) were removed.  I just added them back and re-uploaded the file.   If you download it again from our Matlab page you should see those functions.  If you have any other problems please let us know.  Thanks for bringing this to our attention.

Just to be clear, if Channel is set to 0, and voltage is set to 3.0, DAC0 will go to 3.0 volts? Example code is always nice.

Yes that is correct.  See Section 4.3.9 and UD Programming Examples.