===== Spindle Speed control through +\-10V DAC channel (ET10) ===== ET10 control board contains 6 channel +\-10V 12bits DAC outputs. The outputs normally controlled through PID and used for closed-loop analogue servo drivers control. However if PID is disabled, +\-10V DAC output can be used as general purpose DAC. Output level of DAC output can be controlled through "DAC Offset" register. ET10BB breakout board contains inverted operational amplifier, so zero (0) value in "DAC Offset" register corresponds to +10V output voltage level, maximum value (0x3ff) corresponds to -10V voltage level. There are number of ways to access to DAC Offset register. === PLC controller (Hardware) === !!!! [[mycnc:closed_loop_configuration#analogue_-10v10v_outputs_test_mode|Please check if the DACs are not in the test mode before using.]] !!! DAC offset register is mapped to address 0x32 of [[mycnc:extern_variables|Extern CNC Variables]] Area. #define EXT_ET5_DAC_OFFSET 0x32 16 bits value should be written to this register. low 12 bits is DAC value to be written high 4 bits is DAC channel Message PLCCMD_SET_CNC_EXTVAR should be sent to myCNC control core from PLC to get access [[mycnc:extern_variables|Extern CNC Variables]], then 2 ms delay should be initiated to push the message from PLC to myCNC Core. #define PLCCMD_SET_CNC_EXTVAR 1020 Check DAC Voltage programming PLC code example dac_value=555; //DAC value to be sent message=PLCCMD_SET_CNC_EXTVAR; //setup message variable to PLC-to-CORE command command=0x32;//EXT_ET5_DAC_OFFSET //setup command register (var00) for DAC register access parameter=dac_value+(2<<12); //setup parameter register (var01), DAC channel is #2 texit=timer+2;do{timer++;}while(timer Another examples with +\-10V DAC programming can be found here - [[plc:plc_examples#M03,_Spindle_On,_Relay_and_ET10_DAC|M03.plc]], [[plc:plc_examples#Spindle_Speed_Control_for_ET10_DAC| SPN.plc]] == Configuration dialogs == Settings->Cfg->Hardware->Analogue Closed Loop Dialog. Each DAC outputs can be accessed by changing values in "DAC Offset" spinboxes. {{doc-mycnc-dac-offset.png}}