Home > Resources > Example Programs > Binary Counter

Binary Counter

Description

The following program addresses the lower output bank as a group using the OL variable. A subroutine sets the Output group from a Register value, which is incremented each time the subroutine runs and then moves the motor based upon a multiple of the output group state. When the register reaches a count of 15, a subroutine will run to reset it to zero, restarting the process.

The 4-bit binary number will display on the LED bank as the device counts up.

Enter “EX 1” into the terminal to run the program. The program will automatically begin to count up in binary, while the motor will move a distance that is a multiple of that count.

This illustrates the following functions:

  • The ability to output BCD via the I/O group.
  • The ability to use and manipulate numeric data and perform operations based upon that data.

Requirements

  1. Compatible product
  2. DC power supply
  3. Communications/Network

Example program

Binary Counter 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 SEM products.

Browse our resource section and find the most useful tools and documents for all our products.