BACnetMSTPdatalink (FB) ¶ FUNCTION_BLOCK BACnetMSTPdatalink IMPLEMENTS IBACnetDatalink BACnet MS/TP datalink. Information configured in BACnetMSTPdatalink (including the serial configuration) is used to generate the BACstack configuration file (bacstac.ini) on the PLC. CODESYSControl.cfg contains a setting: [CmpBACnet] IniFile=bacstac.ini to define where the BACstack configuration file is to be found. Because the BACstack configuration file is written using the information from BACnetMSTPdatalink, it is accessed from either the runtime system (component) CmpBACnet and the IEC application. So an absolute path or placeholders has to be used for this setting, for example: [CmpBACnet] IniFile=/tmp/bacstac.ini If sandboxing the runtime system filesystem is chosen, the setting [SysFile] ForceFilePath= has to be used to allow access for the absolute path of the BACstack ini file. Runtime changes of broadcast distribution table entries as well as foreign device table ¶ The BACnetServer configuration AutoGenerateBACstackConfig allows to control if the BACstack configuration file is generated during BACnetServer.StartBACnetStack. If AutoGenerateBACstackConfig is set to FALSE, BACnetServer.GenerateBACstackConfig can be used to generate the BACstack configuration file on demand. BBMD broadcast distribution table (BDT) entries as well as foreign device table (FDT) entries added by clients requests are stored in the BACstack configuration file. This happens at runtime of your application and is not reflected in the configuration parameters of the BACnetMSTPdatalink. Re-generating the BACstack configuration file each time at application start would eliminate the entries written at application runtime. So take care to generate the BACstack configuration file only if needed (most likely at initial setup, or at changes in network structure) to ensure keeping those entries. In case you’r using the BACnet device with BBMD functionality and clients requests are to be expected to add/change/remove BDT/FDT entries, you need to set AutoGenerateBACstackConfig := FALSE to keep them persistent. Properties: Baudrate Connection DeviceName MSTPaddr MaxInfoFrames MaxMaster MaxMsgReq NetworkNumber ReplyTimeout TokenTimeout Methods: CheckMstpDeviceDriverReady Structure: Baudrate (Property) Connection (Property) DeviceName (Property) MSTPaddr (Property) MaxInfoFrames (Property) MaxMaster (Property) MaxMsgReq (Property) NetworkNumber (Property) ReplyTimeout (Property) TokenTimeout (Property) protected CheckMstpDeviceDriverReady (Method)
protected ¶ CheckNetworkSettings (Method) GetIPaddrFromETH (Method)
BACnetIPdatalink.CheckNetworkSettings (METH) ¶ METHOD PROTECTED CheckNetworkSettings : BOOL Checks, if parent ETH device is configured properly. Returns TRUE if the network settings are valid. In case FALSE is returned the BACnetServer will not start. In case there is nothing to check (BACnetIPdatalink underneath BACnetServer or PLC) simply return TRUE. InOut: Scope Name Type Comment Return CheckNetworkSettings BOOL Input pConnector POINTER TO IoConfigConnector “child” connector to parent device, parent device could be “Common.Ethernet” (Ethernet), “Common.BACnet” (BACnetServer) or “Common.PCI” (PLC).
BACnetIPdatalink.CntBbmd (PROP) ¶ PROPERTY CntBbmd : WORD Number of initial entries in the BDT, a value of 0 will disable BBMD functionality
BACnetIPdatalink.ForeignDevAddr (PROP) ¶ PROPERTY ForeignDevAddr : ARRAY [0..3] OF BYTE Foreign device address, a value of [0,0,0,0] will disable foreign device registration
BACnetIPdatalink.ForeignDevAddrPort (PROP) ¶ PROPERTY ForeignDevAddrPort : WORD Foreign device port
BACnetIPdatalink.ForeignDevRegTimeout (PROP) ¶ PROPERTY ForeignDevRegTimeout : DWORD Foreign device registration timeout
BACnetIPdatalink.IPaddress (PROP) ¶ PROPERTY IPaddress : ARRAY [0..3] OF BYTE IP address to use
BACnetIPdatalink.MaxMsgReq (PROP) ¶ PROPERTY MaxMsgReq : WORD Message queue length between the physical layers
BACnetIPdatalink.NetworkNumber (PROP) ¶ PROPERTY NetworkNumber : WORD BACnet network number