Constants

In the TcSystem.lib different constants were defined.

 

Port numbers

Value

Description

AMSPORT_LOGGER

100

Port number of the standard loggers.

AMSPORT_EVENTLOG

110

Port number of the TwinCAT Eventloggers.

AMSPORT_R0_RTIME

200

Port number of the TwinCAT Realtime Servers.

AMSPORT_R0_IO

300

Port number of the TwinCAT I/O Servers.

AMSPORT_R0_NC

500

Port number of the TwinCAT NC Servers.

AMSPORT_R0_NCSAF

501

Port number of the TwinCAT NC Servers (Task SAF).

AMSPORT_R0_NCSVB

511

Port number of the TwinCAT NC Servers (Task SVB).

AMSPORT_R0_ISG

550

internal

AMSPORT_R0_CNC

600

Port number of the TwinCAT NC I Servers.

AMSPORT_R0_LINE

700

internal

AMSPORT_R0_PLC

800

Port number of the TwinCAT PLC Servers (only at the Buscontroller).

AMSPORT_R0_PLC_RTS1

801

Port number of the TwinCAT PLC Servers in the runtime 1.

AMSPORT_R0_PLC_RTS2

811

Port number of the TwinCAT PLC Servers in the runtime 2.

AMSPORT_R0_PLC_RTS3

821

Port number of the TwinCAT PLC Servers in the runtime 3.

AMSPORT_R0_PLC_RTS4

831

Port number of the TwinCAT PLC Servers in the runtime 4.

AMSPORT_R0_CAM

900

Port number of the TwinCAT CAM Server.

AMSPORT_R0_CAMTOOL

950

Port number of the TwinCAT CAMTOOL Server.

AMSPORT_R3_SYSSERV

10000

Port number of the TwinCAT  System Service.

AMSPORT_R3_SCOPESERVER

27110

Port number of the TwinCAT Scope Servers (since Lib. V2.0.12)

 

ADS States

Value

Description

ADSSTATE_INVALID

0

ADS Status: invalid

ADSSTATE_IDLE

1

ADS Status: idle

ADSSTATE_RESET

2

ADS Status: reset.

ADSSTATE_INIT

3

ADS Status: init

ADSSTATE_START

4

ADS Status: start

ADSSTATE_RUN

5

ADS Status: run

ADSSTATE_STOP

6

ADS Status: stop

ADSSTATE_SAVECFG

7

ADS Status: save configuration

ADSSTATE_LOADCFG

8

ADS Status: load configuration

ADSSTATE_POWERFAILURE

9

ADS Status: Power failure

ADSSTATE_POWERGOOD

10

ADS Status: Power good

ADSSTATE_ERROR

11

ADS Status: Error

ADSSTATE_SHUTDOWN

12

ADS Status: Shutdown

ADSSTATE_SUSPEND

13

ADS Status: Suspend

ADSSTATE_RESUME

14

ADS Status: Resume

ADSSTATE_CONFIG

15

ADS Status: Configuration

ADSSTATE_RECONFIG

16

ADS Status: Reconfiguration

ADSSTATE_MAXSTATES

17

 


 

Reserved Index Groups

Value

Description

ADSIGRP_SYMTAB

16#F000

 

ADSIGRP_SYMNAME

16#F001

 

ADSIGRP_SYMVAL

16#F002

 

ADSIGRP_SYM_HNDBYNAME

16#F003

 

ADSIGRP_SYM_VALBYNAME

16#F004

 

ADSIGRP_SYM_VALBYHND

16#F005

 

ADSIGRP_SYM_RELEASEHND

16#F006

 

ADSIGRP_SYM_INFOBYNAME

16#F007

 

ADSIGRP_SYM_VERSION

16#F008

 

ADSIGRP_SYM_INFOBYNAMEEX

16#F009

 

ADSIGRP_SYM_DOWNLOAD

16#F00A

 

ADSIGRP_SYM_UPLOAD

16#F00B

 

ADSIGRP_SYM_UPLOADINFO

16#F00C

 

ADSIGRP_SYMNOTE

16#F010

 

ADSIGRP_IOIMAGE_RWIB

16#F020

 

ADSIGRP_IOIMAGE_RWIX

16#F021

 

ADSIGRP_IOIMAGE_RISIZE

16#F025

 

ADSIGRP_IOIMAGE_RWOB

16#F030

 

ADSIGRP_IOIMAGE_RWOX

16#F031

 

ADSIGRP_IOIMAGE_RWOSIZE

16#F035

 

ADSIGRP_IOIMAGE_CLEARI

16#F040

 

ADSIGRP_IOIMAGE_CLEARO

16#F050

 

ADSIGRP_IOIMAGE_RWIOB

16#F060

 

ADSIGRP_DEVICE_DATA

16#F100

 

ADSIOFFS_DEVDATA_ADSSTATE

16#0000

 

ADSIOFFS_DEVDATA_DEVSTATE

16#0002

 

 

System Service Index Groups

Value

Description

SYSTEMSERVICE_OPENCREATE

100

 

SYSTEMSERVICE_OPENREAD

101

 

SYSTEMSERVICE_OPENWRITE

102

 

SYSTEMSERVICE_CREATEFILE

110

 

SYSTEMSERVICE_CLOSEHANDLE

111

 

SYSTEMSERVICE_FOPEN

120

 

SYSTEMSERVICE_FCLOSE

121

 

SYSTEMSERVICE_FREAD

122

 

SYSTEMSERVICE_FWRITE

123

 

SYSTEMSERVICE_FSEEK

124

 

SYSTEMSERVICE_FTELL

125

 

SYSTEMSERVICE_FGETS

126

 

SYSTEMSERVICE_FPUTS

127

 

SYSTEMSERVICE_FSCANF

128

 

SYSTEMSERVICE_FPRINTF

129

 

SYSTEMSERVICE_FEOF

130

 

SYSTEMSERVICE_FDELETE

131

 

SYSTEMSERVICE_FRENAME

132

 

SYSTEMSERVICE_REG_HKEYLOCALMACHINE

200

 

SYSTEMSERVICE_SENDEMAIL

300

 

SYSTEMSERVICE_TIMESERVICES

400

 

SYSTEMSERVICE_STARTPROCESS

500

 

SYSTEMSERVICE_CHANGENETID

600

 


 

System Service Index Offsets (Timeservices)

Value

Description

TIMESERVICE_DATEANDTIME

1

 

TIMESERVICE_SYSTEMTIMES

2

 

TIMESERVICE_RTCTIMEDIFF

3

 

TIMESERVICE_ADJUSTTIMETORTC

4

 


 

Masks for Log output

Value

Description

ADSLOG_MSGTYPE_HINT

16#01

 

ADSLOG_MSGTYPE_WARN

16#02

 

ADSLOG_MSGTYPE_ERROR

16#04

 

ADSLOG_MSGTYPE_LOG

16#10

 

ADSLOG_MSGTYPE_MSGBOX

16#20

 

ADSLOG_MSGTYPE_RESOURCE

16#40

 

ADSLOG_MSGTYPE_STRING

16#80

 


Masks for Bootdata-Flags

Value

Description

BOOTDATAFLAGS_RETAIN_LOADED

16#01

 

BOOTDATAFLAGS_RETAIN_INVALID

16#02

 

BOOTDATAFLAGS_RETAIN_REQUESTED

16#04

 

BOOTDATAFLAGS_PERSISTENT_LOADED

16#10

 

BOOTDATAFLAGS_PERSISTENT_INVALID

16#20

 


 

Masks for BSOD-Flags

Value

Description

SYSTEMSTATEFLAGS_BSOD

16#01

BSOD: Blue Screen of Death

SYSTEMSTATEFLAGS_RTVIOLATION

16#02

Realtime violation, latency time overrun

 

Masks for File output

Value

Description

FOPEN_MODEREAD

16#0001

'r': Opens file for reading

FOPEN_MODEWRITE

16#0002

'w': Opens file for writing, (possible) existing files were overwritten.

FOPEN_MODEAPPEND

16#0004

'a': Opens file for writing, is attached to (possible) exisiting files.

If no file exists, it will be created.

FOPEN_MODEPLUS

16#0008

'+': Opens a file for reading and writing.

FOPEN_MODEBINARY

16#0010

'b': Opens a file for binary reading and writing.

FOPEN_MODETEXT

16#0020

't': Opens a file for textual reading and writing.

 

Masks for Eventlogger Flags

Value

Description

TCEVENTFLAG_PRIOCLASS

16#0010

Class and priority are defined by the formatter.

TCEVENTFLAG_FMTSELF

16#0020

The formatting information comes with the event

TCEVENTFLAG_LOG

16#0040

Logg.

TCEVENTFLAG_MSGBOX

16#0080

Show message box .

TCEVENTFLAG_SRCID

16#0100

Use Source-Id instead of Source name.


TwinCAT Eventlogger Status messages

Value

Description

TCEVENTSTATE_INVALID

16#0000

Not valid, occurs also if the event was not reported.

TCEVENTSTATE_SIGNALED

16#0001

Event is reported, but neither signed off nor acknowledged.

TCEVENTSTATE_RESET

16#0002

Event is signed off ('gone').

TCEVENTSTATE_CONFIRMED

16#0010

Event is acknowledged.

TCEVENTSTATE_RESETCON

16#0012

Event is signed off  and acknowledged.


TwinCAT Eventlogger Status messages

Value

Description

TCEVENT_SRCNAMESIZE

15

Max. Length for the Source name.

TCEVENT_FMTPRGSIZE

31

Max. Length for the name of the formatters.


Other

Value

Description

PI

3.1415926535897932384626433832795

Pi number

DEFAULT_ADS_TIMEOUT

T#5s

Default ADS timeout

MAX_STRING_LENGTH

255

The max. string length of T_MaxString data type