mycnc:modbus_setup
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
mycnc:modbus_setup [2019/07/29 15:53] – ivan | mycnc:modbus_setup [2020/01/27 11:42] – ivan | ||
---|---|---|---|
Line 8: | Line 8: | ||
< | < | ||
- | " | + | " |
- | UNCHECKED in the Config > Technology > Mill/Lathe > Spindle | + | Config > Technology > Mill/Lathe > Spindle configuration dialog</ |
- | configuration dialog</ | + | |
{{: | {{: | ||
Line 44: | Line 43: | ||
Using the I/O Expand cards mapping window allows for a guaranteed signal delivery even if the Modbus device was turned off when the initial signal was sent (for example, when changing the Binary Outputs status from OFF to ON in the System Diagnostics window). However, a certain amount of latency (up to 100-200 ms) is introduced, as the system has to regularly loop through and check for the inputs/ | Using the I/O Expand cards mapping window allows for a guaranteed signal delivery even if the Modbus device was turned off when the initial signal was sent (for example, when changing the Binary Outputs status from OFF to ON in the System Diagnostics window). However, a certain amount of latency (up to 100-200 ms) is introduced, as the system has to regularly loop through and check for the inputs/ | ||
- | **NOTE:** The latency | + | **NOTE:** The latency |
====Using Modbus through PLC commands==== | ====Using Modbus through PLC commands==== | ||
Line 57: | Line 56: | ||
====Modbus Devices available==== | ====Modbus Devices available==== | ||
The detailed description of the available Modbus devices is located at the [[mycnc: | The detailed description of the available Modbus devices is located at the [[mycnc: | ||
+ | |||
+ | ====Sample M03 procedure for Spindle ON through Modbus==== | ||
+ | |||
+ | ++++ Expand M03 code | | ||
+ | |||
+ | < | ||
+ | #include vars.h | ||
+ | |||
+ | #define command | ||
+ | #define parameter var01 | ||
+ | |||
+ | // ======================================================================= | ||
+ | // | ||
+ | #define SPINDLE_ON_CW_VALUE | ||
+ | // ======================================================================= | ||
+ | |||
+ | main() | ||
+ | { | ||
+ | proc=plc_proc_spindle; | ||
+ | |||
+ | timer=0; | ||
+ | val=eparam; | ||
+ | |||
+ | message=PLCCMD_MODBUS_SPINDLE_CMD; | ||
+ | command=SPINDLE_ON_CW_VALUE; | ||
+ | parameter=SPINDLE_ON_CW_VALUE; | ||
+ | timer=10; do{timer--; | ||
+ | |||
+ | message=PLCCMD_MODBUS_SPINDLE_SPEED; | ||
+ | command=val; | ||
+ | parameter=val; | ||
+ | timer=30; do { timer--; } while (timer> | ||
+ | |||
+ | |||
+ | gvarset(7370, | ||
+ | timer=10; do { timer--; } while (timer> | ||
+ | gvarset(7371, | ||
+ | timer=10; do { timer--; } while (timer> | ||
+ | |||
+ | //delay after spindle started | ||
+ | timeout=timer+spindle_on_delay; | ||
+ | do{timer++; | ||
+ | |||
+ | exit(99); | ||
+ | }; </ | ||
+ | |||
+ | ++++ | ||
+ | |||
+ | This M03 procedure can be found by going into Settings > Config > PLC > Hardware PLC Templates > Mill (Modbus): Spindle CW Turn-ON. | ||
+ | |||
+ | * As can be seen in the sample code, the '' | ||
+ | |||
+ | {{: | ||
mycnc/modbus_setup.txt · Last modified: 2020/07/03 11:26 by ivan