Hart commands, Hart commands -8 – Rockwell Automation 1797-OE8H FLEX Ex HART Analog Modules User Manual User Manual
Page 22

Publication 1797-6.5.3 - March 2006
1-8 About the FLEX Ex HART Analog Modules
HART Commands
Building a usable HART command for the MSG instruction involves an
understanding of how to create a standard HART command plus the
additional knowledge of how to pack the message into a ControlNet frame. To
simplify this process, you can download the ladder-logic program discussed
here at http://www.ab.com/io. This ladder-logic program consists of a main
program and several subroutines. Modify the main program to meet your
application needs.
The first routine is HART_initialize. Use this routine after a power cycle or
reset to enable HART functionality on a specific FLEX Ex HART module and
to rebuild the associated HART loops to its field device(s). Once a FLEX Ex
HART module is initialized, it remembers the HART addresses of the field
devices and associates them to their corresponding analog channel. This
routine calls the Get_Status_with_retry subroutine to poll an answer from the
target I/O module.
The second routine is Send_Hart_SF. This routine accepts a generic HART
message to a specific I/O channel and returns a generic HART response. This
routine calls the Get_Message_with_retry subroutine to poll a response from
the target I/O module.
The third routine is Purge. If a communication error is found, this routine is
called to empty the HART buffer in the FLEX Ex HART I/O module.
Use the remaining routines to execute specific HART commands. Each
routine is dedicated to its associated HART command. For example, the
HART_CMD_3 issues a HART command 3 to the specified target device.
To issue a HART command, after the FLEX Ex HART I/O module is
initialized, fill the tag HART_Target with the associated information to
uniquely describe the path to the target. If the HART command requires
information to be send to the target device, then fill a second tag with the
appropriate information.
For example, to send a HART command 3, fill the HART_Target tag. As this
is a HART read command, no other information is necessary. To
send a
HART command 35, fill the HART_Target tag. As this is a HART write
command, also fill the CMD35_cmd tag with appropriate data.