Sample Program 13: Reading The Bic From The Coe - Beckhoff EPP3504-0023 Short Manual

4-channel measuring bridge,(sg) full/half/quarter bridge, 24 bit, 10 ksps
Hide thumbs Also See for EPP3504-0023:
Table of Contents

Advertisement

Commissioning
memset(ADR(anSigDataOutCalc), 16#FF, GVL_CoE.nSigLen);
memcpy(ADR(anSigDataOutCalc), ADR(nCrc), 2); // <- Dependant be the type of encryption
// =================================================
4.3.12
Sample program 13: Reading the BIC from the CoE
The Beckhoff Identification Code (BIC) is used for the unambiguous visual and electronic identification of
Beckhoff products and was introduced continually into the ongoing device production from 2020 onwards.
Refer also to the introductions in the chapter "Version identification of EtherCAT devices"/"Beckhoff
Identification Code (BIC)" [} 10]Beckhoff Identification Code (BIC) [} 10]. The BIC contains several
components, in particular the unambiguous BTN.
The BIC is also stored electronically in the ESI EPROM in all Beckhoff EtherCAT devices and can be read
there by the EtherCAT Master (e.g. TwinCAT). A reading function is available for this in the TC3 EtherCAT
lib from 2020 onwards.
Some of these EtherCAT devices are so-called intelligent slaves with a local microcontroller, which offers a
so-called CoE directory for parameterization. The BIC can be mapped there by the firmware in index 0x10E2
for reading. In the course of continuous product maintenance, this function is gradually being introduced into
the EtherCAT devices.
The function block described here, for example, reads all entries from the CoE object 0x10E2 and copies
them into a structure variable field "patManFactSpecIdCode" provided for the purpose. In the first step, the
function block reads the number of stored BIC entries and in the second step the individual data sets.
Note about the modular devices: if several sub-devices with so-called sub-BICs to be identified are installed
in an EtherCAT device, 0x10E2:1 bears the BIC of the main device, while the BICs of the sub-devices are
located in the subsequent indices.
Function block FB_GET_BIC
This function block is intended for an environment of a TwinCAT 3 project; i.e. a project must first be present
or created. See further explanations within chapter "Sample programs"/" Preparation to start the sample
program (tpzip file/ TwinCAT 3)" [} 85].
The declarations of the function block are as follows:
Inputs:
    userNetId            : T_AmsNetId; // NetId of EtherCAT device to be read
    userSlaveAddr        : UINT;   // Address of EtherCAT device to be read
    bExecute             : BOOL;   // Execute fb by rising edge
Outputs:
    bDone                : BOOL;   // TRUE = FB Execution done
   nNumOfSubIndizies     : BYTE;   // Number of read BICs via Sub-Ids
   // Array with struct of BIC entries:
    patManFactSpecIdCode :
      ARRAY[0..nMAXINDEXSUBINDIZES] OF POINTER TO T_MAN_FACT_SPEC_ID_CODE; // BICs data
    bError               : BOOL;
The function block is executed with a rising edge at the input "bExecute". The EtherCAT address
"userSlaveAddr" of the box module and the "userNetId" are to be transferred. Successful execution is
indicated by "bDone" (TRUE = successfully executed). After successful execution, the entries from the CoE
object 0x10E2 exist in the pointer field "patManFactSpecIdCode". The number of read entries is given by
"nNumOfSubIndizies". The following figure shows a filled structure with test data:
116
Version: 1.2
EPP3504-0023

Advertisement

Table of Contents
loading

Table of Contents