LPTSIGNAL

LPTSIGNAL 1:

 

This function sets a defined output bit in a Centronics interface to a logical high or low level, and can, for example, be used for run-time measurements with an oscilloscope. The function returns the preset state which has been written to the output pin.

FUNCTION LPTSIGNAL: BOOL

VAR_INPUT
    PortAddr    :UINT;
    PinNo       :INT;
    OnOff       :BOOL;
END_VAR

PortAddr: Address of the port which is available for the desired LPT interface;

PinNo: Contains the number of the pin (Pin 0 .. 7 ) which is to be written by the PLC;

OnOff: Contains the state which is to be written to that pin;                                                             

 

Example of calling the function in FBD:

LPTSIGNAL 2:

In the example, bit 7 of port 378 (hex) is set to 1.

Requirements

Development environment

Target system type

PLC libraries to include

TwinCAT v2.7.0

PC or CX (x86)

PLCSystem.Lib

TwinCAT v2.8.0

PC or CX (x86)

TcSystem.Lib

TwinCAT v2.10.0 Build >= 1301

CX (ARM)

TcSystem.Lib