Example: Linking of BinaryInput and BinaryOutput objects in the PLC program

The following example illustrates how the link of a binary input with a binary output can be realized with the aid of BACnet objects and a PLC program. The procedure is based on PLC automapping.

Summary:

Example: Linking of BinaryInput and BinaryOutput objects in the PLC program 1:The example bi_bo_example.zip can be downloaded from here.

The strategy is explained step-by-step with the aid of screenshots (For creating servers and objects see also examples "Create BACnet adapters and servers" and "Manual linking of hardware (terminal), BACnet BinaryInput and PLC program"):

  1. Create BACnet adapters and servers (see Example "Create BACnet adapters and servers")
  2. Creating an I/O bus (K-bus, E-bus, BK90xx)
  3. Execute I/O automapping of the bus on BACnet (see "example: I/O automapping")
  4. Creating a PLC project and inserting object instances (The link to the input/output objects is realized using the object names "BI_0" and "BO_0" in the comment, see also "PLC automapping"):
  5. Example: Linking of BinaryInput and BinaryOutput objects in the PLC program 2:
  6. Adding the PLC project (.tpy) to the System Manager configuration:
  7. Example: Linking of BinaryInput and BinaryOutput objects in the PLC program 3:
  8. Important: To ensure correct linking, the object names should correspond to the PLC comment (assignment using the object ID would also be possible):
  9. a) Binary output "BinaryOutput: 0" is to be linked with the PLC instance "BO_0":
  10. Example: Linking of BinaryInput and BinaryOutput objects in the PLC program 4:
  11. b) Binary input "BinaryInput: 0" is to be linked with the PLC instance "BI_0":
  12. Example: Linking of BinaryInput and BinaryOutput objects in the PLC program 5:
  13. Execute PLC automapping via the Settings tab of the BACnet server:
  14. Example: Linking of BinaryInput and BinaryOutput objects in the PLC program 6:
  15. The process data of the BACnet objects and the corresponding data of the PLC program are then linked:
  16. Example: Linking of BinaryInput and BinaryOutput objects in the PLC program 7:
  17. The configuration has to be activated (Ctrl+Shift-F4), and the PLC program has to be loaded (PLC Control via menu "Online --> Login" or F11). The PLC is then switched to Run state with F5 or "Online --> Start".
  18. The different PLC states and the corresponding BACnet properties are described below:
  19. a) Case 1: "BI_0" is not OutOfService and ACTIVE or INACTIVE → Priority "12" of "BO_0" is set to ACTIVE or INACTIVE and acts on the hardware terminal:
  20. Example: Linking of BinaryInput and BinaryOutput objects in the PLC program 8:
  21. Example: Linking of BinaryInput and BinaryOutput objects in the PLC program 9:
  22. b) Case 2: "BI_0" is OutOfService → Priority "12" of "BO_0" is deleted (Zero) and the value from property RelinquishDefault of "BO_0" acts on the hardware terminal:
  23. Example: Linking of BinaryInput and BinaryOutput objects in the PLC program 10:
  24. Example: Linking of BinaryInput and BinaryOutput objects in the PLC program 11: