Académique Documents
Professionnel Documents
Culture Documents
WagoLibHART_02.lib
The library WagoLibHART_02.liboffers a set of function blocks to execute
HART-commands (Revision 5) in a PLC program.
The principal item of this library is program HART_INFO, it identifies
connected HART modules like 750-482 and coordinates the Kbus access.
In addition you find with HART_FDT program that act as counterpart to
WAGO-ModbusTCP-HART-DTM, who enable configuration of HART
devices with every FDT-Frameapplication like WAGOframe.
HART_INFO
Content
WagoLibHART_02.lib
HART_INFO ............................................................................................3
HART_FDT..............................................................................................4
HART_CMD0 ..........................................................................................5
HART_CMD1 ..........................................................................................7
HART_CMD2 ..........................................................................................9
HART_CMD3 ........................................................................................11
HART_CMD6 ........................................................................................13
HART_CMD11.......................................................................................15
HART_CMD12.......................................................................................17
HART_CMD13.......................................................................................19
HART_CMD14.......................................................................................21
HART_CMD15.......................................................................................23
HART_CMD16.......................................................................................25
HART_CMD17.......................................................................................27
HART_CMD18.......................................................................................29
HART_CMD19.......................................................................................31
HART_CMDCustom ..............................................................................33
2 WagoLibHART_02.lib
ml03801e
WAGO-I/O-PRO 32
WagoLibHART_02.lib
HART_INFO
WAGO-I/O-PRO Library elements
Category:
Name:
Type:
Library name:
Used Libraries
Applicable to:
Communication
HART_INFO
Function
Function block
WagoLibHART_02.lib
mod_com.lib
750-841; 750-842; 750-833;
Program X
Inputparameters:
xStart
Data type:
BOOL
Comments:
Set program active
In-/Out parameters:
xReset
Data type:
BOOL
Comments:
Clean up resources
Outputparameters:
dwError
Data type:
DWORD
Comments:
sStatus
STRING
Graphic display:
Function description:
This program identifies all connected HART-modules and coordinate the MailBox
communication via KBus.
The current config and state of each HART module is stored in "g_atHARTModules" in
VAR GLOBAL's.
g_atHARTModules : ARRAY [1..8] OF tHART_2AI (* Global List of HART modules *)
This program is the counter part of each HART application, because all other functionblocks need informations provided by HART_INFO.
HART_FDT
HART_FDT
WAGO-I/O-PRO Library elements
Category:
Name:
Type:
Library name:
Used Libraries
Applicable to:
Communication
HART_FDT
Function
Function block
WagoLibHART_02.lib
mod_com.lib
750-841;
Program X
Inputparameters:
tTimeOut
Data type:
TIME
Comments:
Watchdog Timeout, default 10s
In-/Out parameters:
Data type:
Comments:
Outputparameters:
bMsgId
dwError
Data type:
BYTE
DWORD
Comments:
sStatus
STRING
Graphic display:
Function description:
This program work as gateway for the WAGO-ModbusTCP-HART-GatewayDTM.
It waits for DPV1-Request over Modbus_TCP in PFC-IN-Area at %IW256 to process.
The DPV1-Response will be written to PFC-OUT-Area at %QW256.
Take care for dont using this Memory area in your application.
If an error occours the program performs a auto reset after the given tTimeout..
This program works at 750-841 only!
4 WagoLibHART_02.lib
ml03801e
WAGO-I/O-PRO 32
HART_CMD0
WAGO-I/O-PRO Library elements
Category:
Name:
Type:
Library name:
Used Libraries
Applicable to:
Inputparameters:
bModule
bChannel
In-/Out parameters:
xStart
Communication
HART_CMD0
Function block X
Function
WagoLibHART_02.lib
mod_com.lib
750-841; 750-842; 750-833;
Program
xReset
Outputparameters:
dwError
sStatus
stData
STRING
tHART_
CMD0
HART_CMD0
Graphic display:
Function description:
The HART_CMD0 "Read unique identifier".
The function block sends a HART command 0 request to a HART device and
processes the response.
There is no nees to use this functionblock in your application! You find all informations
in "g_atHARTModules"
g_atHARTModules : ARRAY [1..8] OF tHART_2AI;
(* Global List of HART modules - keep current config and state *)
RequestData:
None
ResponseData:
0
1
2
3
4
5
6
7
8
911 ->
6 WagoLibHART_02.lib
ml03801e
WAGO-I/O-PRO 32
HART_CMD1
WAGO-I/O-PRO Library elements
Category:
Name:
Type:
Library name:
Used Libraries
Applicable to:
Inputparameters:
bModule
bChannel
In-/Out parameters:
xStart
Communication
HART_CMD1
Function block X
Function
WagoLibHART_02.lib
mod_com.lib
750-841; 750-842; 750-833;
Program
xReset
Outputparameters:
dwError
sStatus
stData
STRING
tHART_
CMD1
HART_CMD1
Graphic display:
Function description:
The HART_CMD1 "Read primary variable".
The function block sends a HART command 1 request to a HART device and
processes the response.
RequestData:
None
ResponseData:
0
-> PV units code
14
-> Primary variable
8 WagoLibHART_02.lib
ml03801e
-> Type:(B)
-> Type:(F)
WAGO-I/O-PRO 32
HART_CMD2
WAGO-I/O-PRO Library elements
Category:
Name:
Type:
Library name:
Used Libraries
Applicable to:
Inputparameters:
bModule
bChannel
In-/Out parameters:
xStart
Communication
HART_CMD2
Function block X
Function
WagoLibHART_02.lib
mod_com.lib
750-841; 750-842; 750-833;
Program
xReset
Outputparameters:
dwError
sStatus
stData
STRING
tHART_
CMD2
HART_CMD2
Graphic display:
Function description:
The HART_CMD2 "Read current and percent of range".
The function block sends a HART command 2 request to a HART device and
processes the response.
RequestData:
None
ResponseData:
03 -> Current (mA)
47 -> Percent of range
10 WagoLibHART_02.lib
ml03801e
-> Type:(F)
-> Type:(F)
WAGO-I/O-PRO 32
HART_CMD3
WAGO-I/O-PRO Library elements
Category:
Name:
Type:
Library name:
Used Libraries
Applicable to:
Inputparameters:
bModule
bChannel
In-/Out parameters:
xStart
Communication
HART_CMD3
Function block X
Function
WagoLibHART_02.lib
mod_com.lib
750-841; 750-842; 750-833;
Program
xReset
Outputparameters:
dwError
sStatus
stData
STRING
tHART_
CMD3
HART_CMD3
Graphic display:
Function description:
The HART_CMD3 "Read all variables".
The function block sends a HART command 3 request to a HART device and
processes the response.
RequestData:
None
ResponseData:
03
-> Current (mA)
4
-> PV units code
58
-> Primary variable
9
-> SV units code
1013
-> Secondary variable
14
-> TV units code
1518
-> Third variable
19
-> FV units code
2023
-> Fourth variable
12 WagoLibHART_02.lib
ml03801e
-> Type:(F)
-> Type:(F)
-> Type:(F)
-> Type:(F)
-> Type:(F)
WAGO-I/O-PRO 32
HART_CMD6
WAGO-I/O-PRO Library elements
Category:
Name:
Type:
Library name:
Used Libraries
Applicable to:
Inputparameters:
bModule
bChannel
bPollingAddress
In-/Out parameters:
xStart
Communication
HART_CMD6
Function block X
Function
WagoLibHART_02.lib
mod_com.lib
750-841; 750-842; 750-833;
Program
xReset
Outputparameters:
dwError
sStatus
STRING
HART_CMD6
Graphic display:
Function description:
The HART_CMD6 "Write polling address".
The function block sends a HART command 6 request to a HART device and
processes the response.
RequestData:
0
-> Polling address -> Type:?
ResponseData:
As in request
Note:
Using the polling address structure of the HART protocol, up to 15 devices
can be connected in a multidrop network. The analog device can be fixed by setting its
polling address to a number other than zero.
14 WagoLibHART_02.lib
ml03801e
WAGO-I/O-PRO 32
HART_CMD11
WAGO-I/O-PRO Library elements
Category:
Name:
Type:
Library name:
Used Libraries
Applicable to:
Communication
HART_CMD11
Function block X
Function
WagoLibHART_02.lib
mod_com.lib
750-841; 750-842; 750-833;
Inputparameters:
bModule
Data type:
BYTE
bChannel
BYTE
sTag
STRING(8)
In-/Out parameters:
xStart
Program
Comments:
Position or index of plugged HART module start
with one.
The channel of the I/O-Module where the HART
device is connected.
Valid values are 1 and 2.
Unit tag
xReset
Outputparameters:
dwError
sStatus
stData
STRING
tHART_C
MD0
HART_CMD11
Graphic display:
Function description:
The HART_CMD11 "Read unique identifier associated with input tag".
The function block sends a HART command 11 request to a HART device and
processes the response.
RequestData:
0-5
-> Unit tag(8 Characters) -> Type:(A)
ResponseData:
0
-> "254" (expansion)
1
-> Manufacturer identification code
2
-> Manufacturer device type code
3
-> Number of preambles required
4
-> Universal command revision
5
-> Device-specific command revision
6
-> Software revision
7
-> Hardware revision
8
-> Device function flags
-> Type:(H)
911 -> Device ID number
-> Type:(B)
16 WagoLibHART_02.lib
ml03801e
WAGO-I/O-PRO 32
HART_CMD12
WAGO-I/O-PRO Library elements
Category:
Name:
Type:
Library name:
Used Libraries
Applicable to:
Inputparameters:
bModule
bChannel
In-/Out parameters:
xStart
Communication
HART_CMD12
Function block X
Function
WagoLibHART_02.lib
mod_com.lib
750-841; 750-842; 750-833;
Program
xReset
Outputparameters:
dwError
sStatus
sMessage
STRING
STRING
(32)
HART_CMD12
Graphic display:
Function description:
The HART_CMD12 "Read message".
The function block sends a HART command 12 request to a HART device and
processes the response.
RequestData:
None
ResponseData:
023
18 WagoLibHART_02.lib
ml03801e
-> Type:(A)
WAGO-I/O-PRO 32
HART_CMD13
WAGO-I/O-PRO Library elements
Category:
Name:
Type:
Library name:
Used Libraries
Applicable to:
Inputparameters:
bModule
bChannel
In-/Out parameters:
xStart
Communication
HART_CMD13
Function block X
Function
WagoLibHART_02.lib
mod_com.lib
750-841; 750-842; 750-833;
Program
xReset
Outputparameters:
dwError
sStatus
stData
STRING
tHART_
CMD13
HART_CMD13
Graphic display:
Function description:
The HART_CMD13 "Read tag, descriptor and date".
The function block sends a HART command 13 request to a HART device and
processes the response.
RequestData:
None
ResponseData:
0-5
-> Unit tag(8 Characters)
6-17
-> Unit description(16 Characters)
18-20 -> Unit date
20 WagoLibHART_02.lib
ml03801e
-> Type:(A)
-> Type:(A)
-> Type:(D)
WAGO-I/O-PRO 32
HART_CMD14
WAGO-I/O-PRO Library elements
Category:
Name:
Type:
Library name:
Used Libraries
Applicable to:
Inputparameters:
bModule
bChannel
In-/Out parameters:
xStart
Communication
HART_CMD14
Function block X
Function
WagoLibHART_02.lib
mod_com.lib
750-841; 750-842; 750-833;
Program
xReset
Outputparameters:
dwError
sStatus
stData
STRING
tHART_
CMD14
HART_CMD14
Graphic display:
Function description:
The HART_CMD14 "Read sensor serial number,Units code for sensor limits and
minimum span, Upper sensor limit, Lower sensor limit, Minimum span".
The function block sends a HART command 14 request to a HART device and
processes the response.
RequestData:
None
ResponseData:
0-2
->
3
->
4-7
8-11
12-15
22 WagoLibHART_02.lib
->
->
->
ml03801e
->
->
-> Type:(F)
-> Type:(F)
-> Type:(F)
WAGO-I/O-PRO 32
HART_CMD15
WAGO-I/O-PRO Library elements
Category:
Name:
Type:
Library name:
Used Libraries
Applicable to:
Inputparameters:
bModule
bChannel
In-/Out parameters:
xStart
Communication
HART_CMD15
Function block X
Function
WagoLibHART_02.lib
mod_com.lib
750-841; 750-842; 750-833;
Program
xReset
Outputparameters:
dwError
sStatus
stData
STRING
tHART_
CMD15
HART_CMD15
Graphic display:
Function description:
The HART_CMD15 "Read output information".
The function block sends a HART command 15 request to a HART device and
processes the response.
RequestData:
None
ResponseData:
0
1
2
3-6
7-10
11-14
15
16
24 WagoLibHART_02.lib
ml03801e
-> Type:(F)
-> Type:(F)
-> Type:(F)
WAGO-I/O-PRO 32
HART_CMD16
WAGO-I/O-PRO Library elements
Category:
Name:
Type:
Library name:
Used Libraries
Applicable to:
Inputparameters:
bModule
bChannel
In-/Out parameters:
xStart
Communication
HART_CMD16
Function block X
Function
WagoLibHART_02.lib
mod_com.lib
750-841; 750-842; 750-833;
Program
xReset
Outputparameters:
dwError
sStatus
dwFinalAssembly
Number
STRING
DWORD
HART_CMD16
Graphic display:
Function description:
The HART_CMD16 "Read final assembly number".
The function block sends a HART command 16 request to a HART device and
processes the response.
RequestData:
None
ResponseData:
02
-> Final assembly number
26 WagoLibHART_02.lib
ml03801e
-> Type:?
WAGO-I/O-PRO 32
HART_CMD17
WAGO-I/O-PRO Library elements
Category:
Name:
Type:
Library name:
Used Libraries
Applicable to:
Inputparameters:
bModule
bChannel
sMessage
In-/Out parameters:
xStart
Communication
HART_CMD17
Function block X
Function
WagoLibHART_02.lib
mod_com.lib
750-841; 750-842; 750-833;
Program
xReset
Outputparameters:
dwError
sStatus
STRING
HART_CMD17
Graphic display:
Function description:
The HART_CMD17 "Write message".
The function block sends a HART command 17 request to a HART device and
processes the response.
RequestData:
023 -> Message (32 characters)
ResponseData:
As in request
28 WagoLibHART_02.lib
ml03801e
-> Type:(A)
WAGO-I/O-PRO 32
HART_CMD18
WAGO-I/O-PRO Library elements
Category:
Name:
Type:
Library name:
Used Libraries
Applicable to:
Inputparameters:
bModule
bChannel
stData
In-/Out parameters:
xStart
Communication
HART_CMD18
Function block X
Function
WagoLibHART_02.lib
mod_com.lib
750-841; 750-842; 750-833;
Program
xReset
Outputparameters:
dwError
sStatus
STRING
HART_CMD18
Graphic display:
Function description:
The HART_CMD18 Write tag, descriptor and date.
The function block sends a HART command 18 request to a HART device and
processes the response.
RequestData:
0-5
-> Unit tag(8 Characters)
6-17
-> Unit description(16 Characters)
18-20 -> Unit date
ResponseData:
As in request
30 WagoLibHART_02.lib
ml03801e
-> Type:(A)
-> Type:(A)
-> Type:(D)
WAGO-I/O-PRO 32
HART_CMD19
WAGO-I/O-PRO Library elements
Category:
Name:
Type:
Library name:
Used Libraries
Applicable to:
Inputparameters:
bModule
bChannel
dwFinalAssembly
number
In-/Out parameters:
xStart
Communication
HART_CMD19
Function block X
Function
WagoLibHART_02.lib
mod_com.lib
750-841; 750-842; 750-833;
Program
xReset
Outputparameters:
dwError
sStatus
STRING
HART_CMD19
Graphic display:
Function description:
The HART_CMD19 "Write final assembly number".
The function block sends a HART command 19 request to a HART device and
processes the response.
RequestData:
02
-> Final assembly number
ResponseData:
As in request
32 WagoLibHART_02.lib
ml03801e
-> Type:?
WAGO-I/O-PRO 32
HART_CMDCustom
WAGO-I/O-PRO Library elements
Category:
Name:
Type:
Library name:
Used Libraries
Applicable to:
Inputparameters:
bModule
bChannel
bHART_CMD
In-/Out parameters:
xStart
xReset
abData
bDataCount
Communication
HART_CMDCustom
Function block X
Function
WagoLibHART_02.lib
mod_com.lib
750-841; 750-842; 750-833;
Program
Outputparameters:
dwError
sStatus
STRING
HART_CMDCustom
Graphic display:
Function description:
The functionblock "HART_CMDCustom" allows the execution of any HART_CMD.
The function block sends a HART command request to a HART device and returns
the response as array of byte.
The interpretation of the response falls into the scope of user.
34 WagoLibHART_02.lib
ml03801e
WAGO-I/O-PRO 32