ePut LabJack.LabJackUD.IO.PUT_ANALOG_ENABLE_PORT ? | LabJack
 

ePut LabJack.LabJackUD.IO.PUT_ANALOG_ENABLE_PORT ?

2 posts / 0 new
Last post
bill.connelly
bill.connelly's picture
ePut LabJack.LabJackUD.IO.PUT_ANALOG_ENABLE_PORT ?

Hi guys,

I've been working my way through the matlab example code, and I'm pretty confident I understand most of it. However, there is one line that I don't get, and seeing as I'm going to be doing lots of analog writing, I wanted to be sure.

What is this line doing?

ljudObj.ePut(ljhandle, LabJack.LabJackUD.IO.PUT_ANALOG_ENABLE_PORT, 0, 15, int32(16));

It seems like it should be enabling analog ports. However, I seem to be quite happily writing to AIN1 and AIN0 without including that line.

So, to check my understand. The last input argument says we're updating every channel. And the '15' codes for b0000000000001111, meaning we are setting the first 4 ports as analog (and hence I would put in 9 if I wanted channel 0 and 4?). The zero is just a dummy argument

The reason this isn't necessary when I'm reading fro AIN0 and AIN1 is because they are dedicated DAC.

Is this all correct?

Thanks

LabJack Support
labjack support's picture
Everything you described

Everything you described sounds right to me.  Some comments:

You are talking about analog inputs, not analog outputs, so we would say you are doing "analog reading" and that AIN0-AIN3 are "dedicated ADCs".

The first 4 bits of ANALOG_ENABLE are mostly ignored on the HV version of the U3, because AIN0-AIN3 are always analog input.  They can't do digital.  That is why you can do analog reads of 0-3 without first making a configuration call.

See Section 4.3.2 for more on ANALOG_ENABLE.