BC9191 in Master /Slave mode

Requirements

Basic information

On delivery (default configuration) of the BC9191, the onboard I/Os have fixed addresses. The data for Ethernet communication start at the address offset 1000dec; this is a performance feature of the BC9191. This performance feature is used for the master/slave communication.

Inputs

Outputs

Bus Terminal %IB0 ...

Bus Terminal %QB0 ...

Ethernet DATA (PLC variables) %IB1000 ...(Modbus TCP/ADS-TCP/ADS-UDP)

Ethernet DATA (PLC variables) %QB1000 ...(Modbus TCP/ADS-TCP/ADS-UDP)

... %IB2047 maximum

... %QB2047 maximum

Detailed description of the TwinCAT configuration of the master controller

BC9191 in Master /Slave mode 7:
Linking the structure of the PLC task with the PLC variables
BC9191 in Master /Slave mode 8:
Linking the structure of the PLC task with the PLC variables
BC9191 in Master /Slave mode 9:
Display of the successful variable mapping

Detailed description of the TwinCAT PLC program of the master controller

BC9191 in Master /Slave mode 10: (CX5020_BC9191_TcPLC.pro as ZIP file) (sample file)

BC9191 in Master /Slave mode 11: (MasterSlave_TcSM.tsm as ZIP file) (Sample file)

BC9191 in Master /Slave mode 12:
Sample program with CX5020
BC9191 in Master /Slave mode 15:
Diagnosis of the connection via the variable BC9119_uiMonitoring

The master application contains a visualization. On the basis of the VISU and communication via Beckhoff ADS it is possible to execute read and write commands with the connected BC9191s
IndexGroup 16#4020 and 16#4021 ==> IndexOffset, see figure 

BC9191 in Master /Slave mode 16:
Visualization of the master application (CX5020)
BC9191 in Master /Slave mode 17:
Display of Global Variables (BC9191)

NOTES

BC9191 in Master /Slave mode 18:
Swap HI and LOW word

The PLC code, which runs locally on a BC9191 in the case of a communication interruption, is mapped once more on the master controller for each BC9191 and normally actively controls and regulates.

Blue and orange marked program sections belong functionally together.

BC9191 in Master /Slave mode 19:
Assignment of two BC9191 in the master configuration

In the individual programs that refer to an explicit BC9191, the assignment of the physical inputs and outputs must be made in the corresponding structures and stInData_BC9191_xx stOutData_BC9191_xx .

Example for the BC9191_10

The assignment to the physical inputs takes place in the EL_SP_FS_BC9191_10(PRG) program section. (stInData_BC9191_10 : ST_BC9191InData;)
The assignment to the physical outputs takes place in the program part MAIN_BC9191_10(PRG). (stOutData_BC9191_10   :   ST_BC9191OutData;)

BC9191 in Master /Slave mode 20:
Assignment of the physical inputs
BC9191 in Master /Slave mode 21:
Assignment of the physical outputs