I have tried to modify the sample file U3_simplestream.m for my application. I want to turn on DAC0 with a 5V output to power a sensor (takes just a few mAmps). After executing the command "ljudObj.OpenLabJack(..." I execute the following:
ljudObj.AddRequest(ljhandle, LabJack.LabJackUD.IO.PUT_DAC, 0, 5, 0, 0);
It works, my sensor powers on and I can see the data is being collected when the loop executes: disp(['First scan = ' num2str(adblData(1)) ', ' num2str(adblData(2))])
At the end of my scan I want to turn off the DAC0 output. I use:
ljudObj.AddRequest(ljhandle, LabJack.LabJackUD.IO.PUT_DAC, 0, 0, 0, 0);
I have tried this before executing the STOP_STREAM command, after the STOP_STREAM command but still in the TRY block, and after the TRY block. In all instances Matlab crashes and I have to reboot the computer to get it to run again.
Am I doing something wrong with the command to set DAC0 to 0 volt output?
Unrelated follow up question: my data is collected in a .Net Structure.Double. I know knothing about .Net. Is there some way to cast that into a Matlab variable? I am resorting to brute force by looping through each data point and putting it into a Matlab array that I can work with.