User Tools

Site Tools


plc:plc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
plc:plc [2020/05/19 10:05] ivanplc:plc [2020/09/04 14:15] ivan
Line 3: Line 3:
  
 ====== PLC ====== ====== PLC ======
-PLC - programmable logic controller.+PLC stands for "Programmable Logic Controller".
  
 PLC controller can load and run small binary programs (PLC procedures). PLC procedure should be written in a simplified C-like language, compiled and stored in PLC controller memory to be ready to run. myCNC software includes [[plc:plc_builder|PLC Builder]] - tiny IDE (Integrated Development Environment) to create and modify PLC procedure source files, compile them to binary code and upload it as RomFS iso image disk to PLC controller memory. PLC controller can load and run small binary programs (PLC procedures). PLC procedure should be written in a simplified C-like language, compiled and stored in PLC controller memory to be ready to run. myCNC software includes [[plc:plc_builder|PLC Builder]] - tiny IDE (Integrated Development Environment) to create and modify PLC procedure source files, compile them to binary code and upload it as RomFS iso image disk to PLC controller memory.
Line 87: Line 87:
 It is possible to access the state of the output via gvarget commands from within the PLC process: It is possible to access the state of the output via gvarget commands from within the PLC process:
  
-<code>a= gvarget (0x400); // OUT0 +<code>a=gvarget(0x400); //OUT0 
-b= gvarget (0x407); // OUT7</code>+b=gvarget(0x407); //OUT7</code>
  
 Starting from 0x400 to represent OUT0, this is a hexadecimal system that is simple to convert to dotted decimals (through the likes of a simple reference site [[https://www.hexadecimaldictionary.com/hexadecimal/0x400/|here]]). Thus, for example, //gvarget(0x40d);// will return the state of Output #13.  Starting from 0x400 to represent OUT0, this is a hexadecimal system that is simple to convert to dotted decimals (through the likes of a simple reference site [[https://www.hexadecimaldictionary.com/hexadecimal/0x400/|here]]). Thus, for example, //gvarget(0x40d);// will return the state of Output #13. 
Line 170: Line 170:
 | <code>__HANDLER_GCODE_START</code> | The procedure executed just before the myCNC software run g-code (after pressing PLAY button) | | <code>__HANDLER_GCODE_START</code> | The procedure executed just before the myCNC software run g-code (after pressing PLAY button) |
 | <code>__HANDLER_GCODE_STOP</code> | The procedure executed just after the myCNC software finished g-code running (after pressing STOP/PAUSE button) | | <code>__HANDLER_GCODE_STOP</code> | The procedure executed just after the myCNC software finished g-code running (after pressing STOP/PAUSE button) |
 +
 +Variables used in Software PLC:
 +
 +^Variable^Use^Example^Comment^
 +| 100020 | Jog the selected axis (100020 through to 100027) | //gvarset(100020, 100);// | Negative values are not accepted, use 0-X (for example, //gvarset(100020, 0-100);//)|
 +| 100040 | Launch a Hardware PLC from within a Software PLC | //gvarset(100040, 607)//; | This will launch Hardware PLC M607 |
 +| 100041 | Eparameter to feed into the Hardware PLC being launched using 100040 | //gvarset(100041, 333);// | Used before //gvarset(100040, 607);//, this will set eparam=333 | 
  
   * [[software_plc_examples|Software PLC Examples]]   * [[software_plc_examples|Software PLC Examples]]
plc/plc.txt · Last modified: 2022/11/07 16:03 by ivan

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki