1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | 'MDRIVE DEMO PROGRAM 'Last modified 08/25/2016 'Sample test program for demonstration purposes only 'Not tested or verified for safety or any function CP 'preclear program memory 'If THEN Sample 'CODE DESCRIPTION PG 100 'Enter program mode at address 100 LB SU 'Label using SU to start program 'upon power up S1=0,1 'Sets I/O 1 as a general purpose 'input, active high LB M1 'Label to begin motion profile 1 MR 200000 'Move relative 200000 steps H 'Hold until motion is complete BR M1, I1=1 'If input is true then branch to 'label M1 LB M2 'Label to begin motion profile 2 MR -100000 'Move relative 100000 steps H 'Hold until motion is complete BR M1, I1=1 'If input is true then brance to 'label M1 BR M2 'Unconditional branch to label M2 E 'End program PG 'Exit program mode |
Home > Resources > Example Programs > If-Then Sample
If-Then Sample
Description
This program demonstrates the use of the program branch function to perform if-then logic operations using inputs. Requirements:
- Compatible product
- DC power supply
- Communications/Network
- Switch connected to I/O point 1
- Motor, if using an MForce
Requirements
Example program
When it comes to your form, fit and function requirements, don’t settle. Get precisely what you need working with us. We know motion.
Contact us with any questions about how we can help you with your motion application or for assistance with your IMS products.
Browse our resource section and find the most useful tools and documents for all our products.