I am trying to write a single analog value to the AoO ouput to the USB-6009 device. In my program the user will choose what the value will be set as instantaneously. I have not found any example code to give examples of this or anything close to it. I have found the "output drive type" example but it pertains to digital ouptuts.
I am using the DAQmxWriteAnalogF64 function, but it doesnt seem to be what I need exactly (I dont need an array, just a single value) but I havent found any other functions that are useful (none came with the CD included with the NI-USB-6009). As well I have found the 'NIDAQmx I/0 Controls' instrument and I have loaded it, but is there any other .fp file that I should be loading and using with more write functions than what is in NI-DAQmx LIbrary?
Here is the relevant lines of code that I have so far, no errors, but no voltage shows up on the ouput.
NIDAQmx_NewChannelAOCtrl (panelHandle, PANEL_CHANNEL_2, 1)
DAQmxCreateTask ("", &analog_task)
DAQmxCreateAOVoltageChan (analog_task, "Dev1/Ao0", "", 0, 5.0, DAQmx_Val_Volts, "");
DAQmxStartTask(analog_task);
DAQmxWriteAnalogF64 (analog_task, 1, 1, 5.0, DAQmx_Val_GroupByChannel, write_array, &samples_per_chan, 0);
with write array declared as followed static float64 write_array[1];
Is there anything wrong or missing with the above code?
It should be noted as well that I am able to get output when i create a task in the Measurement & Automation Explorer on the same port.
Thanks in advance