In this article, we will launch BACnet Server from EXOR’s JSMART707M panel, access each Object with Beckhoff TwinCAT3 and TF8020, and access Objects from PLC projects using TF8020’s FB auto-generation function.
Let’s get started!
Reference Link
Implementation
EXOR Side
Add Protocol
Add Protocol from JMobile Studio.
Select BACnet.
The BACnet feature configuration screen appears.
Panel Device ID
Panel Device ID is the BACnet ID number of the EXOR panel. 262000 by default.
IP UDP Port
The IP UDP Port number is 47808 by default.
Devices
The red frame allows you to set the number of devices for each analog, Binary, etc. in the EXOR panel.
Finally
This is the setting for this article.
Add Tags
Even if you add devices with BACnet Driver, you still need to define Tags.
This is BACnet’s Tag screen.
Object Property
Object Property allows you to set the Property that accesses the corresponding Tag. 85 is the Present Value.
Device ID
Device ID is set to the BACnet Server ID to which the corresponding Tag belongs. In the figure below, if 262000 is set, the corresponding Tags will be BACnet Server ID is 262000 (i.e., EXOR JSMART707M itself).
If you want to access another BACnet to the Server, match it to the Device ID.
Object Type
Object Type is the object type of the corresponding Tags.
Data Type
Data Type is the data type of the corresponding Tags.
Object Instance
This is the Instance number of the corresponding Tags.
Finally
Done!
Screen
The last step is to create a confirmation screen.
Beckhoff Side
Add BACnet/IP Device
Add a new BACnet/IP Device by going to Devices>Right Click>Add New Item.
Select BACnet>BACnet IP Device>OK.
Done!BACnet IP devices have been added.
Add BACnet Client
Next, to add BACnet Client, go to Device>Right click>Add New Item.
Select BACnet Client>OK.
Done!
Settings
Open the BACnet Client and match the Identification item to the EXOR panel.
Do this by matching the BACnetID and Udp Port to the minimum.
If the IPC has multiple IPs, remove the “Use Operating System Settings” check box under Local Settings>Mode and set the IPs separately.
Result
The Device Diagnosis Status shows “Online” and TwinCAT3 can see the BACnet object in the EXOR panel.
Scan
Next, let’s click on Object1 to add the BACnet Object in the EXOR panel to the TwinCAT project.
Press Scan Button.
Done!All BACnet Objects in EXOR could be searched!
The Present Value and EventState of each Object could also be checked.
Implementation2
Beckhoff Side
Add PLC
Add a new PLC with PLC>Add New Item.
Select Standard PLC Project>Add.
Create FB Code
By using the Beckhoff TF8020, a BACnet Object Function Block can be automatically generated and added to the PLC. Double-click on the BAcnet Client that is connected to the EXOR you have just added.
This function can be used to automatically generate the Function Block required to reference the BACnet client in the PLC, click Cyclice Data>FB Code.
Check the BAcnet Object you want to generate in your PLC project and click ‘Create in PLC’ to automatically generate a Function Block.
Done!FB_BACnet_Object1 was automatically generated.
Input/output Interfaces and programmes were also already defined in the Function Block.
Add Library
Add the BAcnet library to use the Function Block generated earlier Reference>Add library.
Select Tc3_BACnetRev14 >OK to add.
Only either Rev14 or Rev12 can be used in a PLC project, so as Tc3_BACnetRev14 was set up and FB Code exported in this article, import Tc3_BACnetRev14 into the PLC to match this setting.
AmsNetId
Link the AmsNetId in the PLC project to the ID of the BACnet.
Set Device1 (BACnet IP)>Ams NetId.
Progarm
Finally, define an Instance of FB_BACnet_Object1, which was automatically generated earlier, in the MAIN programme and call it into the programme.
PROGRAM MAIN VAR exor:FB_BACnet_Object1:=(Client:=(nDeviceInstance := 262000)); END_VAR exor(); |
The 262000 set for nDeviceInstance matches the BACnet ID of the EXOR.
Result
各Objectにある”bReady”がTrueになり、PLCプロジェクトのFB InstanceはEXORパネルのBACnet Serverと接続成功です。
If ANALOG_VALUE_0 is set to “22” from the EXOR panel, fVal will be set to 22.
The next step is to change the ANALOG_VALUE_1 value from the PLC. fPreVal is set to 3.2 in the EXOR panel and fPreVal is reflected in 3.2.
Next, change the current value to First in order to set ePriority higher than the BACnet IP Server in the EXOR panel.
Done!If bEnWrite is set to True and fVal is changed to 1.1, the Present value of ANALOG_VALUE_1 is set to 1.1!