Chapter 12: Digital Switch

A digital switch uses an axis' position or a group's travel distance to control a digital output. When an axis reaches a certain position or a group travels some distance, a switch is turned on or off. The switch can be controlled by a forward and backward movement of an axis or a group. In this chapter, you'll learn how to set digital switches and use them to control digital outputs.

Time compensation and hysteresis

Time compensation is a period of time for a switch to be turned on or off earlier or later than the switching point. There are two time compensation: OnCompensation and OffCompensation. Hysteresis is a range in which a switch won't be turned on or off.

Time compensation is not applicable to cyclic switches.

Add a header and .cpp file

You need to add a header and a .cpp file to learn the code of this chapter. The steps of adding them are written in Chapter 2 > Add a header and .cpp file.

Tutorial

Take the following steps to complete the training:

Complete code

Additional information

Digital Switch functions