plc:m88_m89_stop_motion_from_plc_if_input_pin_activated
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
plc:m88_m89_stop_motion_from_plc_if_input_pin_activated [2018/09/25 11:21] – created skirillov | plc:m88_m89_stop_motion_from_plc_if_input_pin_activated [2018/09/25 13:14] – skirillov | ||
---|---|---|---|
Line 1: | Line 1: | ||
===== M88, M89 PLC procedures. Stop Motion if Input pin activated ===== | ===== M88, M89 PLC procedures. Stop Motion if Input pin activated ===== | ||
+ | |||
+ | |||
+ | One of the most popular job for the PLC procedure is moving to given direction till input pin triggered. | ||
+ | |||
+ | It's used in | ||
+ | * Homing procedures, | ||
+ | * Probing, | ||
+ | * Tool Length measure | ||
+ | * Surface measure | ||
+ | * Gantry Alignment procedure | ||
+ | * and many others | ||
+ | |||
+ | This procedure can be handled in Hardware PLC. We offer M88 and M89 PLC procedures which do this job as a standard procedure. However, it can be customized easily according to customer needs. | ||
+ | |||
+ | |||
+ | <code C M88.plc> | ||
+ | //Watch on given sensor number, Soft Stop if sensor triggered | ||
+ | //used for homing, surface measure, tool length measure etc | ||
+ | |||
+ | main () | ||
+ | { | ||
+ | |||
+ | input=eparam& | ||
+ | state=eparam>> | ||
+ | timer=0; | ||
+ | |||
+ | message=PLCCMD_MOTION_CONTINUE; | ||
+ | timer=30; | ||
+ | |||
+ | ready=0; | ||
+ | |||
+ | do { | ||
+ | a=portget(input); | ||
+ | if (state==0) | ||
+ | { | ||
+ | if (a==0) {ready=1;}; | ||
+ | }; | ||
+ | if (state!=0) | ||
+ | { | ||
+ | if (a!=0) {ready=1;}; | ||
+ | }; | ||
+ | }while(ready==0); | ||
+ | |||
+ | message=PLCCMD_MOTION_SOFT_SKIP; | ||
+ | timer=30; | ||
+ | |||
+ | exit(99); | ||
+ | }; | ||
+ | </ | ||
plc/m88_m89_stop_motion_from_plc_if_input_pin_activated.txt · Last modified: 2021/01/13 12:52 by ivan