Client - Read Data (GetAllDataValues, GetDataValues)

This sample shows how to use the "GetAllDataValuesReq" and "GetDataValuesReq" methods of the client function block.

Download TwinCAT XAE Project (*.zip): Sample02.zip

The example described here uses the state machine that is described in the "General Client project structure" chapter. The States 0, 1, 11 and 100 are identical to the state machine described there. Other states were modified for the example or new states were also added.

In State 10, several IF instructions are listed that activate commands (method calls) of the Client block. The command is activated and the corresponding Client method called via a rising edge at one of the Boolean variables in the IF statement. For test purposes, the user can set the values of the Boolean variables to "TRUE" in the online view and in this way initiate the command processing.

Following the successful processing of a command, the state machine is set to State 0. If several of the Boolean variables have been set to "TRUE", the uppermost IF statement will be processed first with the respective command. The more frequent and complex the commands sent to the Server, the longer the Client will take to process them.

Some of the Boolean variables are listed in the following table. In addition, they contain the method names and a description of the function.

Commands in Sample02

Variable name

Method name

Description

bGetAllDataValues_LLN0

similar variables (commands):
bGetAllDataValues_LPHD1
bGetAllDataValues_MMXU1
bGetAllDataValues_XCBR1

GetAllDataValuesReq

As soon as this Boolean variable is set to "TRUE", all data values of all sub-elements of the Logical Node: „LLN0“ and every functional group are read. To enable this, the method call uses an interface pointer to the Logical Node to be read: "LLN0" as a parameter and the specification of the functional group: "E_AcsiFc.XX."

bGetAllDataValues_LLN0_ST

similar variables (commands):
bGetAllDataValues_LLN0_CF
bGetAllDataValues_LLN0_DC
bGetAllDataValues_LLN0_EX
bGetAllDataValues_LPHD1_ST
bGetAllDataValues_LPHD1_DC
bGetAllDataValues_MMXU1_MX
bGetAllDataValues_MMXU1_ST
bGetAllDataValues_XCBR1_ST
bGetAllDataValues_XCBR1_CO
bGetAllDataValues_XCBR1_CF

GetAllDataValuesReq

As soon as this Boolean variable is set to "TRUE", all data values of all sub-elements of the Logical Node: „LLN0“ and of the "ST" functional group are read. To enable this, the method call uses an interface pointer to the Logical Node to be read: "LLN0" as a parameter and the specification of the functional group: "E_AcsiFc.ST_".

bGetDataValues_LLN0_ST_Beh

similar variables (commands):
bGetDataValues_LLN0_ST_Health
bGetDataValues_LLN0_ST_Mod
bGetDataValues_LLN0_CF_Mod
bGetDataValues_LLN0_DC_NamPlt
bGetDataValues_LLN0_EX_NamPlt
bGetDataValues_LPHD1_ST_PhyHealth
bGetDataValues_LPHD1_ST_Proxy
bGetDataValues_LPHD1_DC_PhyNam
bGetDataValues_MMXU1_MX_PhV
bGetDataValues_MMXU1_ST_Beh
bGetDataValues_XCBR1_ST_Beh

GetDataValuesReq

As soon as this Boolean variable is set to "TRUE", all data values of all sub-elements of the data object: "Beh" of the Logical Node: „LLN0“ and of the "ST" functional group are read. To enable this, the method call uses an interface pointer to the data object to be read: "LLN0.Beh" as a parameter and the specification of the functional group: "E_AcsiFc.ST_".

bGetDataValues_LLN0_ST_Beh_stVal

similar variables (commands):
bGetDataValues_LLN0_ST_Beh_q
bGetDataValues_LLN0_ST_Beh_t
bGetDataValues_LLN0_ST_Health_q
bGetDataValues_LLN0_ST_Health_t
bGetDataValues_LLN0_ST_Mod_q
bGetDataValues_LLN0_ST_Mod_t
bGetDataValues_LLN0_CF_Mod_ctlModel
bGetDataValues_LLN0_DC_NamPlt_vendor
bGetDataValues_LLN0_DC_NamPlt_swRev

GetDataValuesReq

As soon as this Boolean variable is set to "TRUE", the value of the data attribute is read: "stVal" of the data object: "Beh", of the Logical Node: "LLN0", and of the functional group: "ST". To enable this, the method call uses an interface pointer to the data attribute to be read: "LLN0.Beh.stVal" as a parameter and the specification of the functional group: "E_AcsiFc.ST_".

The naming of the Boolean variables is only an example and can be adapted as desired. It is only intended to show which values can be read by connecting the variables.