FB_CXSetTextDisplayUSB

The function block is used for the CX2100 and for the EL6090 terminal. When the function block is called, only the matching NetID and port number for the respective device has to be allocated.

 

nPort:

sNetID

CX2100

Is displayed in TwinCAT on the ESB device tab.

Is the NetID of the PC or is left blank (‘ ‘).

EL6090

Is the EtherCAT address of the terminal

Is the EtherCAT address of the EtherCAT master.

FB_CXSetTextDisplayUSB 1:

The function block FB_CXSetTextDisplayUSB is used to write and delete messages on the two-line display. The cursor is controlled on the display by switching it on and off or by making it flash. The function block is also used to switch the backlight on or off.

FB_CXSetTextDisplayUSB 2: Inputs

VAR_INPUT
     bExecute     : BOOL;
     sNetID       : T_AmsNetID;
     nPort        : T_AmsPort;
     eMode        : E_CX2100_DisplayModesWr;
     sLine1       : STRING(80);
     sLine2       : STRING(80);
     nCursorPosX  : USINT;
     nCursorPosy  : USINT;
END_VAR

Name

Type

Description

bExecute

BOOL

The command is executed with a rising edge.

sNetID

T_AmsNetID

AMSNetID of the device

nPort

T_AmsPort

AmsPort of the device

eMode

E_CX2100_DisplayModesRd

Mode switching

sLine1

STRING

String with 80 characters. This string is displayed with the corresponding command in the first line. For strings with more than 16 characters, the text is displayed as scrolling text.

sLine2

STRING

String with 80 characters. This string is displayed with the corresponding command in the second line. For strings with more than 16 characters, the text is displayed as scrolling text.

nCursorPosX

USINT

Cursor position on the X axis. The string is written from this position in the display.

nCursorPosY

USINT

Cursor position on the Y axis. The string is written from this position in the display.

FB_CXSetTextDisplayUSB 3: Outputs

VAR_OUTPUT
     bBusy        : BOOL;
     bError       : BOOL;
     nErrorID     : UDINT;
END_VAR

Name

Type

Description

bBusy

BOOL

The command is in the process of being transmitted by ADS. No new command will be accepted as long as bBusy remains TRUE.

bError

BOOL

Becomes TRUE, as soon as an error occurs.

nErrorID

UDINT

Supplies the error number when the bError output is set.

E_CX2100_DisplayModesWr:

E_CX2100_DisplayModesWr : (
     eCX2100_DisplayNoActionWr := 0,
     eCX2100_CursorOn,
     eCX2100_CursorOff,
     eCX2100_CursorBlinkOn,
     eCX2100_CursorBlinkOff,
     eCX2100_BackLightOn,
     eCX2100_BackLightOff,
     eCX2100_ClearDisplay,
     eCX2100_WriteLine1,
     eCX2100_WriteLine2,
     eCX2100_WriteLines,
     eCX2100_CursorPosX,
     eCX2100_CursorPosY,
     eCX2100_CursorPosXY
;

eCX2100_DisplayNoActionWr: no action.

eCX2100_CursorOn: switch on the cursor.

eCX2100_CursorOff: switch off the cursor.

eCX2100_CursorBlinkOn: switch on the cursor blinking.

eCX2100_CursorBlinkOff: switch off the cursor blinking.

eCX2100_BackLightOn: switch on the backlight.

eCX2100_BackLightOff: switch off the backlight.

eCX2100_ClearDisplay: clear display.

eCX2100_WriteLine1: write the first line.

eCX2100_WriteLine2: write the second line.

eCX2100_WriteLines: write lines.

eCX2100_CursorPosX: cursor position on the X axis.

eCX2100_CursorPosY: cursor position on the Y axis.

eCX2100_CursorPosXY: cursor position on the XY axis.

Requirements when using the EL6090

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1

PC or CX (WES7/Win7/Win10: TC RT x86/x64, WEC6/7: TC RT x86, WEC7: TC CE7 ARMV7, TC/BSD: TC RT x64, TC OS ARMT2)

Tc2_SystemCX

Requirements when using the CX2100

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1

CX (WES7/Win7/Win10: TC RT x86/x64, WEC6/7: TC RT x86, TC/BSD: TC RT x64)

Tc2_SystemCX