plc:plc
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
plc:plc [2019/10/18 11:27] – ivan | plc:plc [2020/09/04 14:15] – ivan | ||
---|---|---|---|
Line 3: | Line 3: | ||
====== PLC ====== | ====== PLC ====== | ||
- | PLC - programmable logic controller. | + | PLC stands for " |
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 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: | ||
Line 32: | Line 32: | ||
=== PLC Language === | === PLC Language === | ||
- | * PLC operates with 32 bits integer values only. Floating point operations don't work in PLC. | + | * PLC operates with 32 bits integer values only. Floating point operations don't work in PLC (typically need to use coefficient conversions to allow for more granular control). |
* There is no need to declare variables. There is very limited space of 32 elements for variables. | * There is no need to declare variables. There is very limited space of 32 elements for variables. | ||
* There a number of pre-defined variables in the PLC | * There a number of pre-defined variables in the PLC | ||
- | * eparam - External Parameter variable. A short manual | + | * eparam - External Parameter variable. A short manual is available here: [[plc: |
* **proc** - variable is used to identify a process running in the PLC. \\ The value is sent to the CNC control software and can be used to display Current PLC state (like Idle, Ignition (for plasma cutting), preheat (gas cutting), Tool change, Probing etc) | * **proc** - variable is used to identify a process running in the PLC. \\ The value is sent to the CNC control software and can be used to display Current PLC state (like Idle, Ignition (for plasma cutting), preheat (gas cutting), Tool change, Probing etc) | ||
* **timer** - value can be used as time counter inside PLC procedure | * **timer** - value can be used as time counter inside PLC procedure | ||
Line 84: | Line 84: | ||
^ Address ^ Description ^ | ^ Address ^ Description ^ | ||
| 20000...20100 | Print variable value in myCNC control message widget for debugging purpose. Values written to this registers will be printed in myCNC control software in Message widget {{mycnc: | | 20000...20100 | Print variable value in myCNC control message widget for debugging purpose. Values written to this registers will be printed in myCNC control software in Message widget {{mycnc: | ||
+ | |||
+ | It is possible to access the state of the output via gvarget commands from within the PLC process: | ||
+ | |||
+ | < | ||
+ | b=gvarget(0x407); | ||
+ | |||
+ | 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:// | ||
+ | |||
=== The hardware access registers === | === The hardware access registers === | ||
Line 162: | Line 170: | ||
| < | | < | ||
| < | | < | ||
+ | |||
+ | Variables used in Software PLC: | ||
+ | |||
+ | ^Variable^Use^Example^Comment^ | ||
+ | | 100020 | Jog the selected axis (100020 through to 100027) | // | ||
+ | | 100040 | Launch a Hardware PLC from within a Software PLC | // | ||
+ | | 100041 | Eparameter to feed into the Hardware PLC being launched using 100040 | // | ||
* [[software_plc_examples|Software PLC Examples]] | * [[software_plc_examples|Software PLC Examples]] |
plc/plc.txt · Last modified: 2022/11/07 16:03 by ivan