plc:m07_mist_coolant_on
Differences
This shows you the differences between two versions of the page.
Next revisionBoth sides next revision | |||
plc:m07_mist_coolant_on [2017/07/13 23:53] – created skirillov | plc:m07_mist_coolant_on [2017/07/13 23:54] – skirillov | ||
---|---|---|---|
Line 37: | Line 37: | ||
- | |||
- | |||
- | |||
- | |||
- | === Spindle Speed control for ET10_DAC === | ||
- | <code c SPN.plc> | ||
- | #define command | ||
- | #define parameter | ||
- | //set Spindle speed control via ET10 DAC channel #1 | ||
- | //Spindle Speed is given in **eparam** register | ||
- | |||
- | main() | ||
- | { | ||
- | command=0x32; | ||
- | // | ||
- | parameter=0x800-(eparam/ | ||
- | //0x800 - is the middle of 12bits range - represents 0V | ||
- | //Eparam contains 12bits DAC value in 0V range, ET10 DAC setup in +10V...-10V range, so need to /2 | ||
- | //Encoder channel number is given in high 12 bits of 16bit word. | ||
- | |||
- | message=PLCCMD_SET_CNC_EXTVAR; | ||
- | //setup Message register with command for access to [[External CNC Variables]] | ||
- | texit=timer+2; | ||
- | //2ms delay to push the command from PLC to myCNC Core | ||
- | |||
- | |||
- | //**Set Spindle Speed** is asynchronous operation. | ||
- | //It's better to inform myCNC Software New Spindle Speed applied. | ||
- | //Send information about new Spindle Speed to myCNC Software | ||
- | message=PLCCMD_REPLY_TO_MYCNC; | ||
- | command=PLC_MESSAGE_SPINDLE_SPEED_CHANGED; | ||
- | parameter=eparam; | ||
- | timeout=timer+10; | ||
- | |||
- | gvarset(7371, | ||
- | //myCNC register #7371 contains actual Spindle Speed. | ||
- | //Another way to inform myCNC software about new Spindle Speed (to display on it DRO for example) | ||
- | |||
- | |||
- | exit(99); | ||
- | }; | ||
- | </ |
plc/m07_mist_coolant_on.txt · Last modified: 2017/10/02 15:38 by skirillov