Chapter 12: Digital Cam Switch

A digital cam switch uses an axis' position to control a digital output, which is controlled by a switch. When the axis reaches a certain position, the switch is turned on or off. The switch can be controlled by a forward and backward movement of an axis. In this chapter, you'll learn how to set digital cam 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.

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.


Take the following steps to complete the training:

Use digital cam switch

Complete code

Additional information

Digital Cam Switch functions