Supported platforms: CODESYS 3.5 SP19 SAFETY

How to use H-Bridge controller

This section describes how to use S_HBridgeControllerDO POU to control for example electric linear actuator.

 

This example uses the following libraries:

SafeHBridgeControl library

 

 

Depending on hardware, output group control needs to be activated before controlling outputs. See How to use S series and E series HW diagnostics for more information.

 

 

Example code

SL8X1 Safety Control Unit is used in the example.

In MultiTool Creator define two DIs which are used to request linear actuator control.

 

 

And define two DOs, which has possibility to control both pin high side and low side, for example SL8X1 pins 2.40 and 2.41.

 

 

Safe PRG:

 

 

 

Init method:

IF NOT inited THEN
    actuatorControl.Init(S_i_OverCurrentLimit:= UINT#4000,
                         S_i_CurrentDiagnosticDelay:=UINT#500 ,
                         S_i_ControlStopDelay:=UINT#500 ,
                         i_pEventCode:= ADR(actuatorEvent));
    inited := TRUE;
END_IF


See also

-

 

 

 

 

 

 

Source file HowToUseHBRidge.htm

Last updated 21-Feb-2025