You are on page 1of 120

Customized Function Blocks for

DataSite
Catalog Numbers 1758-FLO301, 1758-FLO302, 1758-
RTU201, 1758-RTU202
Reference Manual
Important User Information
Solid state equipment has operational characteristics differing from those of electromechanical equipment. Safety Guidelines for the Application,
Installation and Maintenance of Solid State Controls (publication SGI-1.1 available from your local Rockwell Automation sales office or online at
http://literature.rockwellautomation.com) describes some important differences between solid state equipment and hard-wired electromechanical
devices. Because of this difference, and also because of the wide variety of uses for solid state equipment, all persons responsible for applying this
equipment must satisfy themselves that each intended application of this equipment is acceptable.

In no event will Rockwell Automation, Inc. be responsible or liable for indirect or consequential damages resulting from the use or application of this
equipment.

The examples and diagrams in this manual are included solely for illustrative purposes. Because of the many variables and requirements associated
with any particular installation, Rockwell Automation, Inc. cannot assume responsibility or liability for actual use based on the examples and
diagrams.

No patent liability is assumed by Rockwell Automation, Inc. with respect to use of information, circuits, equipment, or software described in this
manual.

Reproduction of the contents of this manual, in whole or in part, without written permission of Rockwell Automation, Inc., is prohibited.

Throughout this manual, when necessary, we use notes to make you aware of safety considerations.

WARNING
Identifies information about practices or circumstances that can cause an explosion in a hazardous environment, which may
lead to personal injury or death, property damage, or economic loss.

IMPORTANT Identifies information that is critical for successful application and understanding of the product.

ATTENTION
Identifies information about practices or circumstances that can lead to: personal injury or death, property damage, or
economic loss. Attentions help you identify a hazard, avoid a hazard, and recognize the consequence.

SHOCK HAZARD
Labels may be on or inside the equipment, such as a drive or motor, to alert people that dangerous voltage may be present.

BURN HAZARD
Labels may be on or inside the equipment, such as a drive or motor, to alert people that surfaces may reach dangerous
temperatures.

Allen-Bradley, Datasite, Rockwell Automation, and TechConnect are trademarks of Rockwell Automation, Inc.

Trademarks not belonging to Rockwell Automation are property of their respective companies.
Table of Contents
Table of Contents Preface
Who Should Use this Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Purpose of this Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Related Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Chapter 1
Customized Function Blocks for B_AERR_CLR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1758-RTU Controllers B_ERR_CLR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
B_ERR_GET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
BIT_EXPAND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
BIT_MERGE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
BLOCK_ADD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
BLOCK_CLR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
CAL_LINE_N . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
CAL_LINE_X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
CLOCK_GET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
CLOCK_SET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
COM_MSG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
COM_MSG_STATUS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
COM_US_CFG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
COM_US_SET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
EN_LED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
EN_NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
EN_RS485 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
EV_CALE_CFG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
EV_CLK_CFG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
EV_GET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
EV_RTC_SET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
EV_SEC_CFG. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
EV_TIME_CFG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
HARTB_ADD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
HARTB_AEC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
HARTB_CLR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
HARTB_EC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
HARTB_EG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
HARTT_CFG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
HARTT_ST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
PW_SHDN. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
REG_MOVE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
REG_R_REAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
REG_R_STR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
REG_R_UDINT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
REG_R_UINT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
REG_W_REAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
REG_W_STR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
REG_W_UDINT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
REG_W_UINT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

3 Publication 1758-RM001C-EN-P - October 2010


4 Table of Contents

SWAP_DWORD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
SWAP_WORD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
SYS_AD_GET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
SYS_ERR_GET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
SYS_ERR_RST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

Chapter 2
Customized Function Blocks for B_AERR_CLR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
1758-FLO Controllers B_ERR_CLR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
B_ERR_GET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
BIT_EXPAND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
BIT_MERGE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
BLOCK_ADD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
BLOCK_CLR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
COM_MSG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
COM_MSG_STATUS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
COM_US_CFG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
COM_US_SET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
CAL_LINE_N . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
CAL_LINE_X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
CLOCK_GET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
CLOCK_SET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
EN_LED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
EN_NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
EN_RS485 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
ENRON_CFG. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
GET_3_PARA. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
GET_7_PARA. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
GET_C_ALL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
GET_C_TIME. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
GET_C_TODAY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
GET_C_YESTERDAY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
GET_ENG_VAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
GET_FLOW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
GET_GX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
GET_MR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
HARTB_ADD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
HARTB_AEC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
HARTB_CLR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
HARTB_EC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
HARTB_EG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
HARTT_CFG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
HARTT_ST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
PW_SHDN. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
REG_MOVE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
REG_R_REAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

Publication 1758-RM001C-EN-P - October 2010


Table of Contents 5

REG_R_STR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
REG_R_UDINT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
REG_R_UINT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
REG_W_REAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
REG_W_STR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
REG_W_UDINT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
REG_W_UINT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
SWAP_DWORD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
SWAP_WORD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
SYS_AD_GET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
SYS_ERR_GET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
SYS_ERR_RST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117

Publication 1758-RM001C-EN-P - October 2010


6 Table of Contents

Publication 1758-RM001C-EN-P - October 2010


Preface

Read this preface to familiarize yourself with the rest of the manual. It provides
information concerning:

• who should use this manual


• the purpose of this manual
• related documentation

Who Should Use this Use this manual if you are responsible for programming or troubleshooting
DataSite controllers.
Manual
You should have a basic understanding of electrical circuitry and familiarity
with relay logic. If you do not, obtain the proper training before using this
product.

Purpose of this Manual This manual is a reference guide that describes the customized function blocks
you can use in DataSite Workbench for programming DataSite controllers.

Related Documentation The publications listed in this table contain more information on the DataSite
controllers.

Related publications for DataSite controllers

Pub. Title Pub. Number Description


DataSite Electronic Flow Meter and Remote Terminal Unit 1758-IN001 Information on how to install a DataSite controller.
Installation Instructions
DataSite Electronic Flow Meter and Remote Terminal Unit 1758-UM001 Information on how to install and wire a DataSite controller.
Hardware User Manual
DataSite Electronic Flow Meter and Remote Terminal Unit 1758-UM002 Information on how to install and use the software tools,
Software User Manual DS Settings, DS FloConfig, and DS DNP3 to configure and
monitor DataSite controllers.
DataSite Screen Builder user documentation available on — Information on using the DataSite Screen Builder to create
the DataSite CD and from http://www.isagraf.com graphical user interfaces.
DataSite Workbench user documentation available on the — Information on using the DataSite Workbench to develop
DataSite CD and from http://www.isagraf.com multi-process control projects for use with DataSite
controllers.
Modbus Protocol Specifications available from — Information about the Modbus protocol.
www.modbus.org
Allen-Bradley Programmable Controller Grounding and 1770-4.1 In-depth information on grounding and wiring Allen-Bradley
Wiring Guidelines programmable controllers.
Application Considerations for Solid-State Controls SGI-1.1 A description of important differences between solid-state
programmable controller products and hard-wired
electromechanical devices.

7 Publication 1758-RM001C-EN-P - October 2010


8

Related publications for DataSite controllers (Continued)

Pub. Title Pub. Number Description


National Electrical Code - Published by the National Fire — An article on wire sizes and types for grounding electrical
Protection Association of Boston, MA. equipment.
Allen-Bradley Publication Index SD499 — A complete listing of current documentation, including
ordering instructions. Also indicates whether the
documents are available on CD-ROM or in multi-languages.
Allen-Bradley Industrial Automation Glossary AG-7.1 A glossary of industrial automation terms and
abbreviations.

You can view or download publications at


http://literature.rockwellautomation.com. To order paper copies of technical
documentation, contact your local Rockwell Automation distributor or sales
representative.

Publication 1758-RM001C-EN-P - October 2010


Chapter 1

Customized Function Blocks for 1758-RTU


Controllers

This chapter provides information on the customized function blocks you can
use in DataSite Workbench for programming the 1758-RTU DataSite
controllers.

B_AERR_CLR Function

Clear all the scan setting errors.

Statement Instance

B_AERR_CLR

44642

TIP The function block B_AERR_CLR executes the same


function as the Clear Error function in the Scan Settings of
the DS Settings tool. For more information, refer to the
DataSite Software User Manual, publication 1758-UM002.

9 Publication 1758-RM001C-EN-P - October 2010


10 Customized Function Blocks for 1758-RTU Controllers

B_ERR_CLR Function

Clear the corresponding scan block configuration error.

Statement Instance

B_ERR_CLR
NUM

44643

Parameter Explanation

B_ERR_CLR parameter explanation

Input Return Data Type Description Parameter Value


NUM — UINT Scan data block number —

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 11

B_ERR_GET Function

Get the corresponding scan block configuration error.

Statement Instance

B_ERR_GET

ERR
NUM

CON

44644

Parameter Explanation

B_ERR_GET parameter explanation

Input Return Data Type Description Parameter Value


NUM — UINT Scan data block number —
— ERR UINT Error of scan block 0: Normal
1: Communication error
— CON UINT Count of scan block Error count
communication errors.

If you encounter a communication error, check the connection between the


port and the instrument, and the parameter settings of the scan block.

Publication 1758-RM001C-EN-P - October 2010


12 Customized Function Blocks for 1758-RTU Controllers

BIT_EXPAND Function

Bit manipulation operations. One word is expanded to 16 bits.

Statement Instance

BIT_EXPAND
B00
B01
B02
B03
B04
B05
B06
B07
IN
B08
B09
B10
B11
B12
B13
B14
B15 44955

Parameter Explanation

BIT_EXPAND parameter explanation

Input Return Data Type Description Parameter Value


IN — WORD Input value —
— B00 BOOL Bit value 0 or 1
— B01 BOOL Bit value 0 or 1
— B02 BOOL Bit value 0 or 1
— B03 BOOL Bit value 0 or 1
— B04 BOOL Bit value 0 or 1
— B05 BOOL Bit value 0 or 1
— B06 BOOL Bit value 0 or 1
— B07 BOOL Bit value 0 or 1
— B08 BOOL Bit value 0 or 1
— B09 BOOL Bit value 0 or 1
— B10 BOOL Bit value 0 or 1

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 13

BIT_EXPAND parameter explanation (Continued)

Input Return Data Type Description Parameter Value


— B11 BOOL Bit value 0 or 1
— B12 BOOL Bit value 0 or 1
— B13 BOOL Bit value 0 or 1
— B14 BOOL Bit value 0 or 1
— B15 BOOL Bit value 0 or 1

Publication 1758-RM001C-EN-P - October 2010


14 Customized Function Blocks for 1758-RTU Controllers

BIT_MERGE Function

Bit manipulation operations. 16 bits are merged into one word.

Statement Instance

BIT_MERGE
B00
B01
B02
B03
B04
B05
B06
B07
VAL
B08
B09
B10
B11
B12
B13
B14
B15
44956

Parameter Explanation

BIT_MERGE parameter explanation

Input Return Data Type Description Parameter Value


B00 — BOOL Bit value 0 or 1
B01 — BOOL Bit value 0 or 1
B02 — BOOL Bit value 0 or 1
B03 — BOOL Bit value 0 or 1
B04 — BOOL Bit value 0 or 1
B05 — BOOL Bit value 0 or 1
B06 — BOOL Bit value 0 or 1
B07 — BOOL Bit value 0 or 1
B08 — BOOL Bit value 0 or 1
B09 — BOOL Bit value 0 or 1
B10 — BOOL Bit value 0 or 1
B11 — BOOL Bit value 0 or 1

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 15

BIT_MERGE parameter explanation (Continued)

Input Return Data Type Description Parameter Value


B12 — BOOL Bit value 0 or 1
B13 — BOOL Bit value 0 or 1
B14 — BOOL Bit value 0 or 1
B15 — BOOL Bit value 0 or 1
— VAL WORD Output value —

Publication 1758-RM001C-EN-P - October 2010


16 Customized Function Blocks for 1758-RTU Controllers

BLOCK_ADD Function

Add scan block.

Statement Instance

BLOCK_ADD
PORT

ADR

SIG

TIME
B_NO
M

NUM

44646

Parameter Explanation

BLOCK_ADD parameter explanation

Input Return Data Type Description Parameter Value


PORT — UINT Select COM port 1: COM1
2: COM2
ADR — UINT Module address 0…247
SIG — UINT Signal type 1: Read coil register
2: Read state register
3: Read hold register
4: Read input register
5: Write 1Coil Register
6: Write 1Hold Register
15: Write multi-coil register
16: Write multi-hold register

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 17

BLOCK_ADD parameter explanation (Continued)

Input Return Data Type Description Parameter Value


TIME — UINT Scan time Bits 7 through 0

Bits 7 through 5 indicate the


time unit as follows:

Bit 7 Bit 6 Bit 5 Time units


0 0 0 50 ms
0 0 1 500 ms
0 1 0 5s
0 1 1 50 s
1 0 0 5 min
1 0 1 50 min
1 1 0 5h
1 1 1 50 h

Bits 4 through 0 indicate the


time value. Range is 1…9.
M — UINT Master address —
S — UINT Slave address —
NUM — UINT Number of —
registers
— B_NO UINT Data block number —

TIP The function block BLOCK_ADD executes the same


function as the Edit function in the Scan Settings of the
DS Settings tool. For more information, refer to the
DataSite Software User Manual, publication 1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


18 Customized Function Blocks for 1758-RTU Controllers

BLOCK_CLR Function

Clear all scan block configuration.

Statement Instance

BLOCK_CLR

44645

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 19

CAL_LINE_N Function

Perform a linear calculation to transform the engineering value X to the


standard value N.

Engineering algorithm N=(X-X0)*(N1-N0)/(X1-X0)+N0

where

N1: maximum standard value


N0: minimum standard value
X1: maximum engineering value
X0: minimum engineering value

Statement Instance

CAL_LINE_N
X

X1

X0
N
N1

N0

44641

Parameter Explanation

CAL_LINE_N parameter explanation

Input Return Data Type Description


X — REAL Engineering value
X1 — REAL Maximum engineering value
X0 — REAL Minimum engineering value
N1 — UINT Maximum standard value
N0 — UINT Minimum standard value
— N UINT Standard value

Publication 1758-RM001C-EN-P - October 2010


20 Customized Function Blocks for 1758-RTU Controllers

CAL_LINE_X Function

Perform a linear calculation to transform the standard value N to the


engineering value X.

Engineering Algorithm: X=(X1-X0)*(N-N0)/(N1-N0)+X0

where

N1: the maximum standard value


N0: the minimum standard value
X1: the maximum engineering value
X0: the minimum engineering value

Statement Instance

CAL_LINE_X
N

N1

N0
X
X1

X0

44640

Parameter Explanation

CAL_LINE_X parameter explanation

Input Return Data Type Description


N — UINT Standard value
N1 — UINT Maximum standard value
N0 — UINT Minimum standard value
X1 — REAL Maximum engineering value
X0 — REAL Minimum engineering value
— X REAL Engineering value

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 21

CLOCK_GET Function

Get the system time.

Statement Instance

CLOCK_GET
HOUR

MINU

SEC

YEAR

MON

DAY

WEEK

44647

Parameter Explanation

CLOCK_GET parameter explanation

Input Return Data Type Description Parameter Value


— HOUR UINT Hour 00…23
— MINU UINT Minute 00…59
— SEC UINT Second 00…59
— YEAR UINT Year 00…99
— MON UINT Month 01…12
— DAY UINT Day 01…31
— WEEK UINT Week 01…07

Publication 1758-RM001C-EN-P - October 2010


22 Customized Function Blocks for 1758-RTU Controllers

CLOCK_SET Function

Set the system clock.

Statement Instance

CLOCK_SET
SET
HOUR
MINU
SEC
YEAR
MON
DAY
WEEK
44648

Parameter Explanation

CLOCK_SET parameter explanation

Input Return Data Type Description Parameter Value


SET — UINT Enable setting 1: Enable
0: Disable
HOUR — UINT Hour 00…23
MINU — UINT Minute 00…59
SEC — UINT Second 00…59
YEAR — UINT Year 00…99
MON — UINT Month 01…12
DAY — UINT Day 01…31
WEEK — UINT Week 01…07

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 23

COM_MSG Function

Trigger a scan via the COM port.

Statement Instance

COM_MSG
EN

PORT

ADR

SIG

NUM
44957

Parameter Explanation

COM_MSG parameter explanation

Input Return Data Type Description Parameter Value


EN — BOOL Enable or disable 0: Disable
1: Enable
PORT — BYTE Select the COM port 1: COM1
2: COM2
ADR — BYTE Address for slave station 1…247
SIG — BYTE Modbus command 1: Read coil register
2: Read state register
3: Read hold register
4: Read input register
5: Write 1Coil Register
6: Write 1Hold Register
15: Write multi-coil register
16: Write multi-hold register
M — UINT Address for master —
S — UINT Address for slave —
NUM — UINT Total numbers for exchange 1…120

Publication 1758-RM001C-EN-P - October 2010


24 Customized Function Blocks for 1758-RTU Controllers

COM_MSG_STATUS Function

Get status of the COM0 or COM1 message block.

Statement Instance

COM_MSG_STATUS
TYPE STAT
44958

Parameter Explanation

COM_MSG_STATUS parameter explanation

Input Return Data Type Description Parameter Value


TYPE — BYTE COM port number 1: COM1
2: COM2
— STAT BYTE Status of the 0: COM_MSG configuration OK
COM_MSG 1: COM_MSG trigger on (in
function block progress)
return value 2: COM_MSG trigger OK
(completed)
3: COM_MSG configuration
error
255: COM_MSG trigger error

If you encounter a communication error, check the connection between the


COM port and the DataSite controller or an equivalent device, and the settings
for the COM_MSG function block.

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 25

COM_US_CFG Function

Configure the serial port (COM1 and COM2) parameter.

Statement Instance

COM_US_CFG
ID

SET
45586

Parameter Explanation

COM_US_CFG parameter explanation

Input Return Data Type Description Parameter Value


ID — BYTE Input value 1: COM1
2: COM2
SET — USART_CFG Serial port parameter

USART_CFG Data type


STRUCT
STATION UINT 1…247, Slave device Module Address
PROTOCOL UINT 1: MODBUS RTU protocol,
2: MODBUS ASCII protocol
STATE UINT 0: Slave,
1: Master
DUPLEX UINT 0: Full-duplex,
1: Half-duplex
BAUD UDINT 2400,4800,9600,14400,19200,38400,
56000,57600,115200, Baud Rate
PARITY UINT 0: EVEN,
1: ODD,
4: NONE
DATA_BITS UINT 2: 7 data bits,
3: 8 data bits
STOP_BITS UINT 0: 1 stop bit
2: 2 stop bits
PORT_TYPE UINT 0: RS232
1: RS485
TIMEOUT UINT 1…1000, in 10ms units
TIMEDELAY UINT 1…300, in 10ms units
END_STRUCT

Publication 1758-RM001C-EN-P - October 2010


26 Customized Function Blocks for 1758-RTU Controllers

COM_US_SET Function

Activate the parameter for serial port (COM1 and COM2).

Statement Instance

COM_US_SET
ID
45587

Parameter Explanation

COM_US_CFG parameter explanation

Input Return Data Type Description Parameter Value


ID — BYTE The serial port to be 1: COM1
activated 2: COM2

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 27

EN_LED Function

Enable LED power supply.

Statement Instance

EN_LED
EN

44638

Parameter Explanation

EN_LED parameter explanation

Input Return Data Type Description Parameter Value


EN None BOOL LED power supply 0: Disable LED power supply
enable indication 1: Enable LED power supply

TIP This function is similar to the Power Enable setting for


controller communication settings in DS Settings. For more
information, refer to the DataSite Software User Manual,
publication 1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


28 Customized Function Blocks for 1758-RTU Controllers

EN_NET Function

Enable Ethernet power supply.

Statement Instance

EN_NET
EN

44637

Parameter Explanation

EN_NET parameter explanation

Input Return Data Type Description Parameter Value


EN None BOOL Ethernet power 0: Disable Ethernet power supply
supply enable 1: Enable Ethernet power supply
indication

TIP This function is similar to the Power Enable setting for


controller communication settings in DS Settings. For more
information, refer to the DataSite Software User Manual,
publication 1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 29

EN_RS485 Function

Enable RS485 power supply.

Statement Instance

EN_RS485
EN

44636

Parameter Explanation

EN_RS485 parameter explanation

Input Return Data Type Description Parameter Value


EN None BOOL RS485 power supply 0: Disable RS485 power supply
enable indication 1: Enable RS485 power supply

TIP This function is similar to the Power Enable setting for


controller communication settings in DS Settings. For more
information, refer to the DataSite Software User Manual,
publication 1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


30 Customized Function Blocks for 1758-RTU Controllers

EV_CALE_CFG Function

Configure the calendar event parameters.

Use this function block together with the function block EV_RTC_SET to
configure a calendar event. EV_RTC_SET is used to enable settings in the
CFG function blocks based on the real-time clock.

Statement Instance

EV_CALE_CFG
ENAB

MODE

44651

Parameter Explanation

EV_CALE_CFG parameter explanation

Input Return Data Type Description Parameter Value


ENABLE — BOOL Calendar Event TRUE
Enable symbol FALSE
MODE — UINT Calendar Event • 0: Week.
Mode When the week of the real-time clock changes, implement a corresponding
time interrupt task at 0 seconds, 0 minutes, 0 hours, Monday, every week.
• 1: Month.
When the month of the real-time clock changes, implement a corresponding
time interrupt task at 0 seconds, 0 minutes, 0 hours, the first day, every
month.
• 2: Year.
When the year of the real-time clock changes, Implement a corresponding
time interrupt task at 0 seconds, 0 minutes, 0 hours, January 1, every year.

TIP Using EV_CALE_CFG and EV_RTC_SET is equivalent


to setting the Calendar Event configuration in the Event
Settings of the DS Settings tool. For more information,
refer to the DataSite Software User Manual, publication
1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 31

EV_CLK_CFG Function

Configure the alarm event parameters.

Use this function block together with the function block EV_RTC_SET to
configure an alarm event. EV_RTC_SET is used to enable settings in the CFG
function blocks based on the real-time clock.

Statement Instance

EV_CLK_CFG
EN

MON

DAY

HOUR

MIN

SEC

44652

Parameter Explanation

EV_CLK_CFG parameter explanation

Input Return Data Type Description Parameter Value


EN — UINT The Enable setting of an Bit 7: Enable bit of an Alarm event. TRUE for Enable, and FALSE for
alarm event Disable. When bit 7 is FALSE, bit 0…bit 4 settings are all invalid.
Bit 0: Bit for value of seconds of an Alarm event. 1 for Enable, and
0 for Disable.
Bit 1: Bit for value of minutes of an Alarm event. 1 for Enable, and
0 for Disable.
Bit 2: Bit for value of hours of an Alarm event. 1 for Enable, and 0
for Disable.
Bit 3: Bit for value of day of an Alarm event. 1 for Enable, and 0 for
Disable.
Bit 4: Bit for value of month of an Alarm event. 1 for Enable, and 0
for Disable.
MON — UINT The Month value of an alarm 1…12
event.
DAY — UINT The Day value of an alarm 1…31
event.

Publication 1758-RM001C-EN-P - October 2010


32 Customized Function Blocks for 1758-RTU Controllers

EV_CLK_CFG parameter explanation (Continued)

Input Return Data Type Description Parameter Value


HOUR — UINT The Hour value of an alarm 0…23
event.
MIN — UINT The Minute value of an 0…59
alarm event.
SEC — UINT The Second value of an 0…59
alarm event.

TIP Using EV_CLK_CFG and EV_RTC_SET together is


equivalent to setting the Alarm Event configuration in the
Event Settings of the DS Settings tool. For more
information, refer to the DataSite Software User Manual,
publication 1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 33

EV_GET Function

Get the state of system events, RTC events, and second-based events.

Statement Instance

EV_GET
SYS

RTC

RTCN

44796

Parameter Explanation

EV_GET parameter explanation

Input Return Data Type Description Parameter Value


— SYS UINT System event Symbol

Bit 0: Power-on reset event


Bit 1: Watchdog reset event
Bit 2: Check-time event
— RTC UINT RTC event RTC event symbol

Bit 0: Second-based event


Bit 1: Time event
Bit 2: Calendar event
Bit 3: Alarm event
— RTCN UDINT Number of times —
a second-based
event occurs.

Publication 1758-RM001C-EN-P - October 2010


34 Customized Function Blocks for 1758-RTU Controllers

EV_RTC_SET Function

Enable real-time clock events. That is, to enable all event configurations.

Use this function block to enable settings in the CFG function blocks based
on the real-time clock.

Statement Instance

EV_RTC_SET

44653

TIP Using EV_RTC_SET is equivalent to changing the


configurations in the Event Settings dialog box of the DS
Settings tool. For more information, refer to the DataSite
Software User Manual, publication 1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 35

EV_SEC_CFG Function

Configure an event that has an interval of 1 s.

Use this function block together with the function block EV_RTC_SET to
configure a Time event. EV_RTC_SET is used to enable settings in the CFG
function blocks based on the real-time clock.

Statement Instance

EV_SEC_CFG

EN

44649

Parameter Explanation

EV_SEC_CFG parameter explanation

Input Return Data Type Description Parameter Value


EN — BOOL Second event enable TRUE
symbol FALSE

TIP Using EV_TIME_CFG and EV_RTC_SET is equivalent


to setting the Time Event configuration in the Event
Settings of the DS Settings tool. For more information,
refer to the DataSite Software User Manual, publication
1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


36 Customized Function Blocks for 1758-RTU Controllers

EV_TIME_CFG Function

Configure the time event parameters.

Use this function block together with the function block EV_RTC_SET to
configure a Time event. EV_RTC_SET is used to enable settings in the CFG
function blocks based on the real-time clock.

Statement Instance

EV_TIME_CFG
EN

MODE

44650

Parameter Explanation

EV_TIME_CFG parameter explanation

Input Return Data Type Description Parameter Value


EN — BOOL Time Event TRUE
Enable symbol FALSE
MODE — UINT Time Event Mode • 0: Minute.
When the minute of the real-time clock changes, implement a
corresponding time interrupt task at second 0, every minute.
• 1: Hour.
When the hour of the real-time clock changes, implement a corresponding
time interrupt task at 0 seconds, 0 minutes of every hour.
• 2: Midnight.
Implement a corresponding time interrupt task at 0 seconds, 0 minutes, 0
hours (midnight) every day.
• 3: Midday.
Implement a corresponding time interrupt task at 0 seconds, 0 minutes, 12
hours (noon) every day.

TIP Using EV_TIME_CFG and EV_RTC_SET is equivalent


to setting the Time Event configuration in the Event
Settings of the DS Settings tool. For more information,
refer to the DataSite Software User Manual, publication
1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 37

HARTB_ADD Function

Add HART scan data blocks.

Statement Instance

HARTB_ADD

ID
ADR
CMD
TIME NO
CD
DD
UT
ST

44632

Parameter Explanation

HARTB_ADD parameter explanation

Input Return Data Type Description


ID — UINT Channel number:
0…2
ADR — UINT HART address
0…15
CMD — UINT Command number:
0, 1, 2, 3, 15, 33, 48, 54

Publication 1758-RM001C-EN-P - October 2010


38 Customized Function Blocks for 1758-RTU Controllers

HARTB_ADD parameter explanation (Continued)

Input Return Data Type Description


TIME — UINT Bits 7 through 0

Bits 7 through 5 indicate the


time unit as follows:

Bit 7 Bit 6 Bit 5 Time


units
0 0 0 50 ms
0 0 1 500 ms
0 1 0 5s
0 1 1 50 s
1 0 0 5 min
1 0 1 50 min
1 1 0 5h
1 1 1 50 h

Bits 4 through 0 indicate the


time value. Range is 1…9.
CD — UINT Send register
DD — UINT Return register
UT — UINT Unit register
ST — UINT State register
— NO UINT Data block NUM

TIP Function blocks HARTB_CLR, HARTB_ADD,


HARTB_AEC, HARTB_EC, and HARTB_EG are used in
HART data timing scan. This function is similar to HART
Settings in DS Settings. For more information, refer to the
DataSite Software User Manual, publication 1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 39

HARTB_AEC Function

Clear all the errors of HART scan data blocks.

Statement Instance

HARTB_AEC

44633

TIP Function blocks HARTB_CLR, HARTB_ADD,


HARTB_AEC, HARTB_EC, and HARTB_EG are used in
HART data timing scan. This function is similar to HART
Settings in DS Settings. For more information, refer to the
DataSite Software User Manual, publication 1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


40 Customized Function Blocks for 1758-RTU Controllers

HARTB_CLR Function

Clear all the HART scan data blocks.

Statement Instance

HARTB_CLR

44631

TIP Function blocks HARTB_CLR, HARTB_ADD,


HARTB_AEC, HARTB_EC, and HARTB_EG are used in
HART data timing scan. This function is similar to HART
Settings in the DS Settings tool. For more information,
refer to the DataSite Software User Manual, 1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 41

HARTB_EC Function

Clear errors of the HART scan data block corresponding to the NUM.

Statement Instance

HARTB_EC
NUM

44634

Parameter Explanation

HARTB_EC parameter explanation

Input Data Type Description


NUM UINT Scan data block NUM

TIP Function blocks HARTB_CLR, HARTB_ADD,


HARTB_AEC, HARTB_EC, and HARTB_EG are used in
HART data timing scan. This function is similar to HART
Settings in DS Settings. For more information, refer to the
DataSite Software User Manual, publication 1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


42 Customized Function Blocks for 1758-RTU Controllers

HARTB_EG Function

Get the error state of certain HART scan data block.

Statement Instance

HARTB_EG

ERR
NUM

CON

44635

Parameter Explanation

HARTB_EG parameter explanation

Input Return Data Type Description


NUM — UINT Scan data block NUM
— ERR UINT 0: Normal
1: Communication error
— CON UINT Count of scan block
communication errors.

TIP Function blocks HARTB_CLR, HARTB_ADD,


HARTB_AEC, HARTB_EC, and HARTB_EG are used in
HART data timing scan. This function is similar to HART
Settings in DS Settings. For more information, refer to the
DataSite Software User Manual, publication 1758-UM002.

If you encounter the communication error, check the connection between the
HART port and the HART instrument, and the settings for the HART scan
block.

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 43

HARTT_CFG Function

Configure the triggering of the HART Scan function via the HART channel.

Statement Instance

HARTT_CFG

EN
ID
ADR
CMD
CD
DD
UT
ST
45588

Parameter Explanation

HARTB_ADD parameter explanation

Input Return Data Type Description Parameter Value


EN — BOOL Enable or disable 0: Disable
1: Enable
ID — BYTE HART channel number 0…2
ADR — BYTE HART instrument address 1…247
CMD — BYTE Command numbers 0, 1, 2, 3, 15, 33, 35,
38, 40, 44, 48, 54, 59
CD — UINT Send register —
DD — UINT Return register —
UT — UINT Unit register —
ST — UINT State register —

Publication 1758-RM001C-EN-P - October 2010


44 Customized Function Blocks for 1758-RTU Controllers

HARTT_ST Function

Get the status of the HART trigger block.

Statement Instance

HARTT_ST

ID STAT

45589

Parameter Explanation

HARTT_ST parameter explanation

Input Return Data Description Parameter Value


Type
ID — BYTE HART channel number 0…2
— STAT BYTE status of the 0: HARTT_CFG configuration ok
HARTT_CFG function 1: HARTT_CFG trigger on(in progress)
block return value 2: HARTT_CFG trigger OK (completed)
3: HARTT_CFG configuration error
255: HARTT_CFG trigger error

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 45

PW_SHDN Function

Shut down the controller, and enable or disable the RTC alarm wake-up mode.

Statement Instance

PW_SHDN
RTC

HOUR

MINU
44639
SEC

Parameter Explanation

PW_SHDN parameter explanation

Input Return Data Type Description Parameter Value


RTC — UINT RTC Alarm Wake-Up 0: Shut down, and disable
Mode Enable/Disable RTC alarm wake-up mode
symbol
1: Shut down, and enable
RTC alarm wake-up mode
HOUR — UINT Hour 0…23
MINU — UINT Minute 0…59
SEC — UINT Second 0…59

Publication 1758-RM001C-EN-P - October 2010


46 Customized Function Blocks for 1758-RTU Controllers

REG_MOVE Function

Copy the register data block.

Statement Instance

REG_MOVE
T

NUM

SWAP

44665

Parameter Explanation

REG_MOVE parameter explanation

Input Return Data Type Description Parameter Value


T — UINT Master register address —
R — UINT Slave register address —
NUM — UINT Register number —
SWAP — BOOL The swap sign of float 0: low bits in front
high-low bits 1: high bits in front

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 47

REG_R_REAL Function

Read floating point numbers from the register.

Statement Instance

REG_R_REAL
ADR
OUT
SWAP

44661

Parameter Explanation

REG_R_REAL parameter explanation

Input Return Data Type Description Parameter Value


ADR — UINT Register address —
SWAP — BOOL Swap sign of floating 0: low bits in front
high-low bits 1: high bits in front
— OUT REAL Numerical value —

Publication 1758-RM001C-EN-P - October 2010


48 Customized Function Blocks for 1758-RTU Controllers

REG_R_STR Function

Read string value from the register.

Statement Instance

REG_R_STR
ADR

LEN BUF

SWAP
45590

Parameter Explanation

REG_R_STR parameter explanation

Input Return Data Type Description Parameter Value


ADR — UINT Register address 40003 to 49999
LEN — UINT String lenth 1…254
SWAP — BOOL Swap sign of floating 0: low bits in front
high-low bits 1: high bits in front
— BUF STRING String buffer address —

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 49

REG_R_UDINT Function

Read unsigned long integer from the register.

Statement Instance

REG_R_UDINT
ADR
OUT
SWAP

44663

Parameter Explanation

REG_R_UDINT parameter explanation

Input Return Data Type Description Parameter Value


ADR — UINT Register address —
SWAP — BOOL The swap sign of long 0: low bits in front
integer high-low bits 1: high bits in front
— OUT UDINT Numerical value —

Publication 1758-RM001C-EN-P - October 2010


50 Customized Function Blocks for 1758-RTU Controllers

REG_R_UINT Function

Read unsigned integer from the register.

Statement Instance

REG_R_UINT

ADR OUT

44659

Parameter Explanation

REG_R_UINT

Input Return Data Type Description Parameter Value


ADR — UINT Register address —
— OUT UINT Numerical value —

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 51

REG_W_REAL Function

Write floating point numbers to the register.

Statement Instance

REG_W_REAL
ADR

SWAP

VAL

44662

Parameter Explanation

REG_W_REAL parameter explanation

Input Return Data Type Description Parameter Value


ADR — UINT Register address —
SWAP — BOOL The swap sign of float 0: low bits in front
high-low bits 1: high bits in front
VAL — REAL Numerical value —

Publication 1758-RM001C-EN-P - October 2010


52 Customized Function Blocks for 1758-RTU Controllers

REG_W_STR Function

Write string value into the register.

Statement Instance

REG_W_STR
ADR

BUF

LEN
45591
SWAP

Parameter Explanation

REG_R_STR parameter explanation

Input Return Data Type Description Parameter Value


ADR — UINT Register address 40003 to 49999
BUF — STRING String buffer address —
LEN — UINT String lenth 1…254
SWAP — BOOL Swap sign of floating 0: low bits in front
high-low bits 1: high bits in front

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 53

REG_W_UDINT Function

Write unsigned long integer to the register.

Statement Instance

REG_W_UDINT
ADR

SWAP

VAL

44664

Parameter Explanation

REG_W_UDINT parameter explanation

Input Return Data Type Description Parameter Value


ADR — UINT Register address —
SWAP — BOOL The swap sign of long 0: low bits in front
integer high-low bits 1: high bits in front
VAL — UDINT Numerical value —

Publication 1758-RM001C-EN-P - October 2010


54 Customized Function Blocks for 1758-RTU Controllers

REG_W_UINT Function

Write unsigned integer to the register.

Statement Instance

REG_W_UINT
ADR

VAL

44660

Parameter Explanation

REG_W_UINT

Input Return Data Type Description Parameter Value


ADR — UINT Register address —
VAL — UINT Numerical value —

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 55

SWAP_DWORD Function

Byte manipulation operations. High byte and low byte exchange positions in a
word.

Statement Instance

SWAP_DWORD
IN OUT
44959

Parameter Explanation

SWAP_DWORD parameter explanation

Input Return Data Type Description Parameter Value


IN — DWORD Previous value —
— OUT DWORD New value —

Publication 1758-RM001C-EN-P - October 2010


56 Customized Function Blocks for 1758-RTU Controllers

SWAP_WORD Function

Byte manipulation operations. High byte and low byte exchange positions in a
word.

Statement Instance

SWAP_WORD
IN OUT
44960

Parameter Explanation

SWAP_WORD parameter explanation

Input Return Data Type Description Parameter Value


IN — WORD Previous value —
— OUT WORD New value —

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 57

SYS_AD_GET Function

Read out the integer value and engineering value of the system’s analog/digital
(A/D) conversion.

Statement Instance

SYS_AD_GET
AD_N
CHL
AD_F

44666

Parameter Explanation

SYS_AD_GET parameter explanation

Input Return Data Type Description Parameter Value


CHL — UINT Channel number of 0: reserved
system A/D 1: reserved
2: channel 2 of system A/D for
controller temperature
3: channel 3 of system A/D for
battery voltage
— AD_N UINT Integer value of 0…1024
this A/D channel
— AD_F REAL Engineering value -40…125 °C for controller
of this A/D channel temperature
0…3.60 for battery voltage

TIP The function block SYS_AD_GET retrieves the same


A/D data as that shown in the Debug dialog box in
Controller Debug of the DS Settings tool. An example is
shown here.

For more information, refer to the DataSite Software User


Manual, publication 1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


58 Customized Function Blocks for 1758-RTU Controllers

SYS_ERR_GET Function

Get system errors.

Statement Instance

SYS_ERR_GET

ERR

44667

Parameter Explanation

SYS_ERR_GET parameter explanation

Input Return Data Type Description Parameter Value Possible Solution


— ERR UINT The value of all 0x0001:/*hardware registering error*/ Contact a Rockwell technical
errors (summed) support representative.
0x0002:/*FLASH error*/
0x0100:/*HART error*/ Check the connection between the
HART port and the HART
instrument. In addition, verify the
settings for the HART scan block.
0x0200:/*US1error*/ Check the connection between the
COM1 port and the slave device. In
addition, verify the settings for the
scan block.
0x0400:/*US2 error*/ Check the connection between the
COM2 port and the slave device. In
addition, verify the settings for the
scan block.

For example, ERR=3=0x0001 + 0x0002, means the system errors are


hardware registering error and FLASH error.

TIP The function block SYS_ERR_GET executes the same


function as Error Record function in the Debug dialog box
in Controller Debug of the DS Settings tool. The Error
Record box is shown here.

For more information, refer to the DataSite Software User


Manual, publication 1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-RTU Controllers 59

SYS_ERR_RST Function

Clear all system errors.

Statement Instance

SYS_ERR_RST

44668

TIP The function block SYS_ERR_RST executes the same


function as the Clear Error function in the Debug dialog
box in Controller Debug of the DS Settings tool. For more
information, refer to the DataSite Software User Manual,
publication 1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


60 Customized Function Blocks for 1758-RTU Controllers

Publication 1758-RM001C-EN-P - October 2010


Chapter 2

Customized Function Blocks for 1758-FLO


Controllers

This chapter provides information on the customized function blocks you can
use in DataSite Workbench for programming the 1758-FLO DataSite
controllers.

B_AERR_CLR Function

Clear all the scan setting errors.

Statement Instance

B_AERR_CLR

44642

TIP The function block B_AERR_CLR executes the same


function as the Clear Error function in the Scan Settings of
the DS Settings tool. For more information, refer to the
DataSite Software User Manual, publication 1758-UM002.

61 Publication 1758-RM001C-EN-P - October 2010


62 Customized Function Blocks for 1758-FLO Controllers

B_ERR_CLR Function

Clear the corresponding scan block configuration error.

Statement Instance

B_ERR_CLR
NUM

44643

Parameter Explanation

B_ERR_CLR parameter explanation

Input Return Data Type Description Parameter Value


NUM — UINT Scan data block number —

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 63

B_ERR_GET Function

Get the corresponding scan block configuration error.

Statement Instance

B_ERR_GET

ERR
NUM

CON

44644

Parameter Explanation

B_ERR_GET parameter explanation

Input Return Data Type Description Parameter Value


NUM — UINT Scan data block number —
— ERR UINT Error of scan block 0: Normal
1: Communication error
— CON UINT Count of scan block Error count
communication errors.

If you encounter a communication error, check the connection between the


port and the instrument, and the parameter settings of the scan block.

Publication 1758-RM001C-EN-P - October 2010


64 Customized Function Blocks for 1758-FLO Controllers

BIT_EXPAND Function

Bit manipulation operations. One word is expanded to 16 bits.

Statement Instance

BIT_EXPAND
B00
B01
B02
B03
B04
B05
B06
B07
IN
B08
B09
B10
B11
B12
B13
B14
B15 44955

Parameter Explanation

BIT_EXPAND parameter explanation

Input Return Data Type Description Parameter Value


IN — WORD Input value —
— B00 BOOL Bit value 0 or 1
— B01 BOOL Bit value 0 or 1
— B02 BOOL Bit value 0 or 1
— B03 BOOL Bit value 0 or 1
— B04 BOOL Bit value 0 or 1
— B05 BOOL Bit value 0 or 1
— B06 BOOL Bit value 0 or 1
— B07 BOOL Bit value 0 or 1
— B08 BOOL Bit value 0 or 1
— B09 BOOL Bit value 0 or 1
— B10 BOOL Bit value 0 or 1

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 65

BIT_EXPAND parameter explanation (Continued)

Input Return Data Type Description Parameter Value


— B11 BOOL Bit value 0 or 1
— B12 BOOL Bit value 0 or 1
— B13 BOOL Bit value 0 or 1
— B14 BOOL Bit value 0 or 1
— B15 BOOL Bit value 0 or 1

Publication 1758-RM001C-EN-P - October 2010


66 Customized Function Blocks for 1758-FLO Controllers

BIT_MERGE Function

Bit manipulation operations. 16 bits are merged into one word.

Statement Instance

BIT_MERGE
B00
B01
B02
B03
B04
B05
B06
B07
VAL
B08
B09
B10
B11
B12
B13
B14
B15
44956

Parameter Explanation

BIT_MERGE parameter explanation

Input Return Data Type Description Parameter Value


B00 — BOOL Bit value 0 or 1
B01 — BOOL Bit value 0 or 1
B02 — BOOL Bit value 0 or 1
B03 — BOOL Bit value 0 or 1
B04 — BOOL Bit value 0 or 1
B05 — BOOL Bit value 0 or 1
B06 — BOOL Bit value 0 or 1
B07 — BOOL Bit value 0 or 1
B08 — BOOL Bit value 0 or 1
B09 — BOOL Bit value 0 or 1
B10 — BOOL Bit value 0 or 1
B11 — BOOL Bit value 0 or 1

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 67

BIT_MERGE parameter explanation (Continued)

Input Return Data Type Description Parameter Value


B12 — BOOL Bit value 0 or 1
B13 — BOOL Bit value 0 or 1
B14 — BOOL Bit value 0 or 1
B15 — BOOL Bit value 0 or 1
— VAL WORD Output value —

Publication 1758-RM001C-EN-P - October 2010


68 Customized Function Blocks for 1758-FLO Controllers

BLOCK_ADD Function

Add scan block.

Statement Instance

BLOCK_ADD
PORT

ADR

SIG

TIME
B_NO
M

NUM

44646

Parameter Explanation

BLOCK_ADD parameter explanation

Input Return Data Type Description Parameter Value


PORT — UINT Select COM port 1: COM1
2: COM2
ADR — UINT Module address 0…247
SIG — UINT Signal type 1: Read coil register
2: Read state register
3: Read hold register
4: Read input register
5: Write 1Coil Register
6: Write 1Hold Register
15: Write multi-coil register
16: Write multi-hold register

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 69

BLOCK_ADD parameter explanation (Continued)

Input Return Data Type Description Parameter Value


TIME — UINT Scan time Bits 7 through 0

Bits 7 through 5 indicate the


time unit as follows:

Bit 7 Bit 6 Bit 5 Time units


0 0 0 50 ms
0 0 1 500 ms
0 1 0 5s
0 1 1 50 s
1 0 0 5 min
1 0 1 50 min
1 1 0 5h
1 1 1 50 h

Bits 4 through 0 indicate the


time value. Range is 1…9.
M — UINT Master address —
S — UINT Slave address —
NUM — UINT Number of —
registers
— B_NO UINT Data block number —

TIP The function block BLOCK_ADD executes the same


function as the Edit function in the Scan Settings of the
DS Settings tool. For more information, refer to the
DataSite Software User Manual, publication 1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


70 Customized Function Blocks for 1758-FLO Controllers

BLOCK_CLR Function

Clear all scan block configuration.

Statement Instance

BLOCK_CLR

44645

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 71

COM_MSG Function

Trigger a scan via the COM port.

Statement Instance

COM_MSG
EN

PORT

ADR

SIG

NUM
44957

Parameter Explanation

COM_MSG parameter explanation

Input Return Data Type Description Parameter Value


EN — BOOL Enable or disable 0: Disable
1: Enable
PORT — BYTE Select the COM port 1: COM1
2: COM2
ADR — BYTE Address for slave station 1…247
SIG — BYTE Modbus command 1: Read coil register
2: Read state register
3: Read hold register
4: Read input register
5: Write 1Coil Register
6: Write 1Hold Register
15: Write multi-coil register
16: Write multi-hold register
M — UINT Address for master —
S — UINT Address for slave —
NUM — UINT Total numbers for exchange 1…120

Publication 1758-RM001C-EN-P - October 2010


72 Customized Function Blocks for 1758-FLO Controllers

COM_MSG_STATUS Function

Get status of the COM0 or COM1 message block.

Statement Instance

COM_MSG_STATUS
TYPE STAT
44958

Parameter Explanation

COM_MSG_STATUS parameter explanation

Input Return Data Type Description Parameter Value


TYPE — BYTE COM port number 1: COM1
2: COM2
— STAT BYTE Status of the 0: COM_MSG configuration OK
COM_MSG 1: COM_MSG trigger on (in
function block progress)
return value 2: COM_MSG trigger OK
(completed)
3: COM_MSG configuration
error
255: COM_MSG trigger error

If you encounter a communication error, check the connection between the


COM port and the DataSite controller or an equivalent device, and the settings
for the COM_MSG function block.

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 73

COM_US_CFG Function

Configure the serial port (COM1 and COM2) parameter.

Statement Instance

COM_US_CFG
ID

SET
45586

Parameter Explanation

COM_US_CFG parameter explanation

Input Return Data Type Description Parameter Value


ID — BYTE Input value 1: COM1
2: COM2
SET — USART_CFG Serial port parameter

USART_CFG Data type


STRUCT
STATION UINT 1…247, Slave device Module Address
PROTOCOL UINT 1: MODBUS RTU protocol,
2: MODBUS ASCII protocol
STATE UINT 0: Slave,
1: Master
DUPLEX UINT 0: Full-duplex,
1: Half-duplex
BAUD UDINT 2400,4800,9600,14400,19200,38400,
56000,57600,115200, Baud Rate
PARITY UINT 0: EVEN,
1: ODD,
4: NONE
DATA_BITS UINT 2: 7 data bits,
3: 8 data bits
STOP_BITS UINT 0: 1 stop bit
2: 2 stop bits
PORT_TYPE UINT 0: RS232
1: RS485
TIMEOUT UINT 1…1000, in 10ms units
TIMEDELAY UINT 1…300, in 10ms units
END_STRUCT

Publication 1758-RM001C-EN-P - October 2010


74 Customized Function Blocks for 1758-FLO Controllers

COM_US_SET Function

Activate the parameter for serial port (COM1 and COM2).

Statement Instance

COM_US_SET
ID
45587

Parameter Explanation

COM_US_CFG parameter explanation

Input Return Data Type Description Parameter Value


ID — BYTE The serial port to be 1: COM1
activated 2: COM2

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 75

CAL_LINE_N Function

Perform a linear calculation to transform the engineering value X to the


standard value N.

Engineering algorithm N=(X-X0)*(N1-N0)/(X1-X0)+N0

where

N1: maximum standard value


N0: minimum standard value
X1: maximum engineering value
X0: minimum engineering value

Statement Instance

CAL_LINE_N
X

X1

X0
N
N1

N0

44641

Parameter Explanation

CAL_LINE_N parameter explanation

Input Return Data Type Description


X — REAL Engineering value
X1 — REAL Maximum engineering value
X0 — REAL Minimum engineering value
N1 — UINT Maximum standard value
N0 — UINT Minimum standard value
— N UINT Standard value

Publication 1758-RM001C-EN-P - October 2010


76 Customized Function Blocks for 1758-FLO Controllers

CAL_LINE_X Function

Perform a linear calculation to transform the standard value N to the


engineering value X.

Engineering Algorithm: X=(X1-X0)*(N-N0)/(N1-N0)+X0

where

N1: the maximum standard value


N0: the minimum standard value
X1: the maximum engineering value
X0: the minimum engineering value

Statement Instance

CAL_LINE_X
N

N1

N0
X
X1

X0

44640

Parameter Explanation

CAL_LINE_X parameter explanation

Input Return Data Type Description


N — UINT Standard value
N1 — UINT Maximum standard value
N0 — UINT Minimum standard value
X1 — REAL Maximum engineering value
X0 — REAL Minimum engineering value
— X REAL Engineering value

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 77

CLOCK_GET Function

Get the controller time.

Statement Instance

CLOCK_GET
HOUR

MINU

SEC

YEAR

MON

DAY

WEEK

44647

Parameter Explanation

CLOCK_GET parameter explanation

Input Return Data Type Description Parameter Value


— HOUR UINT Hour 00…23
— MINU UINT Minute 00…59
— SEC UINT Second 00…59
— YEAR UINT Year 00…99
— MON UINT Month 01…12
— DAY UINT Day 01…31
— WEEK UINT Week 01…07

Publication 1758-RM001C-EN-P - October 2010


78 Customized Function Blocks for 1758-FLO Controllers

CLOCK_SET Function

Set the controller clock.

Statement Instance

CLOCK_SET
SET
HOUR
MINU
SEC
YEAR
MON
DAY
WEEK
44648

Parameter Explanation

CLOCK_SET parameter explanation

Input Return Data Type Description Parameter Value


SET — UINT Enable setting, 1 1: Enable
0: Disable
HOUR — UINT Hour 00…23
MINU — UINT Minute 00…59
SEC — UINT Second 00…59
YEAR — UINT Year 00…99
MON — UINT Month 01…12
DAY — UINT Day 01…31
WEEK — UINT Week 01…07

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 79

EN_LED Function

Enable the LED power supply.

Statement Instance

EN_LED
EN

44638

Parameter Explanation

EN_LED parameter explanation

Input Return Data Type Description Description


EN None BOOL LED power supply enable 0: Disable LED power
indication supply
1: Enable LED power
supply

TIP This function is similar to the Power Enable settings in the


Controller Communication Settings dialog box of the DS
Settings tool. For more information, refer to the DataSite
Software User Manual, publication 1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


80 Customized Function Blocks for 1758-FLO Controllers

EN_NET Function

Enable the Ethernet power supply.

Statement Instance

EN_NET
EN

44637

Parameter Explanation

EN_NET parameter explanation

Input Return Data Type Description Parameter Value


EN None BOOL Ethernet power 0: Disable Ethernet power supply
supply enable 1: Enable Ethernet power supply
indication

TIP This function is similar to the Power Enable settings in the


Controller Communication Settings dialog box of the DS
Settings tool. For more information, refer to the DataSite
Software User Manual, publication 1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 81

EN_RS485 Function

Enable the RS485 power supply.

Statement Instance

EN_RS485
EN

44636

Parameter Explanation

EN_RS485 parameter explanation

Input Return Data Type Description Parameter Value


EN None BOOL RS485 power supply 0: Disable RS485 power supply
enable indication 1: Enable RS485 power supply

TIP This function is similar to the Power Enable settings in the


Controller Communication Settings dialog box in the DS
Settings tool. For more information, refer to the DataSite
Software User Manual, publication 1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


82 Customized Function Blocks for 1758-FLO Controllers

ENRON_CFG Function

Configure Enron Modbus communication on serial port.

Statement Instance

ENRON_CFG
ID

EN
45572

STAT

Parameter Explanation

EN_RS485 parameter explanation

Input Return Data Type Description Parameter Value


ID None UINT Serial port number 1: COM1
2: COM2
EN None BOOL Enable or Disable 0: Disable Enron Modbus
Enron Modbus communication
communication 1: Enable Enron Modbus
communication
STAT None UINT Enron Modbus 1…247
station address

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 83

GET_3_PARA Function

Get the process input parameters of the orifice plate (AGA3).

Statement Instance

GET_3_PARA

N AGA3

44669

Parameter Explanation

GET_3_PARA parameter explanation

Input Return Data Type Description Parameter Value


N — UINT Meter number 0…7
— AGA3 AGA3_PARA Structure of process —
parameter

The structure of the process input parameters of the orifice plate (AGA3) is as
follows:

AGA3_PARA
STRUCT
fAGA_Pb : REAL; contract base pressure
fAGA_Tb : REAL; contract base temperature
fDp_Cutoff : REAL; low flow cut-off differential pressure
usPressType : UINT; pressure sensor type, 0-Gauge, 1-Absolute
fBarometric : REAL; barometric Pressure
usTapLocation : UINT; tap location, 0-upstream, 1-downstream
usOrifice_Type : UINT; orifice plate material, 0-Stainless Steel,
1-Carbon Steel, 2-Monel
fdr_Orifice : REAL; orifice diameter in reference temperature
fTr_Dr_Orifice : REAL; reference temperature of orifice plate diameter
usPipe_type : UINT; pipe tube material, 0-Stainless Steel,
1-Carbon Steel, 2-Monel
fDr_Pipe : REAL; pipe Tube diameter in reference temperature
fTr_Dr_Pipe : REAL; reference temperature of pipe tube diameter
usRD_type : UINT; relative density condition type
fRD : REAL; relative density
fRD_Ref_P : REAL; reference pressure for relative density
fRD_Ref_T : REAL; reference temperature for relative density
usUnit : UINT; unit
usZ_Mode : UINT; AGA8 method
END_STRUCT

Publication 1758-RM001C-EN-P - October 2010


84 Customized Function Blocks for 1758-FLO Controllers

This data structure is formed automatically after this function block in the
WorkBench data dictionary is selected.

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 85

GET_7_PARA Function

Get the process input parameters of the turbine (AGA7).

Statement Instance

GET_7_PARA

N AGA7

44670

Parameter Explanation

GET_7_PARA parameter explanation

Input Return Data Type Description Parameter Value


N — UINT Meter number 0…7
— AGA7 AGA7_PARA Structure of process —
parameter

The structure of the process input parameters of the turbine (AGA7) is as


follows:

AGA7_PARA
STRUCT
fAGA_Pb : REAL; contract base pressure
fAGA_Tb : REAL; contract base temperature
usPressType : UINT; pressure sensor type, 0-Gauge, 1-Absolute
fBarometric : REAL; barometric pressure
usRD_type : UINT; relative density condition type
fRD : REAL; relative density
fRD_Ref_P : REAL; reference pressure for relative density
fRD_Ref_T : REAL; reference temperature for relative density
usUnit: UINT; unit
usZ_mode : UINT; AGA8 method
END_STRUCT

This data structure is formed automatically after this function block in the
WorkBench data dictionary is selected.

Publication 1758-RM001C-EN-P - October 2010


86 Customized Function Blocks for 1758-FLO Controllers

GET_C_ALL Function

Get the total accumulated quantity.

Statement Instance

GET_C_ALL

N ALL

44671

Parameter Explanation

GET_C_ALL parameter explanation

Input Return Data Type Description Parameter Value


N — UINT Meter number 0…7
— ALL CUMU_ALL Structure of —
accumulated variables

The structure of total accumulated quantity is as follows:

CUMU_ALL
STRUCT
QM_ALL : UDINT; total mass flow
QNV_ALL : UDINT; total volume flow in base conditions
QNF_ALL : UDINT; total volume flow in flowing conditions
END_STRUCT

This data structure is formed automatically after this function block in the
WorkBench data dictionary is selected.

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 87

GET_C_TIME Function

Get the accumulated flow time.

Statement Instance

GET_C_TIME

N TIME

44672

Parameter Explanation

GET_C_TIME parameter explanation

Input Return Data Type Description Parameter Value


N — UINT Meter number 0…7
— TIME CUMU_TIME Structure of —
accumulated flow time

The structure of the accumulated flow time is as follows:

CUMU_TIME
STRUCT
CNT_HOUR : UDINT; flow time of this hour
CNT_LHOUR : UDINT; flow time of last hour
CNT_DAY : UDINT; flow time of current day
CNT_YDAY : UDINT; flow time of previous day
END_STRUCT

This data structure is formed automatically after this function block in the
WorkBench data dictionary is selected.

Publication 1758-RM001C-EN-P - October 2010


88 Customized Function Blocks for 1758-FLO Controllers

GET_C_TODAY Function

Get the accumulated quantity for the current day.

Statement Instance

GET_C_TODAY

N Qtd

44673

Parameter Explanation

GET_C_TODAY parameter explanation

Input Return Data Type Description Parameter Value


N — UINT Meter number 0…7
— Qtd CUMU_TODAY Structure of today’s —
accumulated quantity

The structure of the current day’s accumulated quantity is as follows:

CUMU_TODAY
STRUCT
QM_TODAY : REAL; mass flow accumulated quantity of today
QVN_TODAY : REAL; volume flow accumulated quantity of today in
base conditions
QVF_TODAY : REAL; volume flow accumulated quantity of today in
flowing conditions
END_STRUCT

This data structure is formed automatically after this function block in the
WorkBench data dictionary is selected.

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 89

GET_C_YESTERDAY Function

Get the accumulated quantity for the previous day.

Statement Instance

GET_C_YESTERDAY

N Qtd

44674

Parameter Explanation

GET_C_YESTERDAY parameter explanation

Input Return Data Type Description Parameter Value


N — UINT Meter number 0…7
— Qyt CUMU_YEST Structure of yesterday’s —
ERDAY accumulated quantity

The structure of the previous day’s accumulated quantity is as follows:

CUMU_YESTERDAY
STRUCT
QM_YESTERDAY : REAL; mass flow accumulated quantity of yesterday
QVN_YESTERDAY : REAL; volume flow accumulated quantity of
yesterday in base conditions
QVF_YESTERDAY : REAL; volume flow accumulated quantity of
yesterday in flowing conditions
END_STRUCT

This data structure is formed automatically after this function block in the
WorkBench data dictionary is selected.

Publication 1758-RM001C-EN-P - October 2010


90 Customized Function Blocks for 1758-FLO Controllers

GET_ENG_VAL Function

Get the engineering value of differential pressure(AGA3)/pulse count per


second(AGA7), pressure and temperature.

Statement Instance

GET_ENG_VAL

N ENG

44675

Parameter Explanation

GET_ENG_VAL parameter explanation

Input Return Data Type Description Parameter Value


N — UINT Meter number 0…7
— ENG ENG_VAL Engineering value of field —
signals

The structure of the engineering value of field signals is as follows:

ENG_VAL
STRUCT
DP_IN : REAL; engineering value of differential pressure(AGA3)/
pulse count per second(AGA7)
P_IN : REAL; pressure
T_IN : REAL; temperature
END_STRUCT

This data structure is formed automatically after this function block in the
WorkBench data dictionary is selected.

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 91

GET_FLOW Function

Get the flow rates.

Statement Instance

GET_FLOW

N RATE

44676

Parameter Explanation

GET_FLOW parameter explanation

Input Return Data Type Description Parameter Value


N — UINT Meter number 0…7
— RATE FLOW_INSTAN Structure of flow rates —

The structure of flow rates is as follows:

FLOW_INSTAN
STRUCT
QMH : REAL; mass flow rate per hour
QVNH : REAL; volume flow rate per hour in base condition
QVFH : REAL; volume flow rate per hour in flowing condition
END_STRUCT

This data structure is formed automatically after this function block in the
WorkBench data dictionary is selected.

Publication 1758-RM001C-EN-P - October 2010


92 Customized Function Blocks for 1758-FLO Controllers

GET_GX Function

Get the gas composition in decimal fractions.

Statement Instance

GET_GX

N COMP

44677

Parameter Explanation

GET_GX parameter explanation

Input Return Data Type Description Parameter Value


N — UINT Meter number 0…7
— COMP GAS_COMP Structure of natural gas —
composition

The structure of natural gas composition in decimal fraction is as follows:

GAS_COMP
STRUCT
X_CH4 : REAL; Methane
X_N2 : REAL; Nitrogen
X_CO2 : REAL; Carbon Dioxide
X_C2H6 : REAL; Ethane
X_C3H8 : REAL; Propane
X_H2O : REAL; Water
X_H2S : REAL; Hydrogen Sulfide
X_H2 : REAL; Hydrogen
X_CO : REAL; Carbon Monoxide
X_O2 : REAL; Oxygen
X_IC4H10 : REAL; i-Butane
X_NC4H10 : REAL; n-Butane
X_IC5H12 : REAL; i-Pentane
X_NC5H12 : REAL; i-Pentane
X_NC6H14 : REAL; n-Hexane
X_NC7H16 : REAL; n-Heptane
X_NC8H18 : REAL; n-Octane
X_NC9H20 : REAL; n-Nonane
X_NC10H22 : REAL; n-Decane
X_HE : REAL; Helium
X_AR : REAL; Argon
END_STRUCT

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 93

This data structure is formed automatically after this function block in the
WorkBench data dictionary is selected.

Publication 1758-RM001C-EN-P - October 2010


94 Customized Function Blocks for 1758-FLO Controllers

GET_MR Function

Get the sensor range.

Statement Instance

GET_MR

N MR

44678

Parameter Explanation

GET_MR parameter explanation

Input Return Data Type Description Parameter Value


N — UINT Meter number 0…7
— MR MEASURE_ Structure of sensor —
RANGE range parameters

The structure of sensor range parameters is as follows:

Get the engineering values of differential pressure (AGA3)/pulse count per


second (AGA7), pressure and temperature.

MEASURE_RANGE
STRUCT
DP_BASE : REAL; the b value of differential pressure(AGA3),
for turbine (AGA7), b=0
DP_K : REAL; the k value of differential pressure (AGA3),
for turbine (AGA7), k is the k factor of turbine
P_BASE : REAL; the b value of pressure
P_K : REAL; the k value of pressure
T_BASE : REAL; the b value of temperature
T_K : REAL; the k value of temperature
END_STRUCT

This data structure is formed automatically after this function block in the
WorkBench data dictionary is selected.

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 95

HARTB_ADD Function

Add HART scan data blocks.

Statement Instance

HARTB_ADD

ID
ADR
CMD
TIME NO
CD
DD
UT
ST

44632

Parameter Explanation

HARTB_ADD parameter explanation

Input Return Data Type Description


ID — UINT Channel number
0…2
ADR — UINT HART address:
0…15
CMD — UINT Command number:
0, 1, 2, 3, 15, 33, 48, 54

Publication 1758-RM001C-EN-P - October 2010


96 Customized Function Blocks for 1758-FLO Controllers

HARTB_ADD parameter explanation (Continued)

Input Return Data Type Description


TIME — UINT Bits 7 through 0

Bits 7 through 5 indicate the


time unit as follows:

Bit 7 Bit 6 Bit 5 Time


units
0 0 0 50 ms
0 0 1 500 ms
0 1 0 5s
0 1 1 50 s
1 0 0 5 min
1 0 1 50 min
1 1 0 5h
1 1 1 50 h

Bits 4 through 0 indicate the


time value. Range is 1…9.
CD — UINT Send register
DD — UINT Return register
UT — UINT Unit register
ST — UINT State register
— NO UINT Data block NUM

TIP Function blocks HARTB_CLR, HARTB_ADD,


HARTB_AEC, HARTB_EC, and HARTB_EG are used in
HART data timing scan. This function is similar to HART
Settings in DS Settings. For more information, refer to the
DataSite Software User Manual, publication 1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 97

HARTB_AEC Function

Clear all the errors of HART scan data blocks.

Statement Instance

HARTB_AEC

44633

TIP Function blocks HARTB_CLR, HARTB_ADD,


HARTB_AEC, HARTB_EC, and HARTB_EG are used in
HART data timing scan. This function is similar to HART
Settings in DS Settings. For more information, refer to the
DataSite Software User Manual, publication 1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


98 Customized Function Blocks for 1758-FLO Controllers

HARTB_CLR Function

Clear all the HART scan data blocks.

Statement Instance

HARTB_CLR

44631

TIP Function blocks HARTB_CLR, HARTB_ADD,


HARTB_AEC, HARTB_EC, and HARTB_EG are used in
HART data timing scan. This function is similar to HART
Settings in the DS Settings tool. For more information,
refer to the DataSite Software User Manual, 1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 99

HARTB_EC Function

Clear errors of the HART scan data block corresponding to the NUM.

Statement Instance

HARTB_EC
NUM

44634

Parameter Explanation

HARTB_EC parameter explanation

Input Data Type Description


NUM UINT Scan data block NUM

TIP Function blocks HARTB_CLR, HARTB_ADD,


HARTB_AEC, HARTB_EC, and HARTB_EG are used in
HART data timing scan. This function is similar to HART
Settings in DS Settings. For more information, refer to the
DataSite Software User Manual, publication 1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


100 Customized Function Blocks for 1758-FLO Controllers

HARTB_EG Function

Get the error state of certain HART scan data block.

Statement Instance

HARTB_EG

ERR
NUM

CON

44635

Parameter Explanation

HARTB_EG parameter explanation

Input Return Data Type Description


NUM — UINT Scan data block NUM
— ERR UINT 0: Normal
1: Communication error
— CON UINT Count of scan block
communication errors.

TIP Function blocks HARTB_CLR, HARTB_ADD,


HARTB_AEC, HARTB_EC, and HARTB_EG are used in
HART data timing scan. This function is similar to HART
Settings in DS Settings. For more information, refer to the
DataSite Software User Manual, publication 1758-UM002.

If you encounter the communication error, check the connection between the
HART port and the HART instrument, and the settings for the HART scan
block.

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 101

HARTT_CFG Function

Configure the triggering of the HART Scan function via the HART channel.

Statement Instance

HARTT_CFG

EN
ID
ADR
CMD
CD
DD
UT
ST
45588

Parameter Explanation

HARTB_ADD parameter explanation

Input Return Data Type Description Parameter Value


EN — BOOL Enable or disable 0: Disable
1: Enable
ID — BYTE HART channel number 0…2
ADR — BYTE HART instrument address 1…247
CMD — BYTE Command numbers 0, 1, 2, 3, 15, 33, 35,
38, 40, 44, 48, 54, 59
CD — UINT Send register —
DD — UINT Return register —
UT — UINT Unit register —
ST — UINT State register —

Publication 1758-RM001C-EN-P - October 2010


102 Customized Function Blocks for 1758-FLO Controllers

HARTT_ST Function

Get the status of the HART trigger block.

Statement Instance

HARTT_ST

ID STAT

45589

Parameter Explanation

HARTT_ST parameter explanation

Input Return Data Description Parameter Value


Type
ID — BYTE HART channel number 0…2
— STAT BYTE status of the 0: HARTT_CFG configuration ok
HARTT_CFG function 1: HARTT_CFG trigger on(in progress)
block return value 2: HARTT_CFG trigger OK (completed)
3: HARTT_CFG configuration error
255: HARTT_CFG trigger error

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 103

PW_SHDN Function

Shut down the controller, and enable or disable the RTC alarm wake-up mode.

Statement Instance

PW_SHDN
RTC

HOUR

MINU
44639
SEC

Parameter Explanation

PW_SHDN parameter explanation

Input Return Data Type Description Parameter Value


RTC — UINT RTC Alarm Wake-Up 0: Shut down, and disable
Mode Enable/Disable RTC alarm wake-up mode
symbol
1: Shut down, and enable
RTC alarm wake-up mode
HOUR — UINT Hour 0…23
MINU — UINT Minute 0…59
SEC — UINT Second 0…59

Publication 1758-RM001C-EN-P - October 2010


104 Customized Function Blocks for 1758-FLO Controllers

REG_MOVE Function

Copy the register data block.

Statement Instance

REG_MOVE
T

NUM

SWAP

44665

Parameter Explanation

REG_MOVE parameter explanation

Input Return Data Type Description Parameter Value


T — UINT Master register address —
R — UINT Slave register address —
NUM — UINT Register number —
SWAP — BOOL Swap sign of floating 0: low bits in front
high-low bits 1: high bits in front

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 105

REG_R_REAL Function

Read floating point numbers from the register.

Statement Instance

REG_R_REAL
ADR
OUT
SWAP

44661

Parameter Explanation

REG_R_REAL parameter explanation

Input Return Data Type Description Parameter Value


ADR — UINT Register address —
SWAP — BOOL Swap sign of floating 0: low bits in front
high-low bits 1: high bits in front
— OUT REAL Numerical value —

Publication 1758-RM001C-EN-P - October 2010


106 Customized Function Blocks for 1758-FLO Controllers

REG_R_STR Function

Read string value from the register.

Statement Instance

REG_R_STR
ADR

LEN BUF

SWAP
45590

Parameter Explanation

REG_R_STR parameter explanation

Input Return Data Type Description Parameter Value


ADR — UINT Register address 40003 to 49999
LEN — UINT String lenth 1…254
SWAP — BOOL Swap sign of floating 0: low bits in front
high-low bits 1: high bits in front
— BUF STRING String buffer address —

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 107

REG_R_UDINT Function

Read unsigned long integer.

Statement Instance

REG_R_UDINT
ADR
OUT
SWAP

44663

Parameter Explanation

REG_R_UDINT parameter explanation

Input Return Data Type Description Parameter Value


ADR — UINT Register address —
SWAP — BOOL Swap sign of floating 0: low bits in front
high-low bits 1: high bits in front
— OUT UDINT Numerical value —

Publication 1758-RM001C-EN-P - October 2010


108 Customized Function Blocks for 1758-FLO Controllers

REG_R_UINT Function

Read unsigned integer from the register.

Statement Instance

REG_R_UINT

ADR OUT

44659

Parameter Explanation

REG_R_UINT parameter explanation

Input Return Data Type Description Parameter Value


ADR — UINT Register address —
— OUT UINT Numerical value —

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 109

REG_W_REAL Function

Write floating point numbers to the register.

Statement Instance

REG_W_REAL
ADR

SWAP

VAL

44662

Parameter Explanation

REG_W_REAL parameter explanation

Input Return Data Type Description Parameter Value


ADR — UINT Register address —
SWAP — BOOL Swap sign of floating 0: low bits in front
high-low bits 1: high bits in front
VAL — REAL Numerical value —

Publication 1758-RM001C-EN-P - October 2010


110 Customized Function Blocks for 1758-FLO Controllers

REG_W_STR Function

Write string value into the register.

Statement Instance

REG_W_STR
ADR

BUF

LEN
45591
SWAP

Parameter Explanation

REG_R_STR parameter explanation

Input Return Data Type Description Parameter Value


ADR — UINT Register address 40003 to 49999
BUF — STRING String buffer address —
LEN — UINT String lenth 1…254
SWAP — BOOL Swap sign of floating 0: low bits in front
high-low bits 1: high bits in front

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 111

REG_W_UDINT Function

Write unsigned long integer to the register.

Statement Instance

REG_W_UDINT
ADR

SWAP

VAL

44664

Parameter Explanation

REG_W_UDINT parameter explanation

Input Return Data Type Description Parameter Value


ADR — UINT Register address —
SWAP — BOOL Swap sign of floating 0: low bits in front
high-low bits 1: high bits in front
VAL — UDINT Numerical value —

Publication 1758-RM001C-EN-P - October 2010


112 Customized Function Blocks for 1758-FLO Controllers

REG_W_UINT Function

Write unsigned integer to the register.

Statement Instance

REG_W_UINT
ADR

VAL

44660

Parameter Explanation

REG_W_UINT parameter explanation

Input Return Data Type Description Parameter Value


ADR — UINT Register address —
VAL — UINT Numerical value —

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 113

SWAP_DWORD Function

Byte manipulation operations. High byte and low byte exchange positions in a
word.

Statement Instance

SWAP_DWORD
IN OUT
44959

Parameter Explanation

SWAP_DWORD parameter explanation

Input Return Data Type Description Parameter Value


IN — DWORD Previous value —
— OUT DWORD New value —

Publication 1758-RM001C-EN-P - October 2010


114 Customized Function Blocks for 1758-FLO Controllers

SWAP_WORD Function

Byte manipulation operations. High byte and low byte exchange positions in a
word.

Statement Instance

SWAP_WORD
IN OUT
44960

Parameter Explanation

SWAP_WORD parameter explanation

Input Return Data Type Description Parameter Value


IN — WORD Previous value —
— OUT WORD New value —

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 115

SYS_AD_GET Function

Read out the integer value and engineering value of the system’s analog/digital
(A/D) conversion.

Statement Instance

SYS_AD_GET
AD_N
CHL
AD_F

44666

Parameter Explanation

SYS_AD_GET parameter explanation

Input Return Data Type Description Parameter Value


CHL — UINT Channel number of 0: reserved
system A/D 1: reserved
2: channel 2 of system A/D for
controller temperature
3: channel 3 of system A/D for
battery voltage
— AD_N UINT Integer value of 0…1024
this A/D channel
— AD_F REAL Engineering value -40…125 °C for controller
of this A/D channel temperature
0…3.60 for battery voltage

TIP The function block SYS_AD_GET retrieves the same


A/D data as that shown in the Debug dialog box in
Controller Debug of the DS Settings tool. An example is
shown here.

For more information, refer to the DataSite Software User


Manual, publication 1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


116 Customized Function Blocks for 1758-FLO Controllers

SYS_ERR_GET Function

Get system errors.

Statement Instance

SYS_ERR_GET

ERR

44667

Parameter Explanation

SYS_ERR_GET parameter explanation

Input Return Data Type Description Parameter Value Possible Solution


— ERR UINT The value of all 0x0001:/*hardware registering error*/ Contact a Rockwell technical
errors (summed) support representative.
0x0002:/*FLASH error*/
0x0100:/*HART error*/ Check the connection between the
HART port and the HART
instrument. In addition, verify the
settings for the HART scan block.
0x0200:/*US1error*/ Check the connection between the
COM1 port and the slave device.
In addition, verify the settings for
the scan block.
0x0400:/*US2 error*/ Check the connection between the
COM2 port and the slave device.
In addition, verify the settings for
the scan block.

For example, ERR=3=0x0001 + 0x0002, means the system errors are


hardware registering error and FLASH error.

TIP The function block SYS_ERR_GET executes the same


function as the Error Record function in the Debug dialog
box in Controller Debug of the DS Settings tool. The
Error Record box is shown here.

For more information, refer to the DataSite Software User


Manual, publication 1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


Customized Function Blocks for 1758-FLO Controllers 117

SYS_ERR_RST Function

Clear all system errors.

Statement Instance

SYS_ERR_RST

44668

TIP The function block SYS_ERR_RST executes the same


function as the Clear Error function in the Debug dialog
box in Controller Debug of the DS Settings tool. For
more information, refer to the DataSite Software User
Manual, publication 1758-UM002.

Publication 1758-RM001C-EN-P - October 2010


118 Customized Function Blocks for 1758-FLO Controllers

Publication 1758-RM001C-EN-P - October 2010


Rockwell Automation Support

Rockwell Automation provides technical information on the Web to assist you in using its products.
At http://www.rockwellautomation.com/support/, you can find technical manuals, a knowledge base of FAQs, technical and
application notes, sample code and links to software service packs, and a MySupport feature that you can customize to make the
best use of these tools.

For an additional level of technical phone support for installation, configuration, and troubleshooting, we offer TechConnect
support programs. For more information, contact your local distributor or Rockwell Automation representative,
or visit http://www.rockwellautomation.com/support/.

Installation Assistance

If you experience a problem within the first 24 hours of installation, review the information that is contained in this manual.
You can contact Customer Support for initial help in getting your product up and running.

United States or Canada 1.440.646.3434


Outside United States or Use the Worldwide Locator at http://www.rockwellautomation.com/support/americas/phone_en.html, or contact
Canada your local Rockwell Automation representative.

New Product Satisfaction Return

Rockwell Automation tests all of its products to ensure that they are fully operational when shipped from the manufacturing facility.
However, if your product is not functioning and needs to be returned, follow these procedures.

United States Contact your distributor. You must provide a Customer Support case number (call the phone number above to obtain
one) to your distributor to complete the return process.
Outside United States Please contact your local Rockwell Automation representative for the return procedure.

Documentation Feedback

Your comments will help us serve your documentation needs better. If you have any suggestions on how to improve this document,
complete this form, publication RA-DU002, available at http://www.rockwellautomation.com/literature/.

Rockwell Otomasyon Ticaret A.Ş., Kar Plaza İş Merkezi E Blok Kat:6 34752 İçerenköy, İstanbul, Tel: +90 (216) 5698400

Publication 1758-RM001C-EN-P - October 2010 120


Copyright © 2010 Rockwell Automation, Inc. All rights reserved. Printed in the U.S.A.

You might also like