Advantech satellite networks satellite equipment Advantech ...
SumitomoSumitomo BACnet BACnet Device Driver … · Advantech WebAccess Device Driver Guide SBacNet...
Transcript of SumitomoSumitomo BACnet BACnet Device Driver … · Advantech WebAccess Device Driver Guide SBacNet...
Advantech WebAccess Device Driver Guide SBacNet
Version 5.0 rev 3 Advantech Corp., Ltd.
SumitomoSumitomoSumitomoSumitomo
BACnet BACnet BACnet BACnet
Device Driver GuideDevice Driver GuideDevice Driver GuideDevice Driver Guide
Advantech WebAccess Device Driver Guide SBacNet
Version 5.0 rev 3 Advantech Technology, Inc. page i
Table of Contents
Sumitomo BACnet Device Driver Guide 1
1. BACnet to Sumitomo Device Communications 2
1.1 Introduction to BACnet driver to Sumitomo devices ......................... 2 1.2 Advantech WebAccess BACnet Driver Specification........................ 2
1.2.1 Composition ....................................................................... 2 1.2.2 Specification ....................................................................... 3
1.2.2.1 PORT TYPE: API.............................................................. 3 1.2.2.2 Device configuration parameters ....................................... 3 1.2.2.3 ADDRESS is BACnetObject.............................................. 3 1.2.2.4 Additional Specifications ................................................... 4
1.2.3 BACnet API ........................................................................ 5 1.2.3.1 Methods............................................................................ 5 1.2.3.2 struct BACnetData ........................................................... 7 1.2.3.3 Additional Information – 7 July 2005.................................. 7
1.3 API Comport and SBACnet device .................................................. 9 1.3.1 Configure an API Comport and SBACnet Device ................ 9 1.3.2 Comport Properties........................................................... 10
1.3.2.1 Comport Number ............................................................ 10 1.3.2.2 Description...................................................................... 10 1.3.2.3 Scan Time ...................................................................... 10 1.3.2.4 Timeout .......................................................................... 11 1.3.2.5 Retry Count .................................................................... 11 1.3.2.6 Auto Recover Time ......................................................... 11
1.4 Configure a Tag ............................................................................ 12 1.4.1 Addresses ........................................................................ 14
1.4.1.1 Address examples .......................................................... 14 1.4.2 Conversion Code .............................................................. 15 1.4.3 Blocks............................................................................... 15
1.5 Parameters ................................................................................... 16 1.5.1 Add Parameter ................................................................. 16
1.6 Error Codes................................................................................... 18
2. Custom STATE Descriptors 18
2.1 SBAC_MAP.INI ............................................................................. 18 2.1.1 Default Lookup Group (DEFAULT_MAP) .......................... 19 2.1.2 Applying the Conversion Code to a Tag ............................ 19
Rev 1 – Last updated 25/July/2005
Advantech WebAccess Device Driver Guide SBacNet
Version 5.0 rev 3 Advantech Technology, Inc. page 2
1. BACnet to Sumitomo Device Communications
1.1 Introduction to BACnet driver to Sumitomo devices
Advantech WebAccess SCADA Node can use a BACnet interface to
communicate to Sumitomo devices. The SCADA node requires BACnet Server
software be installed on the SCADA node PC.
The Advantech WebAccess Tags are configured using the BACnetObject (with
options) as ‘addresses’ in the Advantech WebAccess Tags. (See section 1.4.1
Addresses).
The Advantech WebAccess SBacNet driver uses an API port type. This port is
really an API interface to the Sumitomo BACnet server. It does not need to
match an actual COM port number.
1.2 Advantech WebAccess BACnet Driver Specification
Last updated 25/July/2005
1.2.1 Composition
Advantech WebAccess TAG <- -> This Driver <- -> BACnet Server <- ->
ICONT1 .. 255
Advantech WebAccess
BACnet Driver
BACnet Server
ICONT-1
ICONT-255
API SEM_BACNET.DLL
BACnet Communication
Advantech WebAccess Device Driver Guide SBacNet
Version 5.0 rev 3 Advantech Technology, Inc. page 3
1.2.2 Specification
This driver connects with a BACnet Server via a special API.
1.2.2.1 PORT TYPE: API
PORT TYPE used is API.
1.2.2.2 Device configuration parameters
DEVICE will define ICONT-1.. 255. The Device configuration parameters are
shown below.
Device : [ ]
Description : [ ]
Unit : [ ]
Type : [sBACnet]
ICONT ID : [ ] <- - 0 to 2100000000 (max long)
Device Chk:TypeNo.PropertyID : [8.112] <- - string Default “8.112"
1.2.2.3 ADDRESS is BACnetObject
TAG specifies BACnetObject and the option with ADDRESS. The parameter is
shown below.
<InstanceNo>.<TypeNo>.<PropertyID> </Option>
[examples]
1.4.85/P=16/G=1 …Instance=1,BinaryOut,PresentValue,PriorityArray=16
1.0.36/G=2 …Instance=1,AnalogInput,Event_State
NULL is written by:
1.0.85/P=16/N=-1…Instance=1, Analog Input, Present Value, and Priority Array=16 and -1.
An actual access (GetAccessKey function call) adds ICONT ID to the head.
<DEVICE:ICONT ID>.<InstanceNo>.<TypeNo>.<PropertyID> </OPTION>
Advantech WebAccess Device Driver Guide SBacNet
Version 5.0 rev 3 Advantech Technology, Inc. page 4
OPTION
[OPTION]
/P=XX
XX:1~16
Discrete Tag
And
Present Value
The priority array of default is set. When the Present Value tag of each object type is set, it is assumed it is indispensable.
When the array is not specified and SETVAL is executed, the value is set to this Priority Array.
/T=N Read cycle Taking data of BACnet Server cycle
/G=XX Discrete Tag SBAC_MAP.INI is used. (Similar to the LNS driver. )
/N=XX Analog Tag
Text Tag
The key word numerical value that does the NULL value writing is set.
When passing data to the GetAccessKey() function, because the above-
mentioned /P,/G and /N is the options that Advantech WebAccess processes,
It removed before the GetAccessKey() function call. The option (/T) call is
only done with GetAccessKey().
1.2.2.4 Additional Specifications
• The object specification of BACnet that exchanges data can be
specified via the API. The data used is a data type (LONG, DOUBLE,
STRING, and NULL) and the data.
• TAG abnormality processing
If the return value is abnormal from API, the TAG value is an asterisk
*.
• DEVICE abnormality processing
The value is acquired from BACnetObject regularly specified with
Device Chk of DEVICE.
Ex. “8.112”
An actual access (GetAccessKey function call) adds ICONT ID to the
head.
<ICONT ID>.<ICONT ID>.8.112 … Instance=ICONT ID
The value 0 is normal, otherwise abnormal (error) by function
BACnetGetData( ).
Then, it is device error when that call is unsuccessful.
Indicate it as a device error point(The device number is red blink of
STATION STATUS).
• About Present Value of each object type (type number =85)
Advantech WebAccess Device Driver Guide SBacNet
Version 5.0 rev 3 Advantech Technology, Inc. page 5
/P=XX setting is needed. This TAG makes to the array tag and stores
the Present Value and the Priority Array value in the array.
Array(0) … Present Value
Array(1). . (16)… Each Priority Array
When the array is not selected at the time of writing in tag, it writes it
in Priority Array set by /P. (It is not possible to write it in Array 0. )
[Ex.]
Tag name: test, Address: 1.4.85/P=16/G=1
One is written in SETVAL test=1…Value is set on test(16), It default is
/P=16.
SETVAL test(1)=0… 0 is written in test(1).
• Writing of NULL value
To have to write NULL in Priority Array, the NULL writing is enabled.
[Discrete TAG]
It is enabled that it is a setting of "NULL" to State.
[Analog, Text TAG]
When the value specified by /N is written, NULL is written.
• Extraction of bit
An arbitrary bit can be extracted with Start Bit and Bit Length.
1.2.3 BACnet API
The DLL is named SEM_BACNET.DLL
1.2.3.1 Methods
Open int OpenBACnet( )
Return:
0: Succeeded
1>=: Failed (Error Code)
Advantech WebAccess Device Driver Guide SBacNet
Version 5.0 rev 3 Advantech Technology, Inc. page 6
Close int CloseBACnet( )
Return:
0: Succeeded
1>=: Failed (Error Code)
Get Access key (HANDLE) int GetAccessKey( char *Tag Address, long *key )
Tag Address … A.B.C.D [/P=N /T=N] A:ICONT ID, B:Instance,
C:TypeNo, D:PropertyID
Return:
0: Succeeded
1>=: Failed (Error Code)
Release All Access key (HANDLE) int ReleaseAccessKey( )
Return:
0: Succeeded
1>=: Failed (Error Code)
Get BACnet data Int GetBACnetData( long key, struct BACnetData *Data )
key … object key [handle]
Data … result data copy to this area
Return:
0: Succeeded
1>=: Failed (Error Code)
Put BACnet data int PutBACnetData( long key, struct BACnetData *Data )
key … object key [handle]
Data … set data from this area
Return:
0: Succeeded
1>=: Failed (Error Code)
Advantech WebAccess Device Driver Guide SBacNet
Version 5.0 rev 3 Advantech Technology, Inc. page 7
1.2.3.2 struct BACnetData
#pragma pack(4) struct BACnetData { int DataType; // 0:NULL, 1:long, 2:unsigned long, 3:double, 4:cha r string unsigned char Strlength; // 0 to 255 unsigned char Priority; // Priority 1 to 16 (Only u se Prop=85) // It is set before call GetBACnetData( ), PutBACne tData( ) // functions. union { long LongData; unsigned long UnsignedData; double DoubleData; char CharData[256]; // data + ‘\0’ } }
1.2.3.3 Additional Information – 7 July 2005
[ About PRESENT VALUE (PropertyID is 85) ]
BACnet side value is an array [1 .. 16]. It is the priority level.
In this case Advantech WebAccess TAG will be an array type tag. User must
configure a 17-element tag (0 to 16). Note that the Array tag of Advantech
WebAccess start index is Zero(0).
Index Zero(0) is special : (default /P=N).
Advantech WebAccess TAG BACnet Present Value Description
XXXXXX [N] BACnetData.Priority = N
/P=N N:1 .. 16 /P is default priority number.
XXXXXX(0) [N] BACnetData.Priority = N
XXXXXX(1) [1] BACnetData.Priority = 1
XXXXXX(2) [2] BACnetData.Priority = 2
: XXXXXX(16) [16]
BACnetData.Priority = 16
Example: 1.4.85/P=10
Object id “1.4.85” This Priority Id is 85. In this case Advantech WebAccess
TAG is array.
Advantech WebAccess Device Driver Guide SBacNet
Version 5.0 rev 3 Advantech Technology, Inc. page 8
XXXXXX = 123
XXXXXX(0) = 123
XXXXXX(10) = 123
It result is same.
This example is called BACnetData.Priority = 10.
Before calling BACnetGetData() or BACnetPutData(),BACnetData.Priority = N
is set up.
In this case, a Advantech WebAccess TAG is defined as an array type-tag.
BACnet PresentValue has 16 levels (values), that are handled with a TAG
(array) on the Advantech WebAccess side.
TAG definition with Advantech WebAccess is 17 elements: (0 and 1 - 16).
TAG(0) is the array element number specified by the /P option.
PresentValue (PropertyID=85)
[PresentValue (PropertyID=85) spec. of Array / Non Array TAG]
AO(1):PresentValue(85) ... 1.X.85
AV(2):PresentValue(85) ... 2.X.85
BO(4):PresentValue(85) ... 4.X.85
BV(5):PresentValue(85) ... 5.X.85
MO(14):PresentValue(85) ... 14.X.85
MV(19):PresentValue(85) ... 19.X.85
There is an exception in PresentValue(PropertyID=85).
Instance=1,2,4,5,14,19 (AO,AV,BO,BV,MO,MV only 6 kinds) are Array Tags.
Even 85 isn't made Array TAG except for that. Then, it is only PropertyID=85.
Array TAG isn't used except for that.
Advantech WebAccess Device Driver Guide SBacNet
Version 5.0 rev 3 Advantech Technology, Inc. page 9
1.3 API Comport and SBACnet device
1.3.1 Configure an API Comport and SBACnet Device
The steps, in summary, are:
1. Start Internet Explorer Web Browser.
2. Enter IP address of the Project Node.
3. Use Advantech WebAccess Configuration.
4. Open or Create a Project.
5. Configure a SCADA node (the PC that will connect to the automation
hardware).
6. Configure a Comport for the SCADA Node that is an LNS type Comport.
7. Configure Scan Time, Timeout, Retry and Auto Recover.
See Comport Properties in the following section for more information.
8. Press Submit.
9. Configure an SBACNET Device (determines the communications Protocol or Device Driver) using Add Device.
Advantech WebAccess Device Driver Guide SBacNet
Version 5.0 rev 3 Advantech Technology, Inc. page 10
10. Select the Device Type is SBacNet
11. Enter the DeviceChk:TypeNo.PropertyID. The default is “8.112".
12. Enter the ICONT ID. The range is 0 to 2100000000 (max long).
13. Press Submit.
14. Use Add Tag or Add Block to create tags from Device Properties.
1.3.2 Comport Properties
1.3.2.1 Comport Number
The API Comport is a virtual comport. There is no need to match that of the
physical interface (e.g. COM1, COM2, COM3, etc) on the SCADA Node. It is
recommended to use a Port > 3 to avoid conflict with an actual serial port.
1.3.2.2 Description
This is an optional field used for user reference.
1.3.2.3 Scan Time
This is the time in milliseconds to scan the BACnet server. This must match
the ability of the BACnet network to respond.
Advantech WebAccess Device Driver Guide SBacNet
Version 5.0 rev 3 Advantech Technology, Inc. page 11
If the BACnet server, network and devices cannot respond as fast as the
SCAN Time entered, Advantech WebAccess will scan at a slower rate.
1.3.2.4 Timeout
Timeout is the time waited before re-sending a communications packet that
did not have a reply. Timeout is in milliseconds.
TimeOut specifies how long the software waits for a response to a data
request, specifically to wait for a reply from one packet. A recommended
value is 3 seconds, longer if the communication device is slow. This is
protocol dependent: some protocols do not allow changes in time out.
Combined with Retry count, TimeOut also determines time to consider a
device or port as BAD. Timeout is the time to wait since last communication
packet sent without a reply. Time is in milliseconds. The slow or poor quality
communications require longer timeout. The faster the communications
network or device, the shorter the timeout required. Shorter timeouts notify
operators of communications failure more quickly.
1.3.2.5 Retry Count
Number of times to retry communications if no reply is received from a device.
Combined with Timeout, also determines time to consider a device or port as
BAD.
In addition, Indicates the number of times after the first attempt has failed
that communication should be attempted before indicating a failure.
Specifically, how many times to send a single packet after the field device
fails to respond to the first packet. After the retry count is exceeded, all the
tags in the packet are marked with asterisks and the next packet of requests
is sent. A reasonable value is 3 to 5 times. After this number of tries, the tags
in this packet are marked as "fail to respond" (i.e. asterisks) and are disabled.
In reality, increasing the number of retries hides failures on the part of the
field device to respond to a request. Essentially, increasing the retries gives
the field device more chances to reply.
1.3.2.6 Auto Recover Time
Auto Recover Time is the time to wait before attempting to re-establish
communications with a BAD device or port.
If communications to the PLC is unusually slow due to hardware,
communications or network issues, you might consider increasing this value.
If communications to the PLC or RTU fails frequently, you may want to
decrease this number in order to have Advantech WebAccess try to re-
establish communications sooner.
Advantech WebAccess Device Driver Guide SBacNet
Version 5.0 rev 3 Advantech Technology, Inc. page 12
If communications to the PLC, RTU or device Fails (i.e. exceeds Timeout)
Advantech WebAccess will wait the Auto Recover Time before trying to re-
establish communications.
1.4 Configure a Tag This section assumes parameters have been configured for the project. For
most users, this will be true. Sumitomo normally configures parameters for its
projects. There must be at least one parameter for each data type (Analog,
Discrete and Text) that you plan to configure. See the following section on
Parameters for more information on how to build parameters.
1. From Comport Properties select Add Tag.
2. Select a parameter from the pull down list. Select a Parameter to match
the type of data to be read or written (Analog Input, Analog Output, Discrete
Input, Digital Output, Text Input, etc.).
Advantech WebAccess Device Driver Guide SBacNet
Version 5.0 rev 3 Advantech Technology, Inc. page 13
An indication of what a parameter does is to look at the conversion
code and address. A Parameter is intended as a template or shortcut to
guide you in configuring a point. The Description field is also a good
indication of the intended use for this parameter.
The Data type is the only thing you can not change later. Be sure if you
are using a floating point number or an integer greater than 1 byte to
use an analog data type: Point (analog)
Use a Discrete data type for on/off and 8-state discrete: Point (discrete)
Use a Text data type for Text: Point (text).
3. Modify the Address. The Address of the data must match the
BACnetObject plus options.
(See section 1.4.1 Addresses).
Advantech WebAccess Device Driver Guide SBacNet
Version 5.0 rev 3 Advantech Technology, Inc. page 14
4. Apply a Conversion Code.
For more information see section 1.4.2 Conversion Code.
5. Apply a Tag name.
6. Press Submit.
7. Edit Tags in Project Manager to assign Alarms, Scaling, Engineering
Units, Description and other features.
8. Download to the SCADA node.
1.4.1 Addresses
The Address of the data is the BACnetObject plus options. The address
format is:
<InstanceNo>.<TypeNo>.<PropertyID> </Option>
Options
The Options used with the BACnetObject to create an address are:
/P=XX
XX:1~16
Discrete Tag
And
Present Value
The priority array of default is set. When the PresentValue tag of each object type is set, it is assumed it is indispensable.
When the array is not specified and SETVAL is executed, the value is set to this Priority Array.
/T=N Read cycle Taking data of BACnet Server cycle
/G=XX Discrete Tag SBAC_MAP.INI is used. (Similar to the LNS driver. )
/N=XX Analog Tag
Text Tag
The key word numerical value that does the NULL value writing is set.
1.4.1.1 Address examples
Address example Description
1.4.85/P=16/G=1 Instance=1, Binary Out, PresentValue, Priority Array=16
1.0.36/G=2 Instance=1, Analog Input, Event_State
1.0.85/P=16/N=-1 Instance=1, Analog Input, PresentValue, Priority Array=16 and NULL is written by -1
Advantech WebAccess Device Driver Guide SBacNet
Version 5.0 rev 3 Advantech Technology, Inc. page 15
1.4.2 Conversion Code
The conversion code is used to interpret the data as integer, floating point,
discrete state, or text.
1.4.3 Blocks
Currently, no block types have been pre-configured.
Advantech WebAccess Device Driver Guide SBacNet
Version 5.0 rev 3 Advantech Technology, Inc. page 16
1.5 Parameters Sumitomo has been providing its own parameters. The user can add as many
parameters as desired.
1.5.1 Add Parameter
This section assumes you have started Internet Explorer Web Browser and
connected to your Project Node.
1. Start Advantech WebAccess Configuration.
2. Login with User Name and Password.
3. Select your Project Name.
4. The Project Manger opens.
5. Drag the slider bar on the left Frame down to reveal Device Type list.
6. Pick on the SBacNet Device Type to create a parameter for your
SBacNet Driver.
7. The Parameters Set for the Device Type (driver) opens. The list of
parameters is often blank for the SBacNet device unless Sumitomo has
configured some for your project.
Figure 5-7Add Parameter
Advantech WebAccess Device Driver Guide SBacNet
Version 5.0 rev 3 Advantech Technology, Inc. page 17
8. Select Add Parameter.
The Create Parameter Properties Page opens.
9. Select a Parameter Type from the Pull Down List.
This is the first step in creating a Parameter. The important thing is to
get the Data type correct, you cannot change from Analog to Discrete
to Text. All other properties can be changed.
Advantech WebAccess Device Driver Guide SBacNet
Version 5.0 rev 3 Advantech Technology, Inc. page 18
Analog parameter is at least 4 bits of data and greater (up 16 bits or
32 bits depending on the driver) that are interpreted as numbers.
Floating-point numbers and any value over 7 must be created as an
Analog Type.
A Discrete parameter is 1 to 3 bits of data and is interpreted as
"digital" (0 or 1) or as a "discrete" integer between 0 and 7.
Text parameter is data read as ASCII strings. The size is dependent
on the driver, but always less than 70 characters.
10. If you select a Discrete or Text type parameter, the Page will change
to the appropriate page for Discrete of Text type parameters.
11. Press Submit when you are finished entering Data.
12. You can edit parameters using the Parameter Properties.
1.6 Error Codes The following error codes are returned during runtime in View or ViewDAQ
and can be viewed from the Point Info Dialog box.
9yyy yyy is the return code from GetAccessKey() or GetBACnetData() function, when device check failed.
Axxx xx is the return code from GetBACnetData() function.
C001 Returned DataType is 0.
B005 When /G=n, n > total defined group in the INI file.
B002 Cannot match group data definition in group.
B011 Configured Text point but returned DataType != 4.
2. Custom STATE Descriptors
2.1 SBAC_MAP.INI The User can create custom STATE conversions by modifying the
SBAC_MAP.INI file. This applies to Discrete type Tags (i.e. ON/OFF,
ST_ON/ST_REQ/ST_OFF). The Advantech WebAccess STATE Descriptor
appears on Displays, Alarms and in the Change Dialog Box pushbuttons.
Advantech WebAccess Device Driver Guide SBacNet
Version 5.0 rev 3 Advantech Technology, Inc. page 19
These correspond to the tag
fields .DESCR0, .DESCR1, .DESCR2, .DESCR3, .DESCR4, .DESCR5, .DESCR6,
and .DESCR6.
The user creates pairs of Device STATE Descriptors and Advantech WebAccess
State Descriptors.
An example SBAC_MAP.INI is as follows:
[DEAFULT_MAP] Total_Item=3 MAP_1=ST_ON,ON MAP_2=ST_OFF,OFF Map_3 = 100.0 1,ON Total_Group = 2 [Group_1] Total_Item=2 Map_1 = 100.0 1,FAN_ON Map_2 = 0.0 0,FAN_OFF [Group_2] Total_Item=2 Map_1 = 100.0 1,POWER_ON Map_2 = 0.0 0,POWER_OFF
2.1.1 Default Lookup Group (DEFAULT_MAP)
All the STATE conversion will first look into the DEFAULT_MAP section for data
from LNS server. If a matched entry has been found, say, "100.0 1", then
"ON" will be used to match the point's descriptors to get correct value for the
Discrete tags STATE Descriptor. So, instead of using 100.0 1 as descriptor,
the operator will see a more friendly descriptor for the tag (e.g. “ON”).
2.1.2 Applying the Conversion Code to a Tag
In configuring the Discrete Tag in Advantech WebAccess to communicate with
an BACnet device, the user will see not see the words “Default_MAP” in the
drop-down menu for conversion code. Instead, any STATE Descriptors pairs
defined in the DEFAULT_MAP section of the SBAC_MAP.INI will apply if one
the STATE conversion codes are selected.
Advantech WebAccess Device Driver Guide SBacNet
Version 5.0 rev 3 Advantech Technology, Inc. page 20
Figure – State conversion codes for LNS device
If the user selects on of the STATE conversion codes, the newly defined State
Descriptors in SBAC_MAP.INI will be applied to do the conversion for that tag.