Spectrum Controls 1769sc-HART Modules User Manual
Page 48
Compact IO™ Isolated HART Analog Output Module
User’s Manual 0300217-03 Rev. A
5-6
Section 5.3
Using the
Ladder Sample
To get started we recommend that you use the provided MicroLogix 1500 sample project.
Refer to Chapter 8 for the sample project or visit our website at
(
www.spectrumcontrols.com
).
The sample project contains nine different subroutines which are used to perform various
HART related tasks. The following list describes the function of each subroutine within
the project file.
Table 5-1 (Ladder Routines)
Routine Description
MAIN
The main routine is the starting point for the ladder
program.
PACKETS
The “packets” routine is used to demultiplex the HART
data from the input file to individual integer files, so that
the data can be viewed or used within the ladder program.
This routine is called from the MAIN routine.
MSG_TO_MOD
This routine is used to send and receive messages to and
from the module. Refer to Chapter 7 for more details
regarding sending and receiving messages. This routine is
called from the HART_MSG routine.
SRC_CHECK
Calculates the checksum for a message sent to the module
one page at a time. This routine is called from the
MSG_TO_MOD routine.
DEST_CHECKSUM
This routine calculates the checksum for a message
received from the module one page at a time. This routine
is called from the MSG_TO_MOD routine.
HART_MSG
This routine composes HART messages that will be sent to
the module/field transmitter. This routine is called from
the MAIN routine.
WORD_BYTE
Converts word data to its byte equivalent. This routine is
called from the HART_MSG routine.
HART_CHECK
Calculates the checksum for the HART message being sent
to the module/field device. This routine is called from the
HART_MSG routine.
BYTE_WORD
Converts byte data to its word equivalent. This routine is
called by the HART_MSG routine.
You have the choice to either use the sample project or copy and past the pieces you need
from the project.
5.3.1 Copying Subroutines from the Sample Project
To copy subroutines from the sample project to your project, follow the steps below:
1. Open the sample project and your project.
2. Select the subroutine you wish to copy.
3. Right mouse click and select copy.
4. Go to your project and select where you would like to place the new routine.