Data structure strBX5200_Set

The DeviceNet-specific blocks allow the setting of the DeviceNet-specific parameters in the default configuration of the BX5200 or BC5250. Thus the length of the I/O data, the baud rate, the ERP (Expected Racket Rate) and the transmission mode can be set from the local PLC project. The block is not required for the TwinCAT configuration, as in this case the settings are created via the System Manager.

BXBC52x0_Settings

Data structure strBX5200_Set 1:
Function block BXBC52x0_Settings

Function block BXBC52x0_Settings

VAR_INPUT

bWriteSet         :BOOL;
bReadSet          :BOOL;
strDeviceNet_Set  :DeviceNet_Set;

Key

bWriteSet: Rising edge starts the block and reads/writes the parameters if these have changed. The Bus Coupler must then be restarted. The user is notified if/when the bReboot_Necessary flag is set.
bReadSet: Positive edge reads the set DeviceNet parameters.
strDeviceNet_Set: Data structure for the DeviceNet slave interface.

VAR_OUTPUT

bBusy               :BOOL;
bError              :BOOL;
iErrorId            :WORD;
strDeviceNet        :DeviceNet_Setting;
bReboot_Necessary   :BOOL;

Key

bBusy: The block is active as long as it is TRUE.
bError: Error bit.
iErrorId: Error number.
strDeviceNet: The type, the firmware and the DeviceNet slave parameters are output here.
bReboot_Necessary: If this bit is TRUE after the bBusy is set to FALSE, then the BC/BX52x0 must be restarted so that the DeviceNet settings are saved.

Data structure strBX5200_Set

The settings for the DeviceNet slave interfaces are transferred with the following data structure.

TYPE ST_COMConfig:
STRUCT 
   iInputData        :INT; (*BX5200: 0..255/BC5250 0..127*) )1
   iOutputData       :INT; (*BX5200: 0..255/BC5250 0..127*) )1
   E_Mode            :ENUM;(*0-polling,1-bit-strobe, 2-change of state, 3-cycle*)
   iERP              :INT; (*100ms, ERP*4=Watchdog*)
   E_BaudRate        :ENUM;(*0-125kBaud, 1-250kBaud, 2-500kBaud, 3-AutoBaud*)
END_STRUCT
END_TYPE
)1 If the DN mode is only 8 Byte In and 8 Byte Output allowed. That is fix and you can´t change it.

Key

iInputData: Number of input data (from the point of view of the BX). Size in bytes [BX5200: 0..255 bytes, BC5250: 0..127 bytes]
iOutputData: Number of output data (from the point of view of the BX). Size in bytes [BX5200: 0..255 bytes, BC5250: 0..127 bytes]
E_Mode: DeviceNet Mode
iERP: Expected Racket Rate. This value multiplied by 4 results in the watchdog
E_BaudRate: DeviceNet Baudrate

iErrorId

Return parameter iErrorId

Meaning

0

no Error

-1

Wrong BX or BC Typ

-2

Wrong firmware version (BC5250 Version 5 or higher, BX5200 110 or higher)

0x1000_xxxx

xxxx ADS Error Code (see ADS Return Code)