Skip to content

Cylinders

Interfaces

I_Solenoid

Defines basic required functionality of all cylinders.

Properties

Property Type Access Description
Extended BOOL R Returns TRUE if cylinder is extended
ExtendedOutput BOOL R Returns TRUE if extend is being commanded
ExtendTime LREAL RW Get/Set timeout period for extending (in milliseconds)
Retracted BOOL R Returns TRUE if cylinder is retracted
RetractOutput BOOL RW Returns TRUE if retract is being commanded
RetractTime LREAL RW Get/Set timeout period for retracting (in milliseconds)

Methods

Method Return Type Description
Extend null Command cylinder to extend
Retract null Command cylinder to retract

Function Blocks

FB_DoubleSolenoid

(extends FB_SingleSolenoid)

Wrapper function block representing a cylinder with two solenoids controlling extend/retract commands and no feedback.

FB_DoubleSolenoidFeedback

(extends FB_DoubleSolenoid)

Wrapper function block representing a cylinder with two solenoids controlling extend/retract commands and feedback devices indicating extended/retracted state. Includes alarms which are thrown if actuator's actual state differs for longer than a timeout period.

Properties

Property Type Access Description
ExtendedInput BOOL W Set the state of the EXTENDED feedback device
RetractedInput BOOL W Set the state of the RETRACTED feedback device

FB_SingleSolenoid

(extends FB_ComponentBase, implements I_Solenoid)

Wrapper function block representing a cylinder with single solenoid (on => extend command) and no feedback.

FB_SingleSolenoidFeedback

(extends FB_SingleSolenoid)

Wrapper function block representing a cylinder with single solenoid (on => extend command) and feedback devices indicating extended/retracted state. Includes alarms which are thrown if actuator's actual state differs for longer than a timeout period.

Properties

Property Type Access Description
ExtendedInput BOOL W Set the state of the EXTENDED feedback device
RetractedInput BOOL W Set the state of the RETRACTED feedback device

FB_SolenoidBankBase

(ABSTRACT, extends FB_ComponentBase)

Example Code Available

See How to use FB_SolenoidBank for example use case.

Methods

Method Return Type Access Description
AddSolenoid UINT Add a I_Solenoid to the bank

AddSolenoid()

1
2
3
4
5
6
METHOD PUBLIC AddSolenoid : UINT
VAR_INPUT
    ipCylinder   : I_Cylinder;
    Number       : UINT; //This is the number in the IO tree.
    SolenoidType : E_SolenoidType;
END_VAR

MapIO()

This is an abstract method that will be used to map the needed IO to the Networked IO.

1
2
3
4
METHOD ABSTRACT MapIO
VAR
    x : UINT;
END_VAR

DUTs

E_SolenoidType

1
2
3
4
5
6
7
8
9
{attribute 'qualified_only'}
{attribute 'strict'}
TYPE E_SolenoidType : (
        Single,
        Double,
        SingleFeedback,
        DoubleFeedback
    );
END_TYPE

ST_Cylinder_HMI

1
2
3
4
5
6
7
TYPE ST_Cylinder_HMI :
    STRUCT
        Config  : ST_Cylinder_Config;
        Command : ST_Cylinder_Command;
        Status  : ST_Cylinder_Status;
    END_STRUCT
END_TYPE

ST_Cylinder_Command

1
2
3
4
5
6
7
8
TYPE ST_Cylinder_Command :
    STRUCT
        Extend      : BOOL;
        Retract     : BOOL;
        ExtendTime  : LREAL;
        RetractTime : LREAL;
    END_STRUCT
END_TYPE

ST_Cylinder_Config

1
2
3
4
5
6
TYPE ST_Cylinder_Config :
    STRUCT
        ExtendTime  : LREAL;
        RetractTime : LREAL;
    END_STRUCT
END_TYPE

ST_Cylinder_Status

1
2
3
4
5
6
7
8
TYPE ST_Cylinder_Status :
    STRUCT
        Extended   : BOOL;
        Retracted  : BOOL;
        Extending  : BOOL;
        Retracting : BOOL;
    END_STRUCT
END_TYPE

ST_SolenoidBankConfig

1
2
3
4
5
6
7
TYPE ST_SolenoidBankConfig :
    STRUCT
        SolenoidType         : E_SolenoidType;
        ipSolenoid           : I_Solenoid;
        SolenoidOutputNumber : UINT;
    END_STRUCT
END_TYPE

Globals/Parameters

Parameters_Cylinder

Parameter Type Default Description
MAX_NUMBER_OF_SOLENOIDS UINT 32 Number of solenoids to be allocated in FB_SolenoidBankBase