void dacOut (u8 dacId, u8 dacCh, u16 daValue)
dacId : The ID of the DA Output Module (0 ~ 9) |
dacCh: The channel on the DA Output Module (1 ~ 2) |
daValue: The output magnitude (0 ~ 60,000) |
Sets the output of the digital-to-analog converter (DAC) on DA Voltage Output Module dacId, channel dacCh. daValue is the magnitude of the output voltage represented as a number between 0 and 60,000.
Up to 10 DA Voltage Output Modules can be installed in a single system providing a total of 20 DA output channels.
daValue corresponds linearly to the output voltage (0 ~ 10V, dipswitch OFF / 0 ~ 5V dipswitch ON).
Output load should be at least 1Kohm.
The following sample program slowly increases the voltage from 0 to 10V, 1V at a time.
#include "moacon500.h" void cmain(void) { while(1) //Run forever { u16 v = 0; for(v = 0; v<60000; v+=6000) //Increase by 1V(6000) until 10V(60000) { dacOut(0,2,v); //Set output voltage delay(1000); //Wait for 1 second } } }