Sample program 8 (diagnosis messages)

Download TwinCAT 3 project: Programlink

Note on loading the program: Preparation to start the sample program (tpzip file/ TwinCAT 3)

Program description

This sample program reads several CoE Objects of the box module and yet 0x10F3 „Diagnosis History“ that contains user specific diagnosis data:
Diagnosis message No.01...16 (0x10F3:06...0x10F3:15). Format of a message (consider little endian):

[dddd cccc ffff mmmm tttttttttttttttt pppp(i) kk(i)]

dddd = DiagCode: z.B. (00 E0): 0xE000 standard Beckhoff Message

cccc = ProductCode (21 50): 0x5021 = Code for ELM

ffff = Flags, amongst others indication of the number (i) of parameters (pppp kk) to be given.
E.g. (02 00) = 0x0002; bit 4 is set, when not in DC operation

mmmm = Message ID – respective text can be found here: basic principles of diag messages

tttttttttttttttt = TimeStamp

pppp(i) = Datatype of the parameters, e.g. (05 00) = 0x0005 for datatype UINT8

kk(i) = parameter value

e.g. 2 x UINT8 parameters as indicated by ffff (Flags), with values 0x3C and 0x89
= “05003C050089“

The further procedure is described in section TwinCAT Quickstart, TwinCAT 3, Starting the controller.