Sunteți pe pagina 1din 132

GEH-6409

g
GE Industrial Systems

Block Library

Contents
Introduction:...............................................................................................................................1
Alarm Transmission ...................................................................................................................4
Any Forces .................................................................................................................................5
Average Input.............................................................................................................................6
Bit Counter .................................................................................................................................7
Boolean Engine ..........................................................................................................................8
Boolean Engine with Diagnostics ............................................................................................10
Boolean Filter...........................................................................................................................12
Boolean Filter - short ...............................................................................................................13
Branch ......................................................................................................................................14
Bubble Sort ..............................................................................................................................16
Capture Data ............................................................................................................................17
Change Detection .....................................................................................................................20
Clamp .......................................................................................................................................21
Code Timer ..............................................................................................................................22
Combine_xx .............................................................................................................................24
Comment..................................................................................................................................25
Compare ...................................................................................................................................26
Compare with Hysteresis .........................................................................................................27
Compress Booleans..................................................................................................................28
Counter.....................................................................................................................................29
Count to Boolean .....................................................................................................................30
Derivative.................................................................................................................................32
Device Faults............................................................................................................................33
Dynamic Group........................................................................................................................34
Engineering Scale.....................................................................................................................36
Exit Macro................................................................................................................................37
Exit Task ..................................................................................................................................38
Expand Integer .........................................................................................................................39
Exponential S-Curve Ramp......................................................................................................40
Exponential S-Curve Ramp with Hold.....................................................................................41
Finite Impulse Response ..........................................................................................................42
Function Generator...................................................................................................................43
Genius Input Conversion..........................................................................................................44
Genius Type B High-speed Counter Block Configure.............................................................46
Get From Array........................................................................................................................48
Infinite Impulse Response........................................................................................................49
Input Conversion......................................................................................................................51
Integrator With Lead ................................................................................................................53
I/O Simulation..........................................................................................................................54
ISBus Reference Page Disable.................................................................................................57
Lag Filter..................................................................................................................................58
Latch ........................................................................................................................................59
Limit Detect Auto ....................................................................................................................60
Limit Detect Manual ................................................................................................................61
Linear Interpolator ...................................................................................................................62
Load Disable ............................................................................................................................63

Contents i

Math Engine.............................................................................................................................64
Merge .......................................................................................................................................65
Minimum-Maximum Select .....................................................................................................67
Mode Select..............................................................................................................................68
Move_Address_x .....................................................................................................................69
Move_x ....................................................................................................................................70
Move_xT..................................................................................................................................71
No Operation............................................................................................................................72
Output Conversion ...................................................................................................................73
Output Transfer ........................................................................................................................75
Parity Check.............................................................................................................................76
Permissive Dual Action Engine ...............................................................................................77
Permissive Engine....................................................................................................................80
Permissive Single Action Engine .............................................................................................82
Permissive Toggle Action Engine............................................................................................85
Preset SIOB Counter ................................................................................................................88
Proportional-Integral Regulator ...............................................................................................89
Proportional-Integral Regulator with Suicide ..........................................................................90
Proportional Integral Derivative Control .................................................................................91
Pulse.........................................................................................................................................93
Pulse_s .....................................................................................................................................94
Put Into Array...........................................................................................................................95
Ramp ........................................................................................................................................96
Ramp with Hold .......................................................................................................................97
S-Curve Ramp..........................................................................................................................98
Select........................................................................................................................................99
Sequence Function Block.......................................................................................................100
Sequence Manager .................................................................................................................102
Set Array ................................................................................................................................103
Split_xx ..................................................................................................................................104
Status-S Command Message Maker.......................................................................................105
Status-S Feedback Page Update Period Modifier ..................................................................107
Steer .......................................................................................................................................108
Task Scan ...............................................................................................................................109
Temperature Set .....................................................................................................................110
Timer......................................................................................................................................111
Timer_s ..................................................................................................................................112
Totalizer .................................................................................................................................113
Transfer Function ...................................................................................................................114
Transport Delay......................................................................................................................116
VME Array Read ...................................................................................................................117
VME Array Write ..................................................................................................................118
VME Boolean Read ...............................................................................................................119
VME Boolean Write ..............................................................................................................120
VME Byte Read .....................................................................................................................121
VME Byte Write ....................................................................................................................122
VME Read..............................................................................................................................123
VME Test...............................................................................................................................124
VME Write.............................................................................................................................125

ii Contents

Introduction:
This manual describes the standard blockware library (SBLIB) of the Innovation Series Controller (InnovSCtrlr). The
SBLIB is a resident part of the InnovSCtrlr. Optionally one additional product line blockware library (PLLIB) may also be
simultaneously supported by a InnovSCtrlr.
Blocks are software subroutines that may be connected together into tasks to be executed in the InnovSCtrlr. In the toolbox
the connections are accomplished graphically by means of pins and wires to form a data flow diagram that is easily
interpreted. Blocks always execute in the order that they are listed in the task.
In reality the connections between the blocks are RAM memory elements through which data is passed. These elements are
referred to as signals. Each signal has a particular data type and may only be connected to the pin of a block with the same
data type. Some block pins are able to accept multiple data types. Other blocks are capable of converting from data type to
another.
Each block entry in the library consists of the following:
Block name and category
Block description
Block diagram
Pin definitions
Application notes (optional)
Each block has a full name and a simple name. The full name is descriptive but may be too long to display in a block
diagram. For this reason all blocks also have a simple name. The simple name is always displayed by the toolbox. The
simple names of blocks that are capable of converting data types are suffixed with the output data type identifier (e.g.
_MENG_D produces a Long Floating Point output regardless of the data types of the inputs, while _MENG_I produces an
integer output).
The simple names of all blocks in the SBLIB begin with an underscore '_'. This is to distinguish them from identical block
names that may be found in the product line libraries.
Examples:
Full Block Name
Permissive Engine
Math Engine

Simple Block Name(s)


_PENG
_MENG_D, _MENG_F, _MENG_I, _MENG_L

In this manual the blocks are listed alphabetically to simplify the task of finding information about a block whose name is
known. In the toolbox the blocks are grouped functionally, to simplify the task of converting ideas into blockware. For
example the Permissive Engine block is a member of the Sequencing category.
The block diagram is a graphical representation of the block software. It contains the simple block name and all of the pins
that either configure the block or transfer data into and out of the block. For clarity, in some instances a functional picture
is also encapsulated inside of the block diagram.
The pins are distributed within the block diagram according to their usage. All input pins (pins read by the block) are listed
on the left. All output pins (pins written by the block) and state pins (pins read and written by the block) are listed on the
right.
The pin name is listed beside each pin inside the block diagram border. Pin names may be supplemented with additional
information in the form of modifiers as shown below:
Pin Name Modifiers
^ prefixed with a carat (e.g. ^ONREQ)
[ ] suffixed with square brackets (e.g. STATE[4]

Meaning
the pin is rising edge sensitive
the pin expects a signal that is an array of the size indicated within the
brackets

SBLIB Block Library 1

The pin data type is listed beside the pin outside of the block diagram border. Data types may be either basic elements
such as integer or floating point, or they may be complex structures defined by type definition names such as beng or scale.
The basic data types may be modified by the octothorpe '#' character to indicate that they are constants and cannot be
changed by the tool without re-building and downloading to the InnovSCtrlr.
Data type
Identifier

Basic (b),
Type definition (t),
or modifier (m)
#
m
b
b
i
b
l
b
f
b
d
b
a
b
v
b
s
b
beng
t
meng
t
scale_a
t
command_s
t
Add_del_T
t
BlkDgMode_T
t
Chg_det_T
t
CompFn_T
t
CompFnL_T
t
InOutCvrt_T
t
MinMaxFn_T
t
HowToSend
t
Drop
t
Group
t
Dev_Net
t

Description

build time constant


8 bit Boolean
16 bit signed Integer
32 bit (Long) signed Integer
32 bit Floating Point
64 bit (Long) Floating Point
Analog data type (either i, l, f, or d)
Simple (analog or Boolean) data type (either b, i, l, f, or d)
Null-terminated ASCII string
Boolean equation string
Math equation string
Signal plus its scaling information
Status S message structure
Addition or deletion selection (add, del)
Block diagram mode type (flow_mode, list_mode)
Boolean signal change detection method (level, rising, falling, both)
Compare function (lt, ge)
Compare function for Long Integers or when using hysteresis (gt, lt, ge, le, eq)
Input/output conversion functions (bcd, gray)
Min/max function (min, max)
Status S (SS) message transmission type (broadcast, direct, group #)
SS message drop number
SS message group number
SS Device or net number

Example:
Full Block Name

Move_x

Simple Block Name(s)

Category

_MOVE_B, _MOVE_D, _MOVE_F, _MOVE_I, _MOVE_L, Memory_Move

Block Description

The Move blocks transfer the value of any Analog signal into another Analog signal whose data type matches that denoted
by the block suffix. Therefore the Move blocks can be used to perform data type conversions as well as memory move
operations. The data transfer occurs each time the block executes and the ENABLE pin is TRUE. The _MOVE_B variant
moves Boolean signals into other Boolean signals.

2 SBLIB Block Library

Block Diagram

_MOVE_a
b

ENABLE

SRC

DEST

Pin Definitions

Input
ENABLE
SRC

Boolean
Analog

if TRUE the block executes.


the source variable.

Output
DEST

Analog

the destination variable (data type enforced by the block used).

Application Notes

The Move blocks are useful for taking snapshots of data that are shared between tasks in separate modules. Moving the
signals to local copies guarantees that another preemptive task cannot overwrite the data shared with a lower priority task.

SBLIB Block Library 3

Alarm Transmission
_ALARM_XMIT, Communications
The Alarm Transmission block sends a Status-S alarm message (TXTS message with text substitution or TXTV message with
variable substitution) whenever the alarm state changes. The block determines TXTS or TXTV based on what is attached to
the pins by the user. If text is entered on either NORMTXT or ALMTXT pins, a TXTS message will be sent. When TXTS
messages are sent only one variable can be passed along with the text, others will be ignored. Up to four variables may be sent
in the TXTV message. Care should be taken to ensure that message identification (MSG_ID) contains the proper formatting
and data types for the variables attached. If more than one state is active the alarm state in the message will be selected in the
following order of precedence: High-High, Low-Low, High, Low.

_ALARM_XMIT
b

ENABLE

PICKUP DELAY

^HH STATE

^H STATE

^N STATE

^L STATE

^LL STATE

group

SRCHGRP

Inputs
ENABLE
PU_DLAY

Boolean
Long Integer

HH_STAT
H_STAT
N_STAT
L_STAT
LL_STATE
SRCHGRP
MSG_ID
DISPGRP
ALMTXT
NORMTXT
VAR1
VAR2
VAR3
VAR4

Boolean
Boolean
Boolean
Boolean
Boolean
SearchGroup
Integer
DisplayGroup
String
String
Simple
Simple
Simple
Simple

4 SBLIB Block Library

SEND

MSG ID

group

DISPGRP

string

ALRMTXT

string

NORMTXT

VAR1

VAR2

VAR3

VAR4

If TRUE the block executes.


Time period (in milli-Seconds) that a new value on one of the state pins must remain to be
recognized as a change of state.
Indicates that the input variable is in the HIGH-HIGH limit.
Indicates that the input variable is in the HIGH limit.
Indicates that the input variable is not in any limit condition or NORMAL.
Indicates that the input variable is in the LOW limit.
Indicates that the input variable is in the LOW-LOW limit.
The search group of the alarm in the database.
The index of the alarm in the search group.
The display group of the alarm in the database.
Text substitution string for alarm state, quotes are required (15 characters maximum).
Text substitution string for normal state, quotes are required (15 characters maximum).
The first variable sent in the message. Must be of the type referenced by MSG_ID.
The second variable sent in the message. Must be of the type referenced by MSG_ID.
The third variable sent in the message. Must be of the type referenced by MSG_ID.
The fourth variable sent in the message. Must be of the type referenced by MSG_ID.

Any Forces
_ANY_FORCES, I/O
The Any Forces block displays whether or not any I/O points or internal Boolean variables are currently forced. The total
number of forces for each type are also shown. The block executes in the background only and therefore may require up to
1 second before responding to a change in the force lists.

_ANY_FORCES
YES

POINTS

VARS

CMD_CNT

Output
YES
POINTS
VARS

Boolean
Integer
Integer

TRUE if any I/O points or Boolean variables are forced.


The number of I/O points currently forced.
The number of internal Boolean variables currently forced.

State
CMD_CNT

Integer

The number of forcing type commands that have been executed by the controller.

SBLIB Block Library 5

Average Input
_AVRG, Math
The _AVRG block does a rolling average of the last N inputs presented to the block. The block can be initialized to a
given input value by setting the PRESET pin. The block will automatically do a preset whenever a cold start is detected or
if the value of N changes after a download.
_AVRG

ENABLE

IN

PRESET

OUT
ARRAY
SCRATCH

Input
ENABLE
IN
PRESET

Boolean
Float
Boolean

Enable the blocks output update.


Input to be averaged.
Preset flag - set to initialize ARRAY to IN.

Immediate
N

Long Int

Number of IN values to average.

Output
OUT
ARRAY

Float
Float []

SCRATCH

Long Float [3]

The current rolling average.


Storage for last N inputs.
This array must have at least N elements.
3 Element state storage for block..

6 SBLIB Block Library

f
f[]
d[3]

Bit Counter
_BIT_CNTR, Logic
This block counts the number of input bits that are currently set to TRUE. The block can handle from 1 to 32 input
Boolean signals. The resulting count in placed in the long integer COUNT
_BIT_CNTR
IN1

IN2

IN32

COUNT

....

Inputs
IN1-IN32

Boolean

Input Boolean signals - variable from 1 to 32.

Outputs
COUNT

long integer

Number of input bits that are set to TRUE.

SBLIB Block Library 7

Boolean Engine
_BENG, Logic
The Boolean Engine block solves a Boolean equation of up to 16 Boolean inputs, placing the result in the output variable.
The following operators are supported:
()
NOT
AND
OR

~
*
+

The block supports diagnostic back-chaining by maintaining the last state of all the inputs and the output. In addition the
block may be dynamically marked as non-diagnosable (returns only its output) so that demorganizing can be halted from
back-chaining.

_BENG
b
BoolEqn

8 SBLIB Block Library

DDIAGBC
EQN

BOOLEAN
EQUATION
()
NOT
~
AND
*
OR
+
OUT

Input
DDIAG
EQN
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P

Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean

Disable diagnostic back-chaining (i.e. return only my output).


Boolean equation.
Required Boolean input used in equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.

Output
OUT

Boolean

The result of the equation.

SBLIB Block Library 9

Boolean Engine with Diagnostics


_BENG_D, Logic
The Boolean Engine with Diagnostics block solves a boolean equation of up to 16 boolean inputs, placing the result in the
output variable. The following operators are supported:
()
NOT
AND
OR

~
*
+

In addition, this block as three diagnostic features that can be controlled by the user. The first is a diagnostic trigger which
produces an alarm when this input goes from a false to a true condition. Next is an enable on the generation of a diagnostic
when the output of the block goes from a true to a false. The last feature is to block the diagnostic back chaining through
this block.
This block also supports the "advanced" diagnostics that both the BENG and the PENG support. Specifically, like the
BENG it will save a copy of the last state of it's inputs that is different from the current state along with a time stamp of
when that last condition last occurred. Then like the PENG it will know at what time it gets a "broken run" and query back
to "itself" and any other BENGs or BENG_Ds that feed it to find out who had had a condition change at the same time that
the "broken run" occurred. Then it will only announce the changed signal(s) in it's diagnostic.
_BENG_D
b

REQDIAG

DDIAG

DDIAGBC

DisplayGroup

DISPGRP

BoolEqn

10 SBLIB Block Library

STATUS

EQN

BOOLEAN
EQUATION
()
NOT
~
AND
*
OR
+
OUT

Input
REQDIAG
DDIAG
DDIAGBC
DISPGRP
EQN
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P

Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean

Request diagnostics.
Disable diagnostic message. No diagnostic message when OUT transitions to FALSE.
Disable diagnostic backchaining (i.e. return only my output).
Display group for diagnostics.
Equation to be executed.
Required boolean input used in equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.
Boolean input used in the equation.

Output
STATUS
OUT

Integer
Boolean

Bit encoded status output.


The result of the equation.

SBLIB Block Library 11

Boolean Filter
_BFILT, Filters
The Boolean Filter block passes a rising TRUE value on the input pin to the out pin if it remains TRUE for PU_DEL time .
The block passes a falling FALSE value on the input pin to the out pin if it remains FALSE for DO_DEL time. Negative
time values will be interpreted as zero delay.
_BFILT

INPUT

OUTPUT

t(1)
l

PU_DEL

DO_DEL

Input
INPUT
PU_DEL
DO_DEL

Boolean
Integer
Integer

Identifies the signal to filter.


Pick-up delay in milliseconds.
Drop-out delay in milliseconds.

Output
OUT

Boolean

The filtered output.

12 SBLIB Block Library

t(2)

Boolean Filter - short


_BFILT_S, Filters
The Short Boolean Filter block passes a rising TRUE value on the input pin to the out pin if it remains TRUE for PU_DEL
time . The block passes a falling FALSE value on the input pin to the out pin if it remains FALSE for DO_DEL time.
Negative time values will be interpreted as zero delay. This block differs from BFILT in that the pick-up and drop-out
delays must be less that 32,767 milliseconds.

_BFILT_S

INPUT

OUTPUT

t(1)
l

PU_DEL

DO_DEL

Input
INPUT
PU_DEL
DO_DEL

Boolean
Short Integer
Short Integer

Identifies the signal to filter.


Pick-up delay in milliseconds.
Drop-out delay in milliseconds.

Output
OUT

Boolean

The filtered output.

t(2)

SBLIB Block Library 13

Branch
_BRANCH, Sequencing
The Branch block is used to create up to eight branches from a single Sequential Function Block (_SFB) step. The block can
be configured to activate all branches, or just one. The Merge block is used to bring the branches back into the main line of a
sequence.

_BRANCH
i

IN

ACTIVE

#b

BRTYPE

ON

DDIAG

STATUS

DISPGRP

GSTAT

TRANS1

STATE[2]

TRANS2

BRANCH1

TRANS3

BS1

TRANS4

BRANCH2

TRANS5

BS2

TRANS6

BRANCH3

TRANS7

BS3

TRANS8

BRANCH4

BS4

BRANCH5

BS5

BRANCH6

BS6

BRANCH7

BS7

BRANCH8

BS8

#DisplayGroup

Input
IN
BRTYPE
DDIAG
DISPGRP
TRANS1
TRANS2
TRANS3
TRANS4
TRANS5
TRANS6
TRANS7
TRANS8

Integer
Constant
Boolean
Boolean
Constant
DisplayGroup
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean

14 SBLIB Block Library

Connection pin - from the NEXT pin of an _SFB block.


If TRUE branch all. If FALSE selective branch.
If TRUE disable diagnostics.
The display code for diagnostics.
Transition condition for branch 1.
Transition condition for branch 2.
Transition condition for branch 3.
Transition condition for branch 4.
Transition condition for branch 5.
Transition condition for branch 6.
Transition condition for branch 7.
Transition condition for branch 8.

Output
ACTIVE
ON
BRANCH1
BRANCH2
BRANCH3
BRANCH4
BRANCH5
BRANCH6
BRANCH7
BRANCH8

Boolean
Boolean
Integer
Integer
Integer
Integer
Integer
Integer
Integer
Integer

If TRUE the branch is active.


If TRUE the branch is active with no faults.
Next output for branch 1.
Next output for branch 2.
Next output for branch 3.
Next output for branch 4.
Next output for branch 5.
Next output for branch 6.
Next output for branch 7.
Next output for branch 8.

State
STATUS
GSTAT
STATE[2]
BS1
BS2
BS3
BS4
BS5
BS6
BS7
BS8

Integer
Integer
Integer
Integer
Integer
Integer
Integer
Integer
Integer
Integer
Integer

Bit encoded status output.


Global input and output connection to the sequence manager block.
Internal state information.
Transition branch 1 state.
Transition branch 2 state.
Transition branch 3 state.
Transition branch 4 state.
Transition branch 5 state.
Transition branch 6 state.
Transition branch 7 state.
Transition branch 8 state.

When the _BRANCH block is configured to perform all branches (BRTYPE is true), then all _SFB's that are attached to the
BRANCHx outputs will be started when the upstream _SFB (the _SFB connected to the IN pin of the _BRANCH block)
transitions. This allows a sequence to perform multiple branches in parallel. The transition inputs 1 through 8 (TRANSx)
are ignored when the _BRANCH block is configured ot branch all.
When the _BRANCH block is configured to perform selective branching, then only one branch will be selected when the
upstream _SFB transitions. The first transition input (TRANSx) to go high determines which branch is selected. If more then
one transition input is high at the same time, then the lower numbered branch is selected. Only one branch is ever selected
when the branch type (BRTYPE) is false. Note that the upstream _SFB will not even attempt to transition unless at least one
_BRANCH block TRANSx input is true.
If selective branching is used, and an _SFB is not tied to a branch that has a defined transition condition, then when that
branch is selected run time, the sequence will end. This allows for selectively ending a sequence or continuing down another
branch.
Normally, the ACTIVE and ON outputs of the _BRANCH block will only be on for a few scans of the task.
The only errors that can occur with the _BRANCH block are handshaking errors. Handshaking errors are caused by coding
problems and NOT misoperation of the equipment being controlled. For this reason, the _BRANCH block does not have a
reset pin or a fault output pin.
If an error does occur, a diagnostic message will be sent (if diagnostics are enabled). The _BRANCH block will also set the
appropriate bit in the STATUS and GSTAT outputs to indicate a fault condition. It will also reset any internal bits required
which will allow it to operate properly if the problem is fixed. i.e. it will go back to its default state and wait for its input to
indicate that a transition is required. When a successful transition occurs, the status word will be adjusted to indicate no
errors. Note also that if the ACTIVE output is on, but the ON output is not, then there is an error within the _BRANCH
block.

SBLIB Block Library 15

Bubble Sort
_BSORT, Math
The bubble sort block sorts an array of data and transfers it to the output pin. This block is optimized for data that does not
change much between task sweeps. It uses the mapping from the previous task scan, stored in the INDEX array, to move the
data initially. Then the algorithm checks the array to make sure it is sorted using a comparison system and corrects any
errors using the bubble sort algorithm. The number of elements sorted is the smallest of N, the size of SRC[], the size of
DEST[], and the size of INDEX[].

_BSORT

ENABLE

SRC[]

DEST[]

INDEX[]

Inputs
ENABLE
N
SRC[]

boolean
integer
floating array

enables the execution of the block


number of elements in the array to be sorted
the input array

Outputs
DEST[]
INDEX[]

float array
integer array

the sorted array


the mapping used to take the source array to the destination array

16 SBLIB Block Library

Capture Data
_CAPTURE, Data_Collection
The data capture block collects samples of up to 32 signals in a buffer that may be uploaded by the toolbox for display and
analysis. It supports a variety of triggering and sampling options. Changes to the configuration can only be accomplished
by a new download. Buffer memory for the block must be pre-allocated with the Memory selection under the Device dialog
box in the Control System Toolbox. A maximum of 200 _CAPTURE blocks may be configured in a InnovSCtrlr

_CAPTURE
b

~ENABLE

#i

PMULT

#l

SAMPLES

#l

PRE_SAM

DONE

STATUS

#Tr_Cond_T TR_COND
#Tr_Cond_T TR_TYPE
v TR_VAL
v TR_SIG
#b TSTAMP
#Buf_Ctl_T BUF_CTL
v SIG1
v SIG2
v SIG3
v SIG4
v
v
v
v SIG31
v SIG32

SBLIB Block Library 17

Input
^ENA_CAP
PMULT
SAMPLES
PRE_SAM

Boolean
Constant
Integer
Constant
Long Integer
Constant
Long Integer

TR_COND

Constant
Tr_Cond_T

TR_TYPE

Constant
Tr_Type_T

TR_VAL

Simple

TR_SIG

Simple

TSTAMP

Constant
Boolean
Constant
Buf_Ctl_T

BUF_CTL

SIG1 - SIG32 Simple

Output
DONE
STATUS

Boolean
Integer

18 SBLIB Block Library

If TRUE, and the buffer is not LOCKED by an upload, evaluate the trigger condition. To re-arm
the block after a capture, toggle this pin FALSE then TRUE.
The sample period is calculated by multiplying this number by the task scan period. Default is 1
The total number of samples to collect, including pre-samples. The default is 100.
The number of samples to collect prior to the trigger event. The default is 10. The number of
pre-samples (PRE_SAM) must always be smaller than the total number of samples
(SAMPLES).
The trigger condition specifies how the trigger is to be evaluated:
EQ (1) means the trigger signal must equal the trigger value.
GT (2) means the trigger signal must be greater than the trigger value.
GE (4) means the trigger signal must be greater than or equal to the trigger value.
LT (8) means the trigger signal must be less than the trigger value.
LE (16) means the trigger signal must be less than or equal to the trigger value.
NE (32) means the trigger signal must not be equal to the trigger value. - default
The trigger type specifies whether the trigger can be considered to have occurred just by
matching the trigger condition (level) or whether the trigger condition must evaluate FALSE for
at least one sweep before it can become TRUE (edge).
edge (0)
level (1) - default
The trigger value. The trigger value (TR_VAL) must have the same datatype as the trigger
signal (TR_SIG).
The trigger signal. The trigger signal (TR_SIG) must have the same datatype as the trigger
value (TR_VAL).
If TRUE the UTC time of each sample is collected as well. The default is FALSE.
Controls how and when the data is collected:
NORMAL (0) means that the block will collect PRE_SAM samples before a trigger event
and thereafter continue collecting until either the enable capture pin goes FALSE or the
collection fills the buffer. - default
CIRCULAR (1) means that block will collect data indefinitely until the enable capture pin
goes FALSE. The buffer will be filled with the newest samples. The collection may be
smaller than specified is the block is disabled prematurely.
ONLY (2) means that the block will only collect data when the trigger condition is valid.
It will make a new evaluation of the trigger each time it runs. Data will be collected until
the enable capture pin goes FALSE or the collection fills the buffer.
The signals to be collected. May be any collection of datatypes.

Set to TRUE when a collection is complete, set to FALSE when the next collection is re-armed.
The status of the collection:
CAPTURE COMPLETE (0)
WAITING FOR TRIGGER (1)
CAPTURING (2)
LOCKED (4) logically ORed with the other bits.

The _CAPTURE block may be re-configured by either a full download or an online download. However, any download
will cause the states of ALL of the _CAPTURE blocks in the InnovSCtrlr to be re-initialized, invalidating any data that may
be in the process of being collected. Therefore, if external blockware is used to sequence to collection of data, it must be
sufficiently robust to recover from such a re-initialization. This may be accomplished by examining the done and status
pins or through timeouts.
The enable capture pin is rising edge sensitive in that it must be pulsed FALSE for at least one sweep of the block for the
collector to be re-armed to begin capturing another buffer of data.
The period multiplier pin can be used to specify that the data be collected at a rate slower than the block actually runs.
The number of samples that a block can collect is dependent upon the amount of Capture Buffer memory that has been
reserved within the InnovSCtrlr. All the memory used by the _CAPTURE blocks is allocated from a pool that is pre-sized
at boot up time. The size of the pool may be specified (in kilobytes from 64 to 4096) in the Memory section of the Device
dialog of the Control System Toolbox. If the pool size is changed the application code must be validated, built, downloaded
to PERMANENT STORAGE ONLY, and the InnovSCtrlr rebooted. In addition to being allocated to buffers, 3000 bytes
of Capture Buffer Memory is required to support the service.
The amount of memory required for a particular _CAPTURE block may be calculated as the sum of the size of each
collected signal times the number of samples. If time-stamping is enabled add 8 times the number of samples.
Datatype
Short Integer (Int)
Long Integer (Lint)
Boolean (Bool)
Float (Float)
Long Float (Lfloat)

Size (bytes)
2
4
1
4
8

For example if a _CAPTURE block is configure to collect 1000 samples of 2 floats, 3 short integers, and 5 booleans, and
time-stamping is enabled, the amount of capture buffer memory required for the block is
1000 * ((2 * 4) + (3 * 2) + (5 * 1) + 8) = 27,000 bytes
Note that the allocation of memory in a InnovSCtrlr is a compromise that must be made considering the amount of real RAM
available, the amount needed for blocks (System memory pool), the amount needed for data collection (Capture Buffer
memory pool), and the amount needed for services (toolbox connections, low level monitor, etc.).
Pre-trigger samples will be collected until the trigger condition is met. It is possible to collect a buffer with less than the
specified number of pre-trigger samples if the trigger condition occurs too quickly after enabling the block.
The trigger value must always be of the same datatype as the trigger signal.
The trigger signal is not required to be in the collection signal list, but including it there adds value to the collection.
The time stamp pin specifies whether absolute time (Coordinated Universal Time) should be collected along with each
sample, or whether it should be collected only at the trigger time and all other sample times are implied by the execution
period of the block modified by the period multiplier.

SBLIB Block Library 19

Change Detection
_CHG_DET_B, _CHG_DET_D, _CHG_DET_F, _CHG_DET_I, _CHG_DET_L, Sequencing
The Change Detection block sets the OUT to TRUE whenever it detects a difference between IN and STATE greater than
the absolute value of DBAND, effectively generating a boolean pulse that may be used to synchronize other blocks. In
addition a symmetric range around zero may be specified by NZBAND that will cause the output to pulse whenever IN
moves into it, regardless of the size of the step change made to get there. Once inside NZBAND, IN must move equal to or
outside DBAND to reset the near zero detection function.

_CHG_DET_a
a

IN

OUT

DBAND

STATE

NZBAND

Input
IN
DBAND

Analog
Analog

NZBAND

Analog

Output
OUT

Boolean

TRUE when a change is detected or when entering near zero, otherwise FALSE.

State
STATE
NZFLAG

Analog
Boolean

The value of IN at the last detected change.


A hidden pin that holds the state of the near zero condition.

20 SBLIB Block Library

The variable to watch.


The maximum numerical difference (deadband) that will not be detected. This pin is
inactivated for CHG_DET_B.
The range around zero (near zero band) that when entered by IN will cause OUT to be pulsed
TRUE even if the change to get there was less than the DBAND value. This pin is inactivated
for _CHG_DET_B.

Clamp
_CLAMP, _CLAMP_D, _CLAMP_I, _CLAMP_L, Math
The Clamp block restricts the output to values of the input between and/or equal to the maximum and minimum limits.
Status booleans indicate whether the input is equal to or beyond either or both of the limits.

_CLAMP

MAX

IN

IN_MAX

OUT

IN_MIN

MIN

Input
MAX
IN
MIN

Analog
Analog
Analog

the maximum limit.


the value to be clamped.
the minimum limit.

Output
IN_MAX
OUT
IN_MIN

Boolean
Analog
Boolean

if TRUE, IN is equal to or greater than MAX.


the clamped value.
if TRUE, IN is equal to or less than MIN.

SBLIB Block Library 21

Code Timer
_CTIME, Test
The Code Timer block calculates the time in microseconds between successive executions of the block. It can be used to
determine how long it takes to execute a section of blockware, or how often a task executes, etc in the UC2000. Time
resolution may be traded for time span using the COARSE pin. When set FALSE the resolution is micro-Seconds and the
maximum range is 65.535 milli-Seconds. When set TRUE the resolution is mill-Seconds and the maximum range is nearly
50 days.

CAUTION!
This block is intended for General Electric Industrial Systems internal use. The pinout and the block definition are
subject to change without notice.
This block uses timer 2 of the 8254 timer chip.. Do Not use this block if timer 2 is required by another function on this
InnovSCtrlr or erratic operation may result.

_CTIME
b

ENABLE

DATA

OFFSET

MAX

PBAND

MIN

COARSE

DELTA

LTICS

LST_ENA

NPBAND

SWEEPS

WORST1

WORST2

WORST3

WORST4

WORST5

Input
ENABLE
OFFSET
PBAND
COARSE
DATA

Boolean
Integer
Float
Boolean
Integer

if TRUE the block executes.


calibration offset in microseconds.
minimum time of sweep in microseconds to collect statistics on.
if TRUE use 1 millisecond resolution clock for extended range.
reserved input do not connect to another block.

Output
MAX
MIN
DELTA
NPBAND
SWEEPS
WORST1
WORST2
WORST3
WORST4
WORST5

Float
Float
Float
Long Integer
Long Integer
Long Integer
Long Integer
Long Integer
Long Integer
Long Integer

the longest period in microseconds between block executions.


the shortest period in microseconds between block executions.
the time in microseconds since the last execution of the block.
the number of sweep times that have been longer than PBAND.
the number of execution cycles recorded.
the longest sweep time greater than PBAND.
the second longest sweep time greater than PBAND.
the third longest sweep time greater than PBAND.
the fourth longest sweep time greater than PBAND.
the fifth longest sweep time greater than PBAND.

22 SBLIB Block Library

State
LTICS
LST_ENA

Long Integer
Boolean

the last raw counter value.


the last state of the ENABLE pin.

The _CTIME block calculates the interval of time that passes between successive executions of the block by reading a freerunning hardware counter. The block may be used to measure the scan period of a task by inserting a block at the start of
the task. It may be used to measure the execution time of a group of blocks by placing a _CTIME block directly before and
after the group and tying the LTICS pin of both blocks together. The correct time is displayed by the second _CTIME
block in that configuration.
The _CTIME block collects statistical information about the sweep times that it has measured. The PBAND pin is used to
specify a time period for which no statistical data is collected. In this manner the block can be configured to filter all but the
worst case execution times.
Average execution times may be calculated by connecting the _CTIME block with the _FIR block.
Toggling the ENABLE pin causes the block to reset its old statistics and start over.
In order to eliminate any known constant delays a value placed on the OFFSET pin is subtracted from the time period
measured.

SBLIB Block Library 23

Combine_xx
_COMBINE_SF, _COMBINE_SL, Memory Move
The COMBINE_xx blocks concatenate smaller variables into larger variables. They perform the dual function of the
_SPLIT_xx blocks. For example the _COMBINE_SF block forms a floating point variable from two short integers.
Likewise the _COMBINE_SL block forms a long integer variable from two short integers. The merging of the signals is
strictly mechanical. That is, there is no attempt to interpret the data, or to perform any clamping, scaling, datatype
conversion, or sign extension.

_ COMBINE_xx
b

ENABLE

LOWORD

HIWORD

Input
ENABLE
LOWORD
HIWORD

Boolean,
Integer,
Integer,

Output
OUTPUT

float or long Integer the combined result.

24 SBLIB Block Library

OUTPUT

f,l

If TRUE the block executes.


the low order 16 bits of the data to be concatenated.
the high order 16 bits of the data to be concatenated.

Comment
_COMMENT, _COMMENT_BF, _COMMENT_NB, PseudoControl
The Comment block is used to add comment text to the block diagram. The different forms of the block allow control over
diagram breaks in the toolbox views and over page breaks in the printed copy as noted below. The comment block does not
generate any code for execution on the target platform.
_COMMENT displays the comment text in both the outline view and the block flow view. In the block flow view it breaks
the diagram. It causes a page break in both the annotated block view printout and the block flow view printout. In the
annotated block view printout it positions the text at the top center of the page and does not display the block graphic in the
diagram. In the block view printout it positions the text in the upper leftmost corner of the page and displays the block
graphic in the diagram.
_COMMENT_BF (break-flow comment block) displays the comment text in both the outline view and the block flow view.
In the block flow view it breaks the diagram. It does not cause a page break in the annotated block view. It does cause a
page break in the block flow printout. In the annotated block view printout it positions the text in the upper leftmost corner
of the page and displays the block graphic beneath. In the block flow view printout it positions the text above the block
graphic in the diagram.
_COMMENT_NB (no-break comment block) displays the comment text in the outline view but not in the block flow view.
It does not break the diagram in the block flow view. It does not cause a page break in either the annotated block view
printout or in the block flow view printout. In the annotated block view printout it positions the text above the block
graphic in the diagram. In the block flow view printout it displays the block graphic in the diagram but not the comment
text.

_COMMENT
BlkDgMode_T

Input
MODE

MODE

BlkDgMode_T Sets the display mode for the following blocks.

If MODE is set to flow_mode the block connections are shown as lines between the pins. If MODE is set to list_mode the
blocks are displayed in a vertical list without graphical pin connections.

SBLIB Block Library 25

Compare
COMPARE_D, COMPARE_F, _COMPARE_I, _COMPARE_L, Math
The Compare block compares two values and sets an output boolean reflecting the result. The comparison functions are
greater than (gt), greater than or equal (ge), equal (eq), not equal (ne), less than or equal (le), or less than (lt).

_ COMPARE_x

CompFnL_T

Input
IN1
FUNC
IN2

Analog
CompFn_T
Analog

Output
OUTPUT

Output, Boolean,

26 SBLIB Block Library

IN1

IN2

FUNC
gt
lt
ge
le
eq
ne

A to B
>
<

=
!=

FUNCT

The input to compare.


The comparison function (gt, lt, ge, le, eq, ne) .
The value to compare against.

the result of the comparison.

OUTPUT

Compare with Hysteresis


_COMHYS, Math
The Compare with Hystersis block compares two real values implementing hystersis and sensitivity, and sets an output
boolean reflecting the result. The comparison functions are greater than (gt), greater than or equal to (ge), equal to (eq),
less than (lt), or less than or equal to (le). The block supports hysteresis and sensitivity defined as the following:
Sensitivity refers to the thickness of the equality relationship. That is, IN1 is equal to IN2 if it is numerically within the
band defined by IN2 +/- SENS.
Hysteresis applies for all relationships. Once any relationship evaluates to TRUE it must exceed the normal specification
by HYST amount before it evaluates to FALSE.

_COMPHYS
f

IN1

IN2

CompFnL_T FUNCT
f

HYST

SENS

FUNC
gt
lt
ge
le
eq

A to B
>
<
>
<
=

Input
IN1
FUNC
IN2
HYST
SENS

Float
CompFn_T
Float
Float
Float

The input to compare.


The comparison function. (gt, lt, ge, le, eq)
The value to compare against.
The hystersis value.
The sensitivity value.

Output
OUTPUT

Boolean

The result of the comparison

OUTPUT

SBLIB Block Library 27

Compress Booleans
_COMPRESS, Memory_Move
The Compress Booleans block packs up to 16 booleans into a single integer variable. For example if the input booleans
contain the values 0000 0000 0000 0101 the output integer would contain the value 5. The least significant input bit is in0
and the most significant input bit is INF. The _EXPAND block performs the opposite operation of the_COMPRESS block.

_COMPRESS

IN0

IN1

b
b

IN2

IN4

IN5

IN6

IN7

b
b

IN8

INA

b
b

INC

OUT

IN3

IN9
INB

IND

INE

INF

Input
IN0
IN1
IN2
IN3
IN4
IN5
IN6
IN7
IN8
IN9
INA
INB
INC
IND
INE
INF

Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean

Contains the first input (least significant binary digit).


Contains the second input.
Contains the third input.
Contains the fourth input.
Contains the fifth input.
Contains the sixth input.
Contains the seventh input.
Contains the eighth input.
Contains the ninth input.
Contains the tenth input.
Contains the eleventh input.
Contains the twelfth input.
Contains the thirteenth input.
Contains the fourteenth input.
Contains the fifteenth input.
Contains the sixteenth input (most significant binary digit).

Output
OUT

Integer

Contains the packed information.

28 SBLIB Block Library

Counter
_COUNTER, Timer_Counters
The Counter block accumulates rising edges of the INC pin into CUR_CNTwhile the RUN is TRUE and CUR_CNT is less
than MAX_CNT. When CUR_CNT is equal to MAX_CNT, AT_CNT transitions to TRUE. If RUN is FALSE then
counting is suspended but the value in CUR_CNT remains. If RESET is TRUE then CUR_CNT is set to zero and counting
is suspended. If MAX_CNT is less than one, each rising edge of INC sets AT_CNT TRUE and increments CUR_CNT.

_COUNTER
b

^INC

AT_CNT

MAX_CNT

CUR_CNT

RESET

STATIC

RUN

Input
^INC
MAX_CNT
RESET
RUN

Boolean
Long Integer
Boolean
Boolean

Triggers another count on its rising edge.


The maximum count value.
Zeros the counter.
Enables the counter.

Output
AT_CNT
CUR_CNT
STATIC

Boolean
Long Integer
Boolean

Indicates the counter has reached the maximum count value.


The current count value (always <= MAX_CNT).
Internal state information. Do not attach to any other block.

SBLIB Block Library 29

Count to Boolean
_CNT_TO_BOOL, Memory_Move
The Count to Boolean block uses an integer input to linearly select one of up to 32, boolean outputs, where N can range
from 1 to 32. The selected output is driven TRUE while all others are driven FALSE. An input value of 0 selects the first
output and an input value of N-1 selects the last output. If the integer input contains a value that is not within the range of 0
to N-1 then all outputs are driven FALSE.

_CNT_TO_BOOL
i

30 SBLIB Block Library

IN

OUT1

OUT2

OUT3

OUT4

OUT5

OUT6

OUT7

OUT8

OUT9

OUT10

OUT11

OUT12

OUT13

OUT14

OUT15

OUT16

OUT17

OUT18

OUT19

OUT20

OUT21

OUT22

OUT23

OUT24

OUT25

OUT26

OUT27

OUT28

OUT29

OUT30

OUT31

OUT32

Inputs
IN

Integer

Selects a particular output Boolean.

Outputs
OUT1
OUT2
OUT3
OUT4
OUT5
OUT6
OUT7
OUT8
OUT9
OUT10
OUT11
OUT12
OUT13
OUT14
OUT15
OUT16
OUT17
OUT18
OUT19
OUT20
OUT21
OUT22
OUT23
OUT24
OUT25
OUT26
OUT27
OUT28
OUT29
OUT30
OUT31
OUT32

Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean

Contains the results of the selection process.


Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.
Contains the results of the selection process.

SBLIB Block Library 31

Derivative
_DERIV, Regulators
The DERIV block computes the derivative or rate of change of the input signal.

ENABLE

DIF_IN

TC

_DERIV

Input
ENABLE
DIF_IN
TC

Boolean
float
float

Enable block execution


Signal to be differentiated.
Lag filter time constant in seconds.

Output
DIF_OUT

Float

Differentiated output signal.

DIF_OUT

The DERIV block computes the derivative of the input signal. It also filters the input signal with a lag time TC in seconds.
The transfer function is of the form s / ( 1 + Ts ).

32 SBLIB Block Library

Device Faults
_DEV_FLTS, Diagnostics
The Device Faults block displays diagnostic information and the state of selected controller faults. To modify the
temperature setpoints see the _TEMP_SET block.

_DEV_FLTS

Output
AIRFLOW

Boolean

OVERTMP
BRD_TMP
CPU_TMP
BRD_SET

Boolean
Integer
Integer
Integer

CPU_SET

Integer

AIRFLOW

OVERTMP

BRD_TMP

CPU_TMP

BRD_SET

CPU_SET

The controller is not receiving adequate airflow, or the ambient temperature around the
module has exceeded its specification.
The controller CPU is overheating and is in imminent danger of misoperation.
Displays the board ambient temperature in degrees Celsius if available, otherwise 0.
Displays the CPU die temperature in degrees Celsius if available, otherwise 0.
The board ambient temperature setpoint in degrees Celsius that triggers the AIRFLOW
warning if board ambient temperature is available.
The CPU die temperature setpoint in degrees Celsius that triggers the OVERTMP alarm if the
CPU die temperature is available.

SBLIB Block Library 33

Dynamic Group
_DYNAMIC_GRP, Communications
The Dynamic Group block transmits a message that adds or removes a device from various dynamic groups and is similar
to the message maker block. The groups are defined by the GROUPS(N) inputs and the device is specified by the
DEV_NET pin.
_DYNAMIC_GRP
b
Chg_det_T

WHN2SND

SEND

DLOG

HowToSend

34 SBLIB Block Library

ENABLE

HOW

Drop

FROM

Drop

TO

Add_del_T

ADD_DEL

Dev_Net

DEV_NET

Group

GROUP1

Group

GROUP2

Group

GROUP3

Group

GROUP4

Group

GROUP5

STATUS

Input
ENABLE
WHN2SND

Boolean
Chg_det_T

SEND
DLOG
HOW

Boolea,
Boolean
HowToSend

If TRUE the block executes.


Determines how to evaluate the SEND pin.
level - while SEND is TRUE
rising - rising edge of SEND
falling - falling edge of SEND
both - both rising and falling edges of SEND
In conjunction with the WHN2SND pin determines when a transmission will occur.
Disable mode logging of the messages sent by this block.
Specifies how the message is sent.
DIRECT - the message will only be sent directly to a single dlan device specified on the
Device pin
BROADCAST- the message will be broadcast to the devices specified by the FROM and

TO
pins. If the FROM and TO pins are not connected to a device then the message will be
sent
to all devices.
GROUP_NAME - If a group name is connected to this pin the message will be sent to all
devices in the group specified by the FROM , TO pins. As with the "BROADCAST"
specification the message will be sent to all devices in the group if FROM and TO are
not
FROM
TO
ADD_DEL
DEVICE
GROUP1
GROUP2
GROUP3
GROUP4
GROUP5

Drop
Drop
Add_del_T
Dev_Net
Group
Group
Group
Group
Group

connected to a device
From drop number (used if nonzero)
To drop number (used if nonzero)
Specifies whether the device(s) will be added or deleted from group designation(s).
The device or network the message will be sent to.
The first dynamic group.
The second dynamic group.
The third dynamic group.
The fourth dynamic group.
The fifth dynamic group.

Output
STATUS

Long Integer

Internal pointer to the message status information.

SBLIB Block Library 35

Engineering Scale
ENG_SCL, Math
The scale to engineering units block evaluates the input variable scale definition information and produces as an output a
new scale factor used to convert the input signal into per unit counts.
ENG_SCL
b

ENABLE

IN

ENG

SCALE

Input
ENABLE
IN
SCALE

Boolean
Analog
Float

Set to true to enable the block.


Input signal whose read_gain scaling information is used.
Scale variable (MAX RAW UNITS/ MAX TRG_UNITS).

Output
ENG

Float

Engineering scale (IN.read_gain * SCALE).

36 SBLIB Block Library

Exit Macro
_EX_MAC, Program_Control
The Exit Macro block immediately exits the execution of a block macro if its ENABLE pin is TRUE. Otherwise execution
continues within the macro.

_EX_MAC
b

Input
ENABLE

Boolean

ENABLE

If TRUE exit the macro, else continue execution.

SBLIB Block Library 37

Exit Task
_EX_TSK, Program_Control
The ExitTask block immediately exits the execution of a task if its ENABLE pin is TRUE. Otherwise execution continues
within the task.
_EX_TSK
b

Input
ENABLE

Boolean

38 SBLIB Block Library

ENABLE

If TRUE exit the task, else continue execution.

Expand Integer
_EXPAND, Memory_Move
The Expand Integer block transforms the input into its binary equivalent form and stores the expanded information into 16
simple, boolean outputs. For example if the value of the input is 5, the output booleans would contain the values 0000 0000
0000 0101. The least significant output bit is pin OUT0 and the most significant output bit is pin OUTF. The
_COMPRESS block performs the opposite operation.

_EXPAND

IN

OUT
0
OUT
1
OUT
2
OUT
3
OUT
4
OUT
5
OUT
6
OUT
7
OUT
8
OUT
9
OUTA
OUT
B
OUTC
OUT
D
OUT
E
OUT
F

b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b

Input
IN

Integer

value to expand.

Output
OUT0
OUT1
OUT2
OUT3
OUT4
OUT5
OUT6
OUT7
OUT8
OUT9
OUTA
OUTB
OUTC
OUTD
OUTE
OUTF

Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean

Contains the results of the expansion process (least significant binary digit).
Contains the results of the expansion process.
Contains the results of the expansion process.
Contains the results of the expansion process.
Contains the results of the expansion process.
Contains the results of the expansion process.
Contains the results of the expansion process.
Contains the results of the expansion process.
Contains the results of the expansion process.
Contains the results of the expansion process.
Contains the results of the expansion process.
Contains the results of the expansion process.
Contains the results of the expansion process.
Contains the results of the expansion process.
Contains the results of the expansion process.
Contains the results of the expansion process (most significant binary digit).

SBLIB Block Library 39

Exponential S-Curve Ramp


_ECDB, Regulators
The ECDB ramp block takes a current_ramp and increments and decrements the value until the final value is reached. The
current_ramp value is modified each time by the value specified in the accel_rate or decel_rate field. The output is rounded
by the amount in the rnd_in field.

_ECDB
ENABLE

FINAL

f
f

ACCEL
DECEL

RND_IN

DRAW

ADD

QUIKPS

AT_FINAL

NDR

TDR

Input
ENABLE
FINAL
ACCEL
DECEL
RND_IN
DRAW
ADD
QUIKPS

Boolean
float
float
float
float
float
float
Boolean

enable block execution


Ramp input.
Acceleration rate in PU per second.
Deceleration rate in PU per second.
S-curve round in/out time in seconds.
Ramp output multiplier.
Ramp output offset.
Bypass Ramp.

Output
ATFINAL
NDR
TDR

Boolean
float
float

Indicates output of ramp equals input.


FINAL input parameter with scaling applied.
ramp output value with scaling applied.

The ECDB ramp block takes a current_ramp and increments or decrements the value until the final value is reached. The
rate that the current_ramp in changed towards the final value is determined by the accel_rate and decel_rate value in PU per
second. For example if the out put is desired to ramp to 500 in 25 seconds, set accel_rate at (500/25) = 20 seconds. The
output of the ramp block is conditioned by two first-order lag filters. The time constant of the lag filters are equal and are
equal to the RND_IN time is seconds divided by 3. This allows the ECDB block to exhibit the same behavior as the
equivalent block that is presently implemented on the DC2000 drive product. The output is further condition by the
multiplying it with the DRAW scalar and with the ADD offset added to it.

40 SBLIB Block Library

Exponential S-Curve Ramp with Hold


_ECDBH, Regulators
The ECDB ramp block generates a linear ramp and increments and decrements the value until the final value is reached.
The linear ramp value is modified each time by the value specified in the accel_rate or decel_rate field. The output is
rounded by the amount in the rnd_in field.
_ECDBH
b

ENABLE

FINAL

ATFINAL

f
f

ACCEL

AT_HOLD

NDR

CURRAMP

DECEL
RND_IN
DRAW

TSR

ADD

TDR

QUIKPS

HOLD

Scratch [8]

Input
ENABLE
FINAL
ACCEL
DECEL
RND_IN
DRAW
ADD
QUIKPS
HOLD

Boolean
Float
Float
Float
Float
Float
Float
Boolean
Boolean

enable block execution


Ramp input.
Acceleration rate in PU per second.
Deceleration rate in PU per second.
S-curve round in/out time in seconds.
Ramp output multiplier.
Ramp output offset.
Set outputs to final value.
Round into the current ramp.

Output
ATFINAL
AT_HOLD
NDR
CURRAMP
TSR
TDR

Boolean
Boolean
Float.
Float.
Float
Float.

Indicates outputs at final value.


Indicates constant speed while in HOLD.
FINAL input parm with scaling applied.
Value of the linear ramp component.
Ramp output without scaling applied.
Ramp output with scaling applied

State
SCRATCH [8] Double

f
f
d

Internal state variables - do not use.

The ECDBH ramp block takes a current_ramp and increments or decrements the value until the final value is reached. The
rate that the current_ramp in changed towards the final value is determined by the accel_rate and decel_rate value in PU per
second. For example if the out put is desired to ramp to 500 in 25 seconds, set accel_rate at (500/25) = 20 seconds. The
output of the ramp block is conditioned by two first-order lag filters. The time constant of the lag filters are equal and are
equal to the RND_IN time is seconds divided by 3. This allows the ECDB block to exhibit the same behavior as the
equivalent block that is presently implemented on the DC2000 drive product. The output is further condition by the
multiplying it with the DRAW scalar and with the ADD offset added to it.
This block has a hold parameter that can be applied during the ramp. This will cause the block to round in to the current
linear ramp value for the block.
This block handles the "quick pass" and "at final" differently than the ECDB block. The output parameters are all set to the
final target when QUIKPS is set. The ECDB block sets the linear ramp to the target and then use the round in filter to reach
the target. Like wise, the "at final" parameters is set when the output parameters reach their final value instead of when the
linear ramp reaches its target as in the ECDB block.

SBLIB Block Library 41

Finite Impulse Response


_FIR, Filters
The Finite Impulse Response block implements a filter of the form:
N 1

o(t ) = 0 g ( n) * i (t n)
Where:
t
o(t)
N
g
n
I

= Time sample (t=0 for the present time)


= Block output after this sweep
= Number of filter taps
= Gain for a particular tap
= Tap number (0 < n)
= input

If PRESET is TRUE then all the filter states will be set to PVAL before the filter calculation is made. Note that the IN
value affects the OUT value even when the PRESET pin is TRUE since the filter calculation still occurs in the preset mode.
_FIR
b

ENABLE

IN

STATE

GAIN

PRESET

PVAL

OUT

Input
ENABLE
IN
STATE
GAIN
PRESET
PVAL
N

Boolean
Float
Float
Float
Boolean
Float
Long Integer

Turns the block on or off.


Present input.
State variable array.
Gain array.
Preset flag.
Preset value.
Number of taps in the filter.

Output
OUT

Float

Filter output.

42 SBLIB Block Library

Function Generator
_FUNGEN, Data_Collection
The function generator block creates common signal functions for test and verification. Only a subset of the pins are
required to configure each function type. The function and/or any of its parameters may be dynamically changed.

_FUNGEN
b
Fungen_T

Input
ENABLE
FUNC

Boolean,
Fungen_T,

MIN_VAL

ENABLE

OUTPUT

FUNC

STATE[6]

MAX_VAL

PERIOD1

MIN_VAL

PERIOD2

A_RATE

D_RATE

Enables the block to execute.


Function to generate:
step (1)
- Drives the output to MAX_VAL in one sweep.
square wave (2)
- Oscillates between MAX_VAL and MIN_VAL, holding MAX_VAL for PERIOD1 and
for PERIOD2. The sequence always begins with MAX_VAL.
ramp (3)
- Ramps the output to MAX_VAL. If the output is less than MAX_VAL the ascending

ramp
rate, A_RATE is used. If the output is greater than MAX_VAL the descending ramp rate
D_RATE is used.
triangle wave (4)
- Repetitively ramps from MAX_VAL to MIN_VAL at D_RATE and back to MAX_VAL at
A_RATE. At startup if the output is greater than MAX_VAL the descending cycle will
commence first. Otherwise the ascending cycle will commence first.
sine wave (5)
- Generates a sinusoidal wave between the amplitudes of MAX_VAL and MIN_VAL with
a
period of PERIOD1. The waveform commences at 0 degrees regardless of the initial
output
MAX_VAL

Float,

value.
Signed, maximum value of the output (unless the initial value of the output is already
greater than MAX_VAL). For proper operation MAX_VAL should always be greater than

or
PERIOD1

Float,

MIN_VAL

Float,

PERIOD2
A_RATE
D_RATE

Float,
Float,
Float,

equal to MIN_VAL.
Time period in Seconds for the sine wave function, or for the MAX_VAL portion of the
square wave function.
Signed, minimum value of the output. For proper operation MIN_VAL should always be
less than or equal to MAX_VAL.
Time period in Seconds for the MIN_VAL portion of the square wave function.
Ascending ramp rate in units/Second.
Descending ramp rate in units/Second.

Output
OUTPUT

Float

Output of the function.

State
The function generator cannot be placed in an event-only scheduled task or it will generate expansion error #171.
STATE[6]
Float
Internal state variables, not for external use.

SBLIB Block Library 43

Genius Input Conversion


_GENI_IN_CVT, I/O
This block converts parallel Genius boolean inputs into a long integer, guaranteeing coherency as long as the inputs come
from the same Genius block or Field I/O module. Currently, BCD, GRAY, and BINARY coded booleans are decoded. Up
to 32 inputs may be specified (though less may be a limitation for coherency). The ERR pin is set if an invalid conversion
code is specified, if an invalid BCD coded value is encountered, or if an error occurs in obtaining or releasing a uGeni lock.
In any of these cases, the last valid value remains on the OUT pin.

_GENI_IN_CVT
b
OutCvrt_T
b

44 SBLIB Block Library

ENABLE
FCN
NEGATE

IN1

IN2

IN3

IN4

IN5

IN6

IN7

IN8

IN9

IN10

IN11

IN12

IN13

IN14

IN15

IN16

IN17

IN18

IN19

IN20

IN21

IN22

IN23

IN24

IN25

IN26

IN27

IN28

IN29

IN30

IN31

IN32

ERR

OUT

Input
ENABLE
FCN
NEGATE
IN1
IN2
IN3
IN4
IN5
IN6
IN7
IN8
IN9
IN10
IN11
IN12
IN13
IN14
IN15
IN16
IN17
IN18
IN19
IN20
IN21
IN22
IN23
IN24
IN25
IN26
IN27
IN28
IN29
IN30
IN31
IN32

Boolean
OutCvrt_T
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean

Enable block execution.


Conversion to perform.
A control, which if TRUE, causes the output to be negated..
Input boolean (least significant bit).
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean.
Input boolean (most significant bit).

Output
ERR
OUT

Boolean
Long Integer

TRUE if an invalid coding is detected or if unknown conversion is specified, otherwise FALSE.


Numerical value of the coded booleans.

SBLIB Block Library 45

Genius Type B High-speed Counter Block Configure


_GENI_HSCB, I/O
The Genius High-speed Counter configure block sets the Preload Value and On/Off Preset registers of type B High-speed
Counter blocks with specified values. These values may be of integer or floating point type and may be scaled.
__GENI_HSCB
Point_S
Analog

HSCBSIG

ERR

PLDVAL

PLDDONE

ON1DONE

ON2DONE

^ON1SET

OF1DONE

Analog

ON2DEF

OF2DONE

b
Analog

^ON2SET

STATES[5]

^OF1SET

^PLDSET

Analog ON1DEF
b

Analog
b

Input
HSCBSIG

Point S

PLDVAL

Analog

PLDSET

Boolean

ON1VAL

Analog

ON1SET

Boolean

ON2VAL

Analog

ON2SET

Boolean

OF1VAL

Analog

scaling.)
OF1SET

Boolean

OF2VAL

Analog

scaling.)
OF2SET

Boolean

46 SBLIB Block Library

OF1DEF

OF2DEF
^OF2SET

Signal attached to either the HSC accumulator or strobe registers (identifies the HSC block and
the particular counter to be configured).
scaled value which is converted to raw counts and written to the Preload Value register. (The
definition associated with the HSCBSIG signal is used in the scaling.)
Preload Value register initialize set TRUE to latch the value specified by the PLDVAL pin into
the appropriate Preload Value register. This action occurs on the variable's rising edge.
scaled value which is converted to raw counts and written to the corresponding ON1 Preset
register. (The scale definition associated with the HSCBSIG signal is used in the scaling.)
ON1 Preset register initialize set TRUE to latch the value specified by the ON1DEF pin into the
corresponding ON1 Preset register. This action occurs on the variable's rising edge.
scaled value which is converted to raw counts and written to the corresponding ON2 Preset
register. (The scale definition associated with the HSCBSIG signal is used in the scaling.)
ON2 Preset register initialize set TRUE to latch the value specified by the ON2DEF pin into the
corresponding ON2 Preset register. This action occurs on the variable's rising edge.
scaled value which is converted to raw counts and written to the corresponding OFF1 Preset
register. (The scale definition associated with the HSCBSIG signal is used in the
OFF1 Preset register initialize set TRUE to latch the value specified by the ON2DEF pin into
the corresponding OFF1 Preset register. This action occurs on the variable's rising edge.
scaled value which is converted to raw counts and written to the corresponding OFF2 Preset
register. (The scale definition associated with the HSCBSIG signal is used in the
OFF2 Preset register initialize set TRUE to latch the value specified by the ON2DEF pin into
the corresponding OFF2 Preset register. This action occurs on the variable's rising edge.

Output
ERR

Boolean

Error indication set TRUE when either a product system failure occurs or if no Genius pcode
has been loaded. Also set when a Preload Value or ON/OFF Preset Register initialization fails

PLDDONE

Boolean

Preload Value register initialization done indication. Not set by the block, it is set TRUE
subsequent to the block's execution when the ensuing configuration datagram has been by the
sys. It is reset when a PLDSET falling edge is detected.

ON1DONE

Boolean

ON1 Preset register initialization done indication. Not set by the block, it is set TRUE
subsequent to the block's execution when the ensuing configuration datagram has been
sent.

ON2DONE

Boolean

It is reset when an ON1SET falling edge is detected. ON2 Preset register initialization
done indication. Not set by the block, it is set TRUE subsequent to the block's
execution when the ensuing configuration datagram has been sent. It is reset when an
ON2SET falling edge is detected.

OF1DONE

Boolean

OFF1 Preset register initialization done indication. Not set by the block, it is set TRUE
subsequent to the block's execution when the ensuing configuration datagram has been
sent. It is reset when an OF1SET falling edge is detected.

OF2DONE

Boolean

OFF2 Preset register initialization done indication. Not set by the block, it is set
TRUEsubsequent to the block's execution when the ensuing configuration datagram has
been sent. It is reset when an OF2SET falling edge is detected.

Genius High-speed Counter block registers is set via datagrams transmitted on the Genius bus. The _GENI_HSCB block
facilitates such activity, providing the means to individually set the accumulator Preload Value register, both output enable
On registers, and both output enable Off registers (as provided by the type B counter configuration). Register configuration
is initiated by the rising edge of the appropriate "set" input pin. Once the datagram has been sent, the corresponding "done"
output pin is set TRUE, or, if an error occurred, the ERR output pin is set TRUE. The "done" pin is reset when the
corresponding "set" input pin is cleared; the ERR pin is reset upon the next successful configuration operation.
The _GENI_HSCB block does not wait for datagram transmission before completing its execution, since delays in the order
of 50ms may accrue in such operations, and foreground scans may not be delayed this long. Thus, the "done" and ERR
output pins are set asynchronously in subsequent scans of the block.
NOTE
Configuration datagrams are not actually sent by the _GENI_HSCB block, but by the runtime process that services toolbox
clients. When requesting service, the _GENI_HSCB block is delayed until the server process receives the request. Though
this delay is nominally brief, it may increase if other toolbox requests are pending (requests are serviced on a first come,
first served basis). Thus, the user should exercise caution in activating _GENI_HSCB blocks in foreground charts where
indeterminate delays cannot be tolerated. Employing multiple _GENI_HSCB blocks is discouraged since activating the
second block may halt task execution if the first block has been activated and is being serviced by the server process.
The signal attached to the HSCBSIG pin identifies the High-speed Counter block and particular counter to be configured; it
may be either the signal attached to the Accumulator or one of the Strobe Register points of the counter to be preset. The
value input pins specify the values to be set in the registers, and may be either integers or floats. They are scaled
according to the scale definition attached to the signal on the HSCBSIG pin.

SBLIB Block Library . 47

Get From Array


_GET_B, _GET_D, _GET_F, _GET_I, _GET_L, Memory_Move
The Get From Array blocks move a value from an array into a signal of the same datatype. A block exists for each of the
analog datatypes and is identified by its suffix. The data transfer occurs each time the block executes and the ENABLE pin
is TRUE. The array index N is interpreted as an unsigned long integer. If N is out of range the block transfers the last
element in the array.
_GET_a
b

ENABLE

SRC[ ]

DEST

Input
ENABLE
SRC[]
N

Boolean
Analog
Long Integer

If TRUE the block executes.


Source array.
Source array index (0 based, interpreted internally as unsigned).

Output
DEST

Analog

Destination variable.

48 SBLIB Block Library

Infinite Impulse Response


_IIR, Regulators
The Infinite Impulse Response Filter can be configured to act as various filters, including low pass, high pass, and notch
filters. The Filter is configured by selecting the values for the A and B pins that create the appropriate filter. The coefficents
are then used in the following equation to filter the input signal. To implement higher order filters, Use a series cascade of
the biquad stages.
N 1
Y (z)
A[(3 * i) + 0] + A[(3 * i ) + 1] z 1 + A[(3 * i) + 2] z 2
= K
X ( z)
1 + B[(2 * i) + 0] z 1 + B[(2 * i) + 1]z 2
i =0

Where:
N = number of stages of the filter
Y = output of filter
X = input value
A, B = arrays of coefficents

_IIR

INPUT

OUTPUT

A[]

DELAY[]

B[]

ENA_FIL

STAGES

Inputs
INPUT
A
B
ENA_FIL
STAGES

float array
float array
float array
boolean
const integer

Input signal
Input Coefficients
Output Coefficients
Enables exocution of the filter
Number of stages in the filter

Outputs
OUTPUT

float array

signal after the filter

States
DELAY

double array

stored values for the computation of the output

SBLIB Block Library 49

For one stage, this Z domain transfer equation would look like:

Y ( z ) = ( A[0] + A[1]z 1 + A[2]z 2 ) * X ( z ) ( B[0]z 1 + B[1]z 2 ) * Y ( z )

The time domain representation (for one 2nd order stage) would be:

y (n) = A[0] * x(n) + A[1] * x(n 1) + A[2] * x(n 2) B[0] * y (n 1) + B[1] * y(n 2)
The size of the array pointed to by 'a' must be greater than or equal to Nx3 where N is the number of second order stages
required to implement the filter. Similarly b must point to the starting address of an array of size greater than or equal to
Nx2 array (the first term in the denominator will always be 1.0).
For example, a 5th order filter would require 3 stages (i.e. 2 full sets of 2nd order equation coefficents and a third set with
the A[2][2] and B[2][2] elements being set to 0.0).

H ( z) =

( A[0] + A[1]z 1 + A[2]z 2 )( A[3] + A[4]z 1 + A[5]z 2 )( A[6] + A[7]z 1 + 0 z 2 )


(1 + B[0]z 1 + B[1]z 2 )(1 + B[2]z 1 + B[3]z 2 )(1 + B[4]z 1 + 0 z 2 )

The delay elements parameter delay must be an array of size Nx2. Unlike the filter coefficients a & b which are constant,
the dly elements are the filter's states.
Any gain factor K must be distributed through the numerator coefficients (multiply A[i][j] by K1/N ).

Signal Flow Graph

x(n)

a[0]

z-1
+

b[0]

y(n)

x(n)

Repeat for each stage


a[1]

z-1
+

b[1]

a[2]

Stage 1

50 SBLIB Block Library

a[(3*i)+0]
z-1

b[(2*i)+0] a[(3*i)+1]
z-1

b[(2*i)+1] a[(3*i)+2]

Stage i

y(n)

Input Conversion
_IN_CVRT, I/O
This block converts coded decimal booleans into a long integer. Currently BCD (Binary Coded Decimal), BINARY and
GRAY coded booleans are decoded. Up to 32 inputs may be specified in groups of four. The ERROR pin will be set if
inputs contain an invalid conversion code or coded value, and the last valid value will remain on the OUTPUT pin.

_IN_CVRT
b
OutCvrt_T

ENABLE
FCN

SIGN

IN11

IN12

IN13

IN14

IN21

IN22

IN23

IN24

IN31

IN32

IN33

IN34

IN41

IN42

IN43

IN44

IN51

IN52

IN53

IN54

IN61

IN62

IN63

IN64

IN71

IN72

IN73

IN74

IN81

IN82

IN83

IN84

ER
R

OUT

SBLIB Block Library 51

Input
ENABLE
FCN
SIGN
IN11
IN12
IN13
IN14
IN21
IN22
IN23
IN24
IN31
IN32
IN33
IN34
IN41
IN42
IN43
IN44
IN51
IN52
IN53
IN54
IN61
IN62
IN63
IN64
IN71
IN72
IN73
IN74
IN81
IN82
IN83
IN84

Boolean
OutCvrt_T
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean

Enable block execution.


Conversion to perform.
Sign of the Coded value (FALSE = positive, TRUE = negative).
First (least significant) input boolean in the first set of four booleans.
Second input boolean in the first set of four booleans.
Third input boolean in the first set of four booleans.
Fourth (most significant) input boolean in the first set of four booleans.
First (least significant) input boolean in the second set of four booleans.
Second input boolean in the second set of four booleans.
Third input boolean in the second set of four booleans.
Fourth (most significant) input boolean in the second set of four booleans.
First (least significant) input boolean in the third set of four booleans.
Second input boolean in the third set of four booleans.
Third input boolean in the third set of four booleans.
Fourth (most significant) input boolean in the third set of four booleans.
First (least significant) input boolean in the fourth set of four booleans.
Second input boolean in the fourth set of four booleans.
Third input boolean in the fourth set of four booleans.
Fourth (most significant) input boolean in the fourth set of four booleans.
First (least significant) input boolean in the fifth set of four booleans.
Second input boolean in the fifth set of four booleans.
Third input boolean in the fifth set of four booleans.
Fourth (most significant) input boolean in the fifth set of four booleans.
First (least significant) input boolean in the sixth set of four booleans.
Second input boolean in the sixth set of four booleans.
Third input boolean in the sixth set of four booleans.
Fourth (most significant) input boolean in the sixth set of four booleans.
First (least significant) input boolean in the seventh set of four booleans.
Second input boolean in the seventh set of four booleans.
Third input boolean in the seventh set of four booleans.
Fourth (most significant) input boolean in the seventh set of four booleans.
First (least significant) input boolean in the eighth set of four booleans.
Second input boolean in the eighth set of four booleans.
Third input boolean in the eighth set of four booleans.
Fourth (most significant) input boolean in the eighth set of four booleans.

Output
ERR
OUT

Boolean
Long Integer

TRUE if an invalid coding is detected or if unknown conversion is specified, otherwise FALSE.


Numerical value of the coded booleans.

52 SBLIB Block Library

Integrator With Lead


_INTWLEAD, Regulators
The _INTWLEAD block computes the integral of IN with a lead term,

OUT = IN 1 + s
LD _ FREQ

s
OUT is clamped between the upper and lower clamps, HLIM and LLIM. When PRESET is TRUE, OUT IS set to the initial
value PR_VAL, clamped between HLIM and LLIM.
_INTWLEAD
ENABLE

PRESET

IN_MAX

PR_VAL

IN_MIN

IN

LD_FREQ

HLIM

LLIM

OUT

SCRATCH[7]

Input
ENABLE
PRESET
PR_VAL
IN
LD_FREQ
HLIM
LLIM

Boolean
Boolean
Float
Float
Float
Float
Float

Enable the block's output update.


Preset flag
Preset value
Input(t)
The radian frequency of the lead term
Upper clamp
Lower clamp

Output
OUT
IN_MAX
IN_MIN

Float
Boolean
Boolean

Output
In upper clamp
In lower clamp

State
SCRATCH[7] Integer

Internal state variables, pin is normally hidden

SBLIB Block Library 53

I/O Simulation
_IO_SIM, I/O
The _IO_SIM block writes raw values into the simulation structures for each of the specified Input points and puts those
points into simulation mode. This means that the next and subsequent Input transfers for these points use the simulation
value instead of the value written by the application code. Setting the EN_SIM pin TRUE allows the writes to occur and
turns on simulation for the points. Setting the EN_SIM pin FALSE stops the writes and turns off simulation for the points.
The PU_DLY (pickup delay) and DO_DLY (dropout delay) pins specify in milliseconds the delay between the state
change of any boolean raw value and its corresponding point. Forcing overrides simulation. Simulation is denoted in the
toolbox with a capital 'S' beside the live data point value. The most common programming error is a datatype mismatch
between the raw value and the corresponding Input point. Boolean values must be associated with boolean points.
Likewise analog values must be associated with analog points. Otherwise the runtime returns the expansion error 143
(E_BAD_XFER_DTYPE). Output points cannot be simulated.

54 SBLIB Block Library

_IO_SIM
b

EN_SIM

PU_DLY

DU_DLY

RAWVAL1

POINT1

RAWVAL2

POINT2

RAWVAL3

POINT3

RAWVAL4

POINT4

RAWVAL5

POINT5

RAWVAL6

POINT6

RAWVAL7

POINT7

RAWVAL8

POINT8

RAWVAL9

POINT9

RAWVAL10

POINT10

RAWVAL11

POINT11

RAWVAL12

POINT12

RAWVAL13

POINT13

RAWVAL14

POINT14

RAWVAL15

POINT15

RAWVAL16

POINT16

RAWVAL17

POINT17

RAWVAL18

POINT18

RAWVAL19

POINT19

RAWVAL20

POINT20

RAWVAL21

POINT21

RAWVAL22

POINT22

RAWVAL23

POINT23

RAWVAL24

POINT24

RAWVAL25

POINT25

RAWVAL26

POINT26

RAWVAL27

POINT27

RAWVAL28

POINT28

RAWVAL29

POINT29

RAWVAL30

POINT30

RAWVAL31

POINT31

RAWVAL32

POINT32

SBLIB Block Library 55

Input
EN_SIM

Boolean

Output
POINT1 - 32

Point_S

Enable block simulation. Puts the points into simulation mode and writes the raw values when
TRUE. Removes the points from simulation mode and stops writing the raw values when
FALSE.
PU_DLY
Short Integer Pickup delay. For all the Boolean points on the block this pin specifies the time delay in
milliseconds from when the raw value changes from FALSE to TRUE until that change is
written to the point's simulation value.
DO_DLY
Short Integer Dropout delay. For all the Boolean points on the block this pin specifies the time delay in
milliseconds from when the raw value changes from TRUE to FALSE until that change is
written to the point's simulation value.
RAWVAL1-32 Simple
Raw value to be written to the point's simulation value. No scaling is performed in this data
transfer so that scaling records may be verified by the normal Input transfer.

State
STATE1 - 32
the

Input point to be simulated.

Short Integer A state variable is associated with each Input point specified. This variable has no value to
user so it is not shown on the block diagram. There is no need to ever attach a signal to any

of
the state pins.

56 SBLIB Block Library

ISBus Reference Page Disable


_ISB_REF_DIS, I/O
This block, only applicable to ISBus masters, provides a mechanism for disabling ISBus reference pages from being
written to slave hosts. Disabled reference pages are actually transmitted but are not written to memory in associated slave
destinations. Corresponding feedback pages from those slaves are returned to the master. Thus, disabling ISBus reference
pages is tantamount to putting associated slave drops in a read-only mode on a page-by-page basis. Since this is a rubber
block, multiple reference pages may be disabled with one block instance.

_ISB_REF_DIS
PageID_S REF1
b

Input
REF1
DISRF1

RF3STA

DISRF3
.

PageID_S REF32
b

RF2STA

DISRF2

PageID_S REF3
b

DISRF1

PageID_S REF2
b

RF1STA

RF32STA

DISRF32

PageID_S
Boolean

ISBus reference page identifier.


Disable identified reference page output when true.

REF32
DISRF32

PageID_S
Boolean

ISBus reference page identifier.


Disable identified reference page output when true.

Output
RF1STA

Boolean

ISBus reference page enable/disable status: true indicates disabled.

Boolean

ISBus reference page enable/disable status: true indicates disabled.

.
.
.

.
.
.
RF32STA

To disable an ISBus reference page from being written to a slave host, the page is identified by putting any of its signals on
a REFx input pin and setting the conrresponding DISRFx pin true. The corresponding RFxSTA status output pin goes true
when the refererence page is disabled. The output pin is used as a state by the block so that it can detect a rising or falling
edge on the disable pin signal. (Enabling and disabling only takes place at such times.) Up to 32 reference pages may be
disabled independently by one block instance. Feedback pages corresponding to disabled reference pages continue to
update as before.

SBLIB Block Library 57

Lag Filter
LAG, Regulators
The Lag block filters the input signal with a first order lag filter.
f
f
f

_LAG
ENABLE
LAG _IN
TC

Input
ENABLE
LAG_IN
TC

Boolean
float
float

Enable block execution


Signal to filtered.
Filter time constant in seconds.

Output
LAG_OUT

float

Filtered signal.

LAG_OUT

The LAG block filters the input signal with a first order lag filter. The lag time constant is expressed in seconds. The
transfer function of the filter is of the form 1 / ( 1 + Ts).

58 SBLIB Block Library

Latch
_LATCH, Memory_Move
The Latch block sets or resets OUT based on the current values of SET and RESET, and the previous value of OUT
according to the following truth table:
RDOM
X
X
X
X
X
X
1
0

SET(t)
0
0
0
0
1
1
1
1

RESET(t)
0
0
1
1
0
0
1
1

OUT(t)
0
1
0
1
0
1
X
X

OUT(t+1)
0
1
0
0
1
1
0
1

_LATCH
b

SET

RESET

RDOM

OUT

Input
SET
RESET
RDOM

Boolean
Boolean
Boolean

Set input .
Reset input.
If TRUE RESET dominates the latch, else SET dominates.

Output
OUT

Boolean

Output of the latch.

SBLIB Block Library 59

Limit Detect Auto


_LD_AUTO, Communications
The Automatic Limit Detection block evaluates the INPUT variable using the limit information available from the signal
definition and communicates the results through five alarm state booleans.

_LD_AUTO
b ENABLE

*
*
*
*
*
*

Sc ale_
A

INPUT

*
*
*
*
+ **
+
+
+
+
+

+
+
+
+
+

+
+
+
+
+
+
+ *
*
*
*
*
*

HH_STATE b

*
*
*
*
*
*

H_STATE

N_STATE

L_STATE b

+
+
+
+

LL_STATE

Input
ENABLE
INPUT

Boolean
Scale_A

If TRUE the block executes.


Identifies a floating point variable and the scaling record defined for it.

Output
HH_STATE
H_STATE
N_STATE
L_STATE
LL_STATE

Boolean
Boolean
Boolean
Boolean
Boolean

Indicates that the input variable is in the HIGH-HIGH limit.


Indicates that the input variable is in the HIGH limit.
Indicates that the input variable is not in any limit condition.
Indicates that the input variable is in the LOW limit.
Indicates that the input variable is in the LOW-LOW limit.

60 SBLIB Block Library

Limit Detect Manual


_LD_MAN, Communications
The Manual Limit Detection block evaluates the INPUT variable per a list of limit specifications and communicates the
results through five alarm state booleans.
_LD_MAN
b ENABLE
f

MAX_VAL

HH_LIMIT

#f
f
#f

f
#f
f
#f

*
*
*
*
*
*

HH_HYST_%
H_LIMIT
H_HYST_%

L_LIMIT
L_HYST_%
LL_LIMIT
LL_HYST_%

f IN

*
*
*
*
+ **
+
+
+
+
+
+

+
+
+
+
+

+
+
+
+
+
+
+ *
*
*
*
*
*

*
*
*
*
*
*

+
+
+
+

Input
ENABLE
IN
MAX_VAL
HH_LIMIT
HH_HYST
H_LIMIT
H_HYST
L_LIMIT
L_HYST
LL_LIMIT
LL_HYST

Boolean
Float
Float
Float
Float
Float
Float
Float
Float
Float
Float

Turns the block on or off.


Identifies the signal to evaluate.
maximum value of the input signal.
HIGH-HIGH limit value.
HIGH-HIGH hysteresis in percent of MAX _VAL.
HIGH limit value.
HIGH hysteresis in percent of MAX_VAL.
LOW limit value.
LOW hysteresis in percent of MAX_VAL.
LOW-LOW limit value.
LOW-LOW hysteresis in percent of MAX_VAL.

Output
HH_STATE
H_STATE
N_STATE
L_STATE
LL_STATE

Boolean
Boolean
Boolean
Boolean
Boolean

Indicates that the input variable is in the HIGH-HIGH limit.


Indicates that the input variable is in the HIGH limit.
Indicates that the input variable is not in any limit condition.
Indicates that the input variable is in the LOW limit.
Indicates that the input variable is in the LOW-LOW limit.

HH_STATE

H_STATE

N_STATE

L_STATE

LL_STATE

SBLIB Block Library 61

Linear Interpolator
_INTERP, Math
This block generates a function of INPUT into OUT by linear interpolation. The argument table x[n] is searched using
INPUT as the key. OUT is then calculated from the function table y[n] using the search index from the argument table and
interpolating between the values. The slope of out is calculated and written to m.
OUT = y[i] + ((y[i+1] - y[i]) * ((INPUT - x[i]) / (x[i+1] - x[i]))),
where i is the index resulting from the binary search of the argument table. The table size must be greater than or equal to
2. OUT is clamped to either the first or last element in the function table if INPUT is not within the range of the argument
table elements. The slope m is calculated as follows when INPUT is within the limits of the argument table:
y(i+1) - y(i)
m = -------------x(i+1) - x(i)
Otherwise m is defined to be the slope of a line between the nearest function table endpoint element and the element next to
it.
_INTERP
b

ENABLE

Y(N)
Y(N)
Y(3)
Y(2)

OUT

Y(1)
f

X(N)

INPUT

X(1) X(2)

X(3)

X(N)

Input
ENABLE
IN
N
X[N]
Y[N]

Boolean
Float
Long Integer
Float
Float

Allows block execution.


Input value.
Number of elements in the argument and function tables.
Argument table (values must be monotonically increasing).
Function table.

Output
OUT
M

Float
Float

Interpolated output.
Slope of the output function.

62 SBLIB Block Library

Load Disable
_LOAD_DIS, PseudoControl
The _LOAD_DIS block enables the application to block offline loads (done via either the Toolbox or the low level
Monitor. When the block is enabled, offline loads are disabled based on the state of the DIS_LD input. Load-disabled
status is reflected by the output pin, DS_STS. If the block is disabled (ENABLE cleared), then the DIS_LD input is
ignored. Thus, if the block is disabled after loads have been disabled, loads remain disabled regardless of the DIS_LD
input state.
_LOAD_DIS
b

ENABLE
DS_STS

Input
ENABLE
DIS_LD
DS_STS

Boolean
Boolean
Boolean

DIS_LD

Enable the block.


Set TRUE to disable offline loads.
Load disabled status, set TRUE to indicate that offline loads are disabled.

SBLIB Block Library 63

Math Engine
_MENG_D, _MENG_F, _MENG_I, _MENG_L, Math
The Math Engine blocks solve a mathematical equation of up to 8 inputs and place the result in the output signal, whose
datatype is implied by the block suffix. The blocks accept signals of any analog datatype for the inputs. The following
operators are supported: + (add), - (subtract), * (multiply), / (divide), % (modulus), ABS() (absolute value), NEG()
(negate), R ND() (round to nearest integer), SQR() (square root), COS() (cosine), SIN() (sine), TAN() (tangent), ACS()
(arccosine), ASN() (arcsine), ATN() (arctangent). The equation must be stated in terms of the operators and the A - H
operands. The trigonometric functions expect angle operands to be expressed in radian units.
_MENG_A
b

ENABLE

matheqn EQUAT
a

Input
ENABLE
EQUAT
A
B
C
D
E
F
G
H

Boolean
Matheqn
Analog
Analog
Analog
Analog
Analog
Analog
Analog
Analog

If TRUE the block executes.


Equation string to be executed.
One of eight input variables.
One of eight input variables.
One of eight input variables.
One of eight input variables.
One of eight input variables.
One of eight input variables.
One of eight input variables.
One of eight input variables.

Output
OUT

Analog

Result of the equation.

OUT

F(n)

The equation is performed entirely on the stack of the math coprocessor and so maximum resolution is maintained. If
multiple blocks are cascaded this resolution may be compromised since an intermediate signal must be used between
blocks. To utilize the maximum resolution between cascaded blocks use the _MENG_D form when possible.

64 SBLIB Block Library

Merge
_MERGE, Sequencing
The _MERGE block is used to merge up to eight branches into a single Sequential Function Block (_SFB) step. The block
can be configured to require all branches to merge, or just one. The Branch block is used to create the branches.

_MERGE
b

TRANS

OUT

#b

MRTYPE

ACTIVE

MRTIME

ON

#b

ERRHOLD

FAULT

RESET

CTIME

RETRY

RTIME

DDIAG

STATUS

DISPGRP

GSTAT

MERGE1

STATE[4]

MERGE2

MS1

MERGE3

MS2

MERGE4

MS3

MERGE5

MS4

MERGE6

MS5

MERGE7

MS6

MERGE8

MS7

MS8

#DisplayGroup

Input
TRANS
MRTYPE
MRTIME
ERRHOLD
RESET
RETRY
DDIAG
DISPGRP
MERGE1
MERGE2
MERGE3
MERGE4
MERGE5
MERGE6
MERGE7
MERGE8

Boolean,
Constant Boolean
Long Integer,
Constant Boolean
Boolean
Boolean
Boolean
Constant DisplayGroup
Integer
Integer
Integer
Integer
Integer
Integer
Integer
Integer

transition condition for merge all.


If TRUE merge all. If FALSE selective merge.
merge time input in milli-Seconds.
If TRUE go to hold mode after an error.
If TRUE reset the merge block (from any state).
If TRUE retry after a fault.
If TRUE disable diagnostics.
Display group code for diagnostics (3 characters).
Bit encoded input for merge 1.
Bit encoded input for merge 2.
Bit encoded input for merge 3.
Bit encoded input for merge 4.
Bit encoded input for merge 5.
Bit encoded input for merge 6.
Bit encoded input for merge 7.
Bit encoded input for merge 8.

Output
OUT
ACTIVE
ON
FAULT
RTIME
STATUS

Integer
Boolean
Boolean
Boolean
Integer
Integer

Bit encoded connect to the start input of an _SFB.


If TRUE the merge is active.
If TRUE the merge is active with no faults.
If TRUE a fault has occurred.
Remaining feedback time in Seconds.
Bit-encoded status output.

SBLIB Block Library 65

State
CTIME
GSTAT
STATE[4]
MS1
MS2
MS3
MS4
MS5
MS6
MS7
MS8

Long Integer
Integer
Integer
Long Integer
Long Integer
Long Integer
Long Integer
Long Integer
Long Integer
Long Integer
Long Integer

Current merge time in milli-Seconds.


Bit encoded global input and output connection to the sequence manager block.
Internal state information.
Internal state information for merge 1.
Internal state information for merge 2.
Internal state information for merge 3.
Internal state information for merge 4.
Internal state information for merge 5.
Internal state information for merge 6.
Internal state information for merge 7.
Internal state information for merge 8.

When the _MERGE block is configured to do a selective merge (MRTYPE is FALSE), then then first branch (an _SFB
connected to a MERGEx input) to request a transition will cause the _MERGE block to start the _SFB attached to the OUT
pin. A selective merge is normally used to merge branches which are controlled by a 'selective' branch block. The TRANS
input is ignored when a selective merge is being performed.
Setting the MRTYPE to TRUE, configures the _MERGE block to merge all branches. Under this configuration, the
_MERGE block will wait until all defined branches (MERGEx inputs) have requested a transition before it will start the
_SFB attached to the OUT pin. The first branch (MERGEx input) to request a transition will start a timer in the _MERGE
block running. If all branches do not merge within the time specified by the MRTIME input, then the _MERGE block will
fault, and an diagnostic will be sent (if diagnostics are enabled). Note that if MRTIME is set to -1, then the _MERGE block
will never timeout. If any _SFB connected to a MERGEx input is placed in hold mode or Single Step mode, then the
_MERGE block will freeze it's merge timer.
If the ERRHOLD input is set to TRUE, then the _MERGE block will not process any transition requests until a reset or
retry is detected. If the ERRHOLD input is false, and a successful merge takes place even after a timeout, then the
_MERGE block will transition to the _SFB connected to its OUT pin and clear its fault condition.
The RESET input will clear all state information that the _MERGE block may have stored (which inputs have requested a
transition). The RETRY input is used to allow a sequence to pick up from where it was stopped. When the RETRY input
is used, the _MERGE block will remember who has requested and transition, and will then watch for any other transitions
that have not occurred yet. When they do occur, the _MERGE block will start the _SFB attached to its OUT pin. If the
timer times out again, the _MERGE block will again go into a fault condition.
For the merge all configuration, the TRANS input must be true before any _SFB attached to the MERGEx inputs will
attempt to transition.
The ACTIVE pin pin indicates that the _MERGE block is in the process of accepting a handoff (s)from the previous
_SFB(s) and transitioning to the next _SFB. This output will go high as soon as the _MERGE block detects a request to
transition via it's MERGEx pin and will stay high until the _SFB's tied to the OUT pin has accepted the transition. The ON
output will follow the ACTIVE output unless the _MERGE block is faulted, in which case the ON output will be false.

66 SBLIB Block Library

Minimum-Maximum Select
_MIN_MAX, Math
The minimum-maximum select block passes the minimum or maximum value from the input list to the output. If the
function is MAX then the largest input value is passed. If the function is MIN then the smallest input value is passed. The
corresponding status pin of the passed input is set TRUE while all others are set FALSE. If more than one input satisfies
the function the first one found in top/down order is passed.
_MIN_MAX

b
f
f
f
f
f

ENABLE
IN1
IN2
IN3
IN4
IN5

f
f
f

IN6
IN7
IN8

OUT
STAT1
STAT2
STAT3
STAT4
STAT5
STAT6
STAT7
STAT8

Input
ENABLE
FUNC
IN1
IN2
IN3
IN4
IN5
IN6
IN7
IN8

Boolean
MinmaxFn_T
Float
Float
Float
Float
Float
Float
Float
Float

If TRUE the block executes.


The selection function, (min or max).
One of eight inputs.
One of eight inputs.
One of eight inputs.
One of eight inputs.
One of eight inputs.
One of eight inputs.
One of eight inputs.
One of eight inputs.

Output
OUT
STAT1
STAT2
STAT3
STAT4
STAT5
STAT6
STAT7
STAT8

Float
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean

The passed value.


If TRUE, the corresponding input was passed.
If TRUE, the corresponding input was passed.
If TRUE, the corresponding input was passed.
If TRUE, the corresponding input was passed.
If TRUE, the corresponding input was passed.
If TRUE, the corresponding input was passed.
If TRUE, the corresponding input was passed.
If TRUE, the corresponding input was passed.

f
b
b
b
b
b
b
b
b

SBLIB Block Library 67

Mode Select
_MODSEL, State
The Mode Select block sets one of eight output Boolean signals and clears the rest based on a request of an input Boolean.
The output Boolean will remain set until another input Boolean is set.
_MODSEL
b

MDORQ

MODE_0

MD1RQ

MODE_1

MD2RQ

MODE_2

MD3RQ

MODE_3

MD4RQ

MODE_4

MD5RQ

MODE_5

MD6RQ

MODE_6

MD7RQ

MODE_7

MODEW2

MODEW2

Inputs
MD0RQ
MD1RQ
MD2RQ
MD3RQ
MD4RQ
MD5RQ
MD6RQ
MD7RQ

Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean

Mode 0 Request.
Mode 1 Request.
Mode 2 Request.
Mode 3 Request.
Mode 4 Request.
Mode 5 Request.
Mode 6 Request.
Mode 7 Request.

Outputs
MODE_0
MODE_1
MODE_2
MODE_3
MODE_4
MODE_5
MODE_6
MODE_7
MODEW1

Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
integer

MODEW2

integer

Mode 0 Selected
Mode 1 Selected
Mode 2 Selected
Mode 3 Selected
Mode 4 Selected
Mode 5 Selected
Mode 6 Selected
Mode 7 Selected
Mode Word one. Indicates which mode is selected. This word is formatted such that each bit
represents a mode. With the least significant bit being mode 0 and the most significant bit
being mode 7. For ex. if mode 5 was selected then the word will be set equal to 32.
Mode Word two. Indicates which mode is selected. This word is formatted such that the
magnitude of the word represents the mode number. For ex. if mode 5 was selected then
the word will be set to 5.

The Mode Select block sets one output Boolean and clears the remaining Boolean based on an input request. The output
Boolean will remain set until an input request is set. No two modes can be set at one any time.

68 SBLIB Block Library

Move_Address_x
_MOVE_ADDR_B, _MOVE_ADDR_D, _MOVE_ADDR_F, _MOVE_ADDR_I, _MOVE_ADDR_L,
Memory_Move
The move address block transfers the value at the address specified by the input pin to the output pin whenever ENABLE is
TRUE. OUTPUT may be one of the four different simple data types: double, float, long, or int. If an invalid address is
given. the ERROR pin is set TRUE.
_MOVE_ADDR

Inputs
ENABLE
INPUT
Outputs
OUTPUT

ERROR

INPUT

ENABLE

OUTPUT v

ERROR

Boolean
Long Integer

If TRUE the block executes.


address of memory that is going to be read

double
float
integer
long
Boolean

value stored in the memory address pointed to by the INPUT address

Is TRUE if the memory that is attempting to be accessed is invalid.

SBLIB Block Library 69

Move_x
_MOVE_B, _MOVE_D, _MOVE_F, _MOVE_I, _MOVE_L, Memory_Move
The Move blocks transfer the value of any signal into another signal whose datatype matches that denoted by the block
suffix. The data transfer occurs each time the block executes and the ENABLE pin is TRUE. The analog variants of the
block can be used to perform datatype conversions as well as memory move operations. The _MOVE_B variant is used to
move Booleans and does not convert the datatype.

_MOVE_x
b

ENABLE

SRC

DEST

Input
ENABLE
SRC

Boolean
Analog

If TRUE the block executes.


Source variable.

Output
DEST

Analog

Destination variable (datatype enforced by the block used).

The Move blocks are useful for taking snapshots of data that are shared between tasks in separate modules. Moving the
signals to local copies guarantees that a high priority task cannot change the shared data while the low priority task is
processing it.

70 SBLIB Block Library

Move_xT
_MOVE_IT _MOVE_LT, Memory_Move
The Move blocks transfer the value of any signal into another signal whose datatype matches that denoted by the block
suffix using truncation rather than rounding in the conversion. The data transfer occurs each time the block executes and the
ENABLE pin is TRUE. The analog variants of the block can be used to perform datatype conversions as well as memory
move operations.
_MOVE_xT
b

ENABLE

SRC

DEST

Input
ENABLE
SRC

Boolean
Analog

If TRUE the block executes.


Source variable.

Output
DEST

Analog

Destination variable (datatype enforced by the block used).

The Move blocks are useful for taking snapshots of data that are shared between tasks in separate modules. Moving the
signals to local copies guarantees that a high priority task cannot change the shared data while the low priority task is
processing it. Note that in this form of the move block, the conversion between data types uses truncation rather than
rounding to do the data type conversion

SBLIB Block Library 71

No Operation
_NOP, Test
The _NOP block performs no execution at all. It simply provides a place to specify input and output signals so that I/O
transfers are generated for them. There is no correlation between any of the pins. For instance IN1 bears no relationship to
OUT1.
_NOP

SPARE

OUT1

IN1

OUT2

IN2

OUT3

IN3

OUT4

IN4

OUT5

IN5

OUT6

IN6

OUT7

IN7

OUT8

IN8

Input
SPARE
IN1
IN2
IN3
IN4
IN5
IN6
IN7
IN8

Simple
Simple
Simple
Simple
Simple
Simple
Simple
Simple
Simple

This pin really does nothing but the tool requires at least one fixed pin in a rubber block.
First signal to read.
Second signal to read.
Third signal to read.
Fourth signal to read.
Fifth signal to read.
Sixth signal to read.
Seventh signal to read.
Eighth signal to read.

Output
OUT1
OUT2
OUT3
OUT4
OUT5
OUT6
OUT7
OUT8

Simple
Simple
Simple
Simple
Simple
Simple
Simple
Simple

First signal to write.


Second signal to write
Third signal to write
Fourth signal to write.
Fifth signal to write
Sixth signal to write
Seventh signal to write
Eighth signal to write

72 SBLIB Block Library

Output Conversion
_OUT_CVRT, I/O
Converts a long integer into coded decimal booleans. Currently BCD (Binary Coded Decimal), BINARY, and GRAY
coded booleans are decoded. Up to 32 outputs may be specified in groups of four. If the input cannot be represented by the
specified number of booleans the nearest representable encoding will be generated and the ERROR pin will be set TRUE.
_OUT_CVRT
b
OutCvrt_T
i

ENABLE

SIGN

FCN

ERR

IN

OUT11

OUT12

OUT13

OUT14

OUT21

OUT22

OUT23

OUT24

OUT31

OUT32

OUT33

OUT34

OUT41

OUT42

OUT43

OUT44

OUT51

OUT52

OUT53

OUT54

OUT61

OUT62

OUT63

OUT64

OUT71

OUT72

OUT73

OUT74

OUT81

OUT82

OUT83

OUT84

SBLIB Block Library 73

Input
ENABLE
FCN
IN

Boolean
OutCvrt_T
Long Integer

Enable block execution.


Conversion to perform.
Numerical value to be encoded.

Output
SIGN
ERR
OUT11
OUT12
OUT13
OUT14
OUT21
OUT22
OUT23
OUT24
OUT31
OUT32
OUT33
OUT34
OUT41
OUT42
OUT43
OUT44
OUT51
OUT52
OUT53
OUT54
OUT61
OUT62
OUT63
OUT64
OUT71
OUT72
OUT73
OUT74
OUT81
OUT82
OUT83
OUT84

Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean

Sign of the Coded decimal value (FALSE = positive, TRUE = negative).


TRUE if an invalid coding is detected or if unknown conversion is specified, otherwise FALSE.
First (least significant) output boolean in the first set of four booleans
Second output boolean in the first set of four booleans.
Third output boolean in the first set of four booleans.
Fourth (most significant) output boolean in the first set of four booleans.
First (least significant) output boolean in the second set of four booleans.
Second output boolean in the second set of four booleans.
Third output boolean in the second set of four booleans.
Fourth (most significant) output boolean in the second set of four booleans.
First (least significant) output boolean in the third set of four booleans.
Second output boolean in the third set of four booleans.
Third output boolean in the third set of four booleans.
Fourth (most significant) output boolean in the third set of four booleans.
First (least significant) output boolean in the fourth set of four booleans.
Second output boolean in the fourth set of four booleans.
Third output boolean in the fourth set of four booleans.
Fourth (most significant) output boolean in the fourth set of four booleans.
First (least significant) output boolean in the fifth set of four booleans.
Second output boolean in the fifth set of four booleans.
Third output boolean in the fifth set of four booleans.
Fourth (most significant) output boolean in the fifth set of four booleans.
First (least significant) output boolean in the sixth set of four booleans.
Second output boolean in the sixth set of four booleans.
Third output boolean in the sixth set of four booleans.
Fourth (most significant) output boolean in the sixth set of four booleans.
First (least significant) output boolean in the seventh set of four booleans.
Second output boolean in the seventh set of four booleans.
Third output boolean in the seventh set of four booleans.
Fourth (most significant) output boolean in the seventh set of four booleans.
First (least significant) output boolean in the eighth set of four booleans.
Second output boolean in the eighth set of four booleans.
Third output boolean in the eighth set of four booleans.
Fourth (most significant) output boolean in the eighth set of four booleans.

74 SBLIB Block Library

Output Transfer
_OUT_XFER, I/O
The Output Transfer block conditionally transfers a value to an input point owned by this InnovSCtrlr device. The data is
written to both the signal and the input point specified by the DEST pin. The transfer occurs each time the block executes
and the ENABLE pin is TRUE. This function typically only has use for points that are periodically updated by way of
messaging (e.g. SS command points). Subsequent blocks see the new value immediately.

_OUT_XFER
b

ENABLE

SRC

Input
ENABLE
SRC

Boolean
Simple

If TRUE the block executes.


Source variable.

Output
DEST

Point_S

Destination signal.

DEST

Point_S

The _OUT_XFER block was developed because the _SS_ONE_DEST block does not guarantee that a point written to our
own SS page from one task will have changed by the time a succeeding task executes. This is due to the fact that Status S
messages are queued up for transmission by a driver process so that the blockware is not held up waiting for every message
to complete.

SBLIB Block Library 75

Parity Check
PARITY_CHK, I/O
The PARITY_CHK checks for even or odd parity on input signal.

PARITY_CHK
b
l

ENABLE
INPUT

Input
ENABLE
INPUT

Boolean
integer_32

Enable block execution


Signal to check parity.

Output
ODD
EVEN

Boolean
Boolean

True if Odd Parity.


True if Even Parity.

76 SBLIB Block Library

ODD

EVEN

Permissive Dual Action Engine


_PE_DA, Sequencing
This block is normally used to start and stop some function with evaluation of permissives and diagnosis of such
permissives when required.
The _PE_DA block has three principal behaviors of primary use :
1. Generate an on message pulse (ONMSGP) in response to a positive ON_REQ1 edge if permissives are true,
and then generate an off message pulse (OFFMSGP) on the falling edge of the ON_REQ1 input.
2. Generate a permissive diagnostic message in response to a ON_REQ1 edge if permissives are false.
3. Protection. Generate OFFMSGP pulses and permissive diagnostic messages whenever a function is active
(feedback is true) while its "run" permissive is false.
This block is titled "dual action" because it always attempts to generate an on-message pulse (ONMSGP) on the leading
edge of its "on" trigger input (ON_REQ1), followed by an off-message pulse (OFFMSGP) on the trailing edge of its trigger
input (ON_REQ1). For other behaviors, see the blocks, _PE_SA and _PE_TOGGLE.
The following diagram and table briefly describe the inputs and outputs of the block. Further detail follows that.
_PE_DA
b

ENABLE

ONMSGP

^ON_REQ1

OFFMSGP

SPRM

DGNMSGP

RPRM

CTIME

FDBK

ON

FBTIME

STATUS

DISPGRP

STATE[4]

#DisplayGroup
b

DDIAG

REQDIAG

Input
ENABLE
^ON_REQ1
SPRM
RPRM
FDBK
FBTIME
DISPGRP
DDIAG
REQDIAG

Boolean
Boolean
Boolean
Boolean
Boolean
Long Integer
Constant DisplayGroup
Boolean
Boolean

Enable block execution input.


Edge sensitive input used to start and stop the pe_mda engine.
Start permissive input.
Run permissive input.
Feedback input.
Feedback input time in milli-Seconds.
Display group code for diagnostics (3 chars).
Disable diagnostic message. No diagnostic message when a fault occurs.
Request diagnostics.

Output
ONMSGP
OFFMSGP
DGNMSGP
ON

Boolean
Boolean
Boolean
Boolean

On message pulse output.


Off message pulse output.
Diagnostic message pulse output.
On output.

State
CTIME
STATUS
STATE[4]

Long Integer
Integer
Integer

Current feedback time in milli-Seconds.


Bit-encoded status output.
Internal state information.

SBLIB Block Library 77

In response to a leading edge of ON_REQ1, the engine will pulse the output, ONMSGP, for one scan of the task if the
SPRM and RPRM inputs are both true at the time the leading edge is sensed.
If either the SPRM or RPRM or both are false at the time a trigger is sensed, then no ONMSGP is generated, and instead, a
permissive diagnostic message is generated, but the DGNMSGP output is NOT pulsed.
In response to a trailing edge of ON_REQ1, the engine will pulse the output, OFFMSGP, for one scan of the task and set
the ON output to FALSE.
The input ON_REQ1 is ignored upon power up of the InnovSCtrlr, so that a stuck trigger does not cause output pulses
merely upon power up of the InnovSCtrlr. In power up cases, stuck triggers must be brought low and then high again to
generate an output pulse.
The REQDIAG input triggers an engine to test the permissives (SPRM and RPRM) and generate a diagnostic message if the
permissives are not true. A diagnostic message is not sent if the start and run permissives are TRUE.
The FDBK input is used to indicate to the _PE_DA that the actions that are supposed to happen when the _PE_DA is
triggered, actually happen. If the FDBK does not become true within the time defined by the FBTIME input, then the
_PE_DA will turn off the ON output, but it will NOT generate a diagnostic message and will NOT pulse either the
OFFMSGP or DGNMSGP.
An engine is "waiting-for-feedback" between the time it is triggered (with permissives true) and feedback (FDBK) comes
true. The feedback time, FBTIME, sets the length of time that the engine will remain in a "waiting" mode waiting for
feedback(FDBK) to go true in response to on-request trigger (ON_REQ1). If the RPRM input goes low, or there is a valid
off request (OFF_REQ), then the engine will turn off immediately and pulse the OFFMSGP output regardless of the state of
the FDBK input.
If the FBTIME is set to -1, then the _PE_DA block will consider the FBTIME to be infinite. In this case, if the FDBK
input never goes true, the engine will continue "waiting for feedback" forever. If this engine is tied to an OC2000 LED via
the STATUS output, the LED will double-strobe indicating the "waiting for feedback" mode.
CTIME is an output giving the length of time (in milliseconds) that the engine has been waiting for feedback.
If the FDBK input goes TRUE while the RPRM input is TRUE, then the _PE_DA engine will turn on, but the ONMSGP
output will not strobe. The SPRM input does not have to be TRUE for the FDBK to start the _PE_DA engine. If the
FDBK goes FALSE after the _PE_DA engine has been on for a period longer then the FBTIME, then the engine will turn
off immediately (ON output will go low). However, neither the OFFMSGP or DGNMSGP outputs will strobe under this
condition, and no diagnostic message is sent.
At any time (except when ENABLE is FALSE), if the feedback (FDBK) is true while the run permissive (RPRM) is false,
then the OFFMSGP output will pulse at 1 second intervals for 10 seconds. If the FDBK is brought false or the RPRM is
brought true before 10 seconds are up, then the OFFMSGP will stop pulsing, and the _PE_SA will reset. Each time the
OFFMSGP output strobes under this condition, a diagnostic message is generated. To reinitiate this "broken-run"
condition, the FDBK must transition false-then-true and/or the RPRM must transition true-then-false before entering the
"broken-run" condition again.

Diagnostic Message Pulse output (DGNMSGP)


The engine pulses this output for one scan of the task under certain circumstances.
Summarized below are the circumstances under which the _PE_DA block will generate diagnostic messages:
1. Broken run permissive. The RPRM input is false while the FDBK (or waiting-for-feedback) is true.
If FDBK goes low after the engine output , ON, has been true, a diagnostic message is not generated.

78 SBLIB Block Library

Disable Diagnostic Messages


If DDIAG input is TRUE, then the engine will not send any diagnostic messages. However, the DGNMSGP output will
still strobe as described in this document.
Display Group
The DISPGRP input is used to direct the diagnostic messages to particular OC2000's. The modelogger records all
diagnostic messages regardless of this input. This input is a 3-character alphanumeric code that is defined in the Toolbox
as Alarm Groups in the System Device ( *.SYB file). In the configuration of OC2000's, it is possible to define the Groups
which the OC2000 should listen for.
STATUS
The STATUS output of the _PE_DA block is a special output intended primarily for use by the OC2000 to control its LED
behavior. Generally, it is not used by the application code except in special cases.
Not only does it contain state information for use by the OC2000, but the signal name attached to the output along with its
extended description is sent to the OC2000 and HMI as part of the diagnostic message. This text essentially forms the title
or header of the diagnostic message and will help in identifying the source of the problem when a diagnostic occurs. The
STATUS signal name can be considered to be a "block name". The user can assign any r1\r2\r2\name to the signal for this
pin, but should give some indication as to what this block does. This signal name will be included in any diagnostic
message that is sent on the Drive LAN.

SBLIB Block Library 79

Permissive Engine
_PENG, Sequencing
The Permissive Engine block sets its ON output TRUE when the ONREQ input goes TRUE, as long as the start and run
permissive inputs are TRUE. It will also strobe the ONMSGP output. Once on, the run permissive input must stay TRUE,
and the feedack input must go TRUE within the configured time. Otherwise, the ON output will go FALSE and a
diagnostic will be sent. The OFFREQ input is used to turn the Permissive Engine block off.

_PENG
b

^ONREQ

ON

SPRM

ONMSGP

FDBK

OFFMSGP

FBTIME

FLTMSGP

RPRM

CTIME

OFFREQ

FAULT

OFFPRM

STATUS

DISPGRP

STATE[3]

#DisplayGroup
b

DDIAG

DFBFLT

PLUGCTL

REQDIAG

Input
^ONREQ
SPRM
FDBK
FBTIME
RPRM
OFFREQ
OFFPRM
DISPGRP
DDIAG
DFBFLT
PLUGCTL
REQDIAG

Boolean
Boolean
Boolean
Long Integer
Boolean
Boolean
Boolean
Constant DisplayGroup
Boolean
Boolean
Integer
Boolean

Edge sensitive input used to start the permissive engine.


Start permissive input.
Feedback input.
Feedback input time in milli-Seconds.
Run permissive input.
Off request input.
Off permissive input.
Display group code for diagnostics (3 chars).
Disable diagnostics input.
Disable feedback fault action input.
Bit-encoded connection to a sequential function block (_SFB).
Request diagnostics.

Output
ON
ONMSGP
OFFMSGP
FLTMSGP
FAULT

Boolean
Boolean
Boolean
Boolean
Boolean

On output.
On message pulse output.
Off message pulse output.
Fault message pulse output.
Fault status output.

State
CTIME
STATUS
STATE[3]

Long Integer
Integer
Integer

Current feedback time in milli-Seconds.


Bit-encoded status output.
Internal state information.

80 SBLIB Block Library

The _PENG block will start (ON goes high) when the ONREQ input goes from a zero to a one as long as the SPRM and
RPRM inputs are true and the OFFREQ input is false. Once started, the SPRM input can go low. When the _PENG block
is started, the ONMSGP output will also pulse (go high for one scan of the task).
The FDBK input is used to indicate to the _PENG that the actions that are supposed to happen when the _PENG turns on,
actually happen (If the _PENG raises solenoid A, then the FDBK could be a limit switch input indicating that solenoid A is
in the raised position). If the FDBK does not become true within the time defined by the FBTIME input, then the _PENG
will fault, send a diagnostic message, and turn off (and pulse the OFFMSG and FLTMSG outputs).
If the DFBFLT input (disable feedback fault) is true, then the PENG block will turn off, but no diagnostics will be sent if
the feedback is lost after the configured time. However, the OFFMSGP output will not strobe and the PENG will not go
into a fault condition. Note that the PENG block will fault if the FDBK does not become true within the configured time
period. If the FBTIME is set to -1, then the PENG block will consider the FBTIME to be infinite. In this case, the FDBK
input never has to become true.
The _PENG block is turned off by setting the OFFREQ to high. This is effective only if the OFFPRM is true. If it is not,
then a diagnostic message will be sent. When the _PENG block turns off the ON output goes low and the OFFMSGP
output will pulse. If the _PENG is already off, but the FDBK input is true, then setting the OFFREQ to a one will cause the
OFFMSGP to strobe.
The PLUGCTL input is used to allow a Sequence Function Block (_SFB) to turn the _PENG block on and off. When the
_SFB and _PENG blocks PLUGCTL pins are wired together, the _PENG is controlled by the _SFB in the following
manner:
1. When an _SFB becomes active, then the _PENG block will will turn on.
2. The _PENG will set it's ON output and will strobe it's ONMSGP output.
3. When the _SFB detects that it's donefb is true, and the _PENG's feedback is true, then the _SFB will turn off the
_PENG.
4. When the _SFB detects that the _PENG is off, The _SFB will transition to the next step.
The table below summarizes the four circumstances under which the _PENG block will fault:
1. Broken start permissive. The SPRM and/or the RPRM input was false when a ONREQ was detected.
2. Broken run permissive. The RPRM input went false after the _PENG block had been started.
3. No Feedback. The feedback input did not become true within the feedback time period.
4. Feedback lost. The feedback input went false after the _PENG block had been started. (Unless DFBDIAG is TRUE)
Broken stop permissive. The OFFPRM input was not true when a OFFREQ was made.
The STATUS output of the _PENG block is somewhat special. Not only does it contain state information for use by the
OC2000 and MMI, but the signal name attached to the output is used by the block when sending diagnostic messages. This
will help in identifying the source of the problem when a diagnostic occurs. The status signal name can be considered to be
a "block name. The user can assign any r1\r2\r2\name to the signal for this pin, but should give some indication as to what
this block does. This signal name will be included in any diagnostic message that is sent on the lan.

SBLIB Block Library 81

Permissive Single Action Engine


_PE_SA, Sequencing
A block normally used to initiate some maintained function with evaluation of permissives and diagnosis of such
permissives when required.
The _PE_SA block has three principal behaviors of primary use :
1. Generate an output pulse in response to an ON_REQ edge if permissives are true.
2. Generate a permissive diagnostic message in response to a ON_REQ edge if permissives are false.
3. Protection. Generate OFFMSGP pulses and permissive diagnostic messages whenever a function is active (feedback is
true) while its "run" permissive is false.
This block is titled "single action" because it always attempts to generate an on-message pulse (ONMSGP) on the leading
edge of either of its "on" trigger inputs (ON_REQ1 and ON_REQ2). The "on" trigger inputs can never generate the offmessage pulse, and the trailing edges of the "on" trigger inputs are ignored. For other behavior, see the blocks, _PE_DA
and _PE_TOGGLE.
The following diagram and table briefly describe the inputs and outputs of the block. Further detail follows that.

_PE_SA
b

ENABLE

ONMSGP

^ON_REQ1

OFFMSGP

^ON_REQ2

DGNMSGP

SPRM

CTIME

RPRM

ON

FDBK

STATUS

FBTIME

STATE[4]

OFF_REQ

OFFPRM

#DisplayGroup

DISPGRP

DDIAG

REQDIAG

Input
ENABLE
^ON_REQ1
^ON_REQ2
SPRM
RPRM
FDBK
FBTIME
OFF_REQ
OFFPRM
DISPGRP
DDIAG
REQDIAG

Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Long Integer
Boolean
Boolean
Constant DisplayGroup
Boolean
Boolean

Enable block execution input.


Edge sensitive input used to start the pe_msa engine.
Edge sensitive input used to start the pe_msa engine.
Start permissive input.
Run permissive input.
Feedback input.
Feedback input time in milli-Seconds.
Off request input.
Off request permissive input.
Display group code for diagnostics (3 chars).
Disable diagnostic message. No diagnostic message when a fault occurs.
Request diagnostics.

Output
ONMSGP
OFFMSGP
DGNMSGP
ON

Boolean
Boolean
Boolean
Boolean

On message pulse output.


Off message pulse output.
Diagnostic message pulse output.
On output.

82 SBLIB Block Library

State
CTIME
STATUS
STATE[4]

Long Integer
Integer
Integer

Current feedback time in milli-Seconds.


Bit-encoded status output.
Internal state information.

In response to a leading edge of either ON_REQ1 or ON_REQ2, the engine will pulse the output, ONMSGP, for one scan
of the task if the SPRM and RPRM inputs are both true at the time the leading edge is sensed.
If either the SPRM or RPRM or both are false at the time a trigger is sensed, then no ONMSGP is generated, and instead, a
permissive diagnostic message is generated, but the DGNMSGP output is NOT pulsed.
The inputs, ON_REQ1 and ON_REQ2, are ignored upon power up of the InnovSCtrlr, so that stuck triggers do not cause
output pulses merely upon power up of the InnovSCtrlr. In power up cases, stuck triggers must be brought low and then
high again to generate an output pulse.
The REQDIAG input triggers an engine to test the permissives (SPRM and RPRM) and generate a diagnostic message if the
permissives are not true. A diagnostic message is not sent if the start and run permissives are TRUE. This input cannot be
used to test the status of the OFFPRM.
The FDBK input is used to indicate to the _PE_SA that the actions that are supposed to happen when the _PE_SA is
triggered, actually happen. If the FDBK does not become true within the time defined by the FBTIME input, then the
_PE_SA will turn off the ON output, but it will NOT generate a diagnostic message and will NOT pulse either the
OFFMSGP or DGNMSGP.
An engine is "waiting-for-feedback" between the time it is triggered (with permissives true) and feedback (FDBK) comes
true. The feedback time, FBTIME, sets the length of time that the engine will remain in a "waiting" mode waiting for
feedback(FDBK) to go true in response to on-request triggers (ON_REQ1 and ON_REQ2). If the RPRM input goes low,
or there is a valid off request (OFF_REQ), then the engine will turn off immediately and pulse the OFFMSGP output
regardless of the state of the FDBK input.
If the FBTIME is set to -1, then the _PE_SA block will consider the FBTIME to be infinite. In this case, if the FDBK
input never goes true, the engine will continue "waiting for feedback" forever. If this engine is tied to an OC2000 LED via
the STATUS output, the LED will double-strobe indicating the "waiting for feedback" mode.
CTIME is an output giving the length of time (in milliseconds) that the engine has been waiting for feedback.
If the FDBK input goes TRUE while the RPRM input is TRUE, then the _PE_SA engine will turn on, but the ONMSGP
output will not strobe. The SPRM input does not have to be TRUE for the FDBK to start the _PE_SA engine. If the FDBK
goes FALSE after the _PE_SA engine has been on for a period longer then the FBTIME, then the engine will turn off
immediately (ON output will go low). However, neither the OFFMSGP or DGNMSGP outputs will strobe under this
condition, and no diagnostic message is sent.
At any time (except when ENABLE is FALSE), if the feedback (FDBK) is true while the run permissive (RPRM) is false,
then the OFFMSGP output will pulse at 1 second intervals for 10 seconds. If the FDBK is brought false or the RPRM is
brought true before 10 seconds are up, then the OFFMSGP will stop pulsing, and the _PE_SA will reset. Each time the
OFFMSGP output strobes under this condition, a diagnostic message is generated. To reinitiate this "broken-run"
condition, the FDBK must transition false-then-true and/or the RPRM must transition true-then-false before entering the
"broken-run" condition again.
Off Request
When a leading edge of the OFF_REQ input is detected, the engine will generate an output pulse, OFFMSGP, for one scan
of the task if the OFFPRM is true and the ON output is TRUE (FDBK is TRUE or waiting for FDBK). If the OFFPRM is
false, then a diagnostic message is generated, and the DGNMSGP output is strobed.
The input, OFF_REQ is ignored upon power up of the InnovSCtrlr, so that a stuck trigger does not cause an output pulse
merely upon power up of the InnovSCtrlr. In power up cases, a stuck trigger must be brought low and then high again to
generate an output pulse.

SBLIB Block Library 83

Diagnostic Message Pulse output (DGNMSGP)


The engine pulses this output for one scan of the task under certain circumstances.
Summarized below are the circumstances under which the _PE_SA block will generate diagnostic messages:
1. Broken run permissive. The RPRM input is false while the FDBK (or waiting-for-feedback) is true.
2. Broken off permissive. The OFFPERM input is false and the FDBK (or waiting-for-feedback) is true when the
OFFREQ is edge-detected.
If FDBK goes low after the engine output , ON, has been true, a diagnostic message is not generated.
Disable Diagnostic Messages
If DDIAG input is TRUE, then the engine will not send any diagnostic messages. However, the DGNMSGP output will
still strobe as described in this document.
Display Group
The DISPGRP input is used to direct the diagnostic messages to particular OC2000's. The modelogger records all
diagnostic messages regardless of this input. This input is a 3-character alphanumeric code that is defined in the Toolbox
as Alarm Groups in the System Device ( *.SYB file). In the configuration of OC2000's, it is possible to define the Groups
which the OC2000 should listen for.
STATUS
The STATUS output of the _PE_SA block is a special output intended primarily for use by the OC2000 to control its LED
behavior. Generally, it is not used by the application code except in special cases.
Not only does it contain state information for use by the OC2000, but the signal name attached to the output along with its
extended description is sent to the OC2000 and HMI as part of the diagnostic message. This text essentially forms the title
or header of the diagnostic message and will help in identifying the source of the problem when a diagnostic occurs. The
STATUS signal name can be considered to be a "block name". The user can assign any r1\r2\r2\name to the signal for this
pin, but should give some indication as to what this block does. This signal name will be included in any diagnostic
message that is sent on the Drive LAN.

84 SBLIB Block Library

Permissive Toggle Action Engine


_PE_TOGGLE, Sequencing
This block is normally used to initiate and end (in a toggle fashion) some maintained function with evaluation of
permissives and diagnosis of such permissives when required.
The _PE_TOGGLE block has three principal behaviors of primary use :
1. Generate an on message output pulse (ONMSGP) in response to an ON_REQ or the first TOG_REQ edge if permissives
are true, or generate an off message pulse (OFFMSGP) if already on and sense on edge for the TOG_REQ input.
2. Generate a permissive diagnostic message in response to a ON_REQ or TOG_REQ edge if permissives are false.
3. Protection. Generate OFFMSGP pulses and permissive diagnostic messages whenever a function is active (feedback is
true) while its "run" permissive is false.
This block is titled "toggle action" because the block will generate an on message pulse (ONMSGP) on the leading edge of
the toggle input (TOG_REQ) when the engine is off, or an off message pulse (ONMSGP) on the leading edge of the toggle
input (TOG_REQ) when the engine is on. It is intended to be used to control maintained functions in a toggle fashion
whereby the same trigger (TOGGLE) turns a particular function on and off. For other behavior, see the blocks, _PE_DA
and _PE_SA.
The following diagram and table briefly describe the inputs and outputs of the block. Further detail follows that.

_PE_TOGGLE
b

ENABLE

ONMSGP

^ON_REQ

OFFMSGP

^TOG_REQ

DGNMSGP

SPRM

CTIME

RPRM

ON

FDBK

STATUS

STATE[4]

FBTIME

OFF_REQ

OFFPRM

#DisplayGroup

Input
ENABLE
^ON_REQ
^TOG_REQ
SPRM
RPRM
FDBK
FBTIME
OFFREQ
OFFPRM
DISPGRP
DDIAG
REQDIAG

Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Long Integer
Boolean
Boolean
Constant DisplayGroup
Boolean
Boolean

DISPGRP
b

DDIAG

REQDIAG

Enable block execution input.


Edge sensitive input used to start the PE_TOGGLE.
Edge sensitive input to turn engine on or off.
Start permissive input.
Run permissive input.
Feedback input.
Feedback input time in milli-Seconds.
Off request input.
Off request permissive input.
Display group code for diagnostics (3 chars).
Disable diagnostic message. No diagnostic message when a fault occurs.
Request diagnostics

SBLIB Block Library 85

Output
ONMSGP
OFFMSGP
FLTMSGP
ON

Boolean
Boolean
Boolean
Boolean

On message pulse output.


Off message pulse output.
Fault message pulse output.
On output.

State
CTIME
STATUS
STATE[4]

Long Integer
Integer
Integer

Current feedback time in milli-Seconds.


Bit-encoded status output.
Internal state information.

In response to a leading edge of either ON_REQ or TOG_REQ, the engine will pulse the output, ONMSGP, for one scan of
the task if the SPRM and RPRM inputs are both true at the time the leading edge is sensed and if the _PE_TOGGLE engine
is not already on. If the engine is on, then a leading edge of the TOG_REQ input will cause the OFFMSGP output to strobe
and turn the engine off.
If either the SPRM or RPRM or both are false at the time a trigger is sensed, then no ONMSGP is generated, and instead, a
permissive diagnostic message is generated, but the DGNMSGP output is NOT pulsed.
The inputs, ON_REQ and TOG_REQ, are ignored upon power up of the InnovSCtrlr, so that stuck triggers do not cause
output pulses merely upon power up of the InnovSCtrlr. In power up cases, stuck triggers must be brought low and then
high again to generate an output pulse.
The REQDIAG input triggers an engine to test the permissives (SPRM and RPRM) and generate a diagnostic message if the
permissives are not true. A diagnostic message is not sent if the start and run permissives are TRUE. This input cannot be
used to test the status of the OFFPRM.
The FDBK input is used to indicate to the _PE_TOGGLE that the actions that are supposed to happen when the
_PE_TOGGLE is triggered, actually happen. If the FDBK does not become true within the time defined by the FBTIME
input, then the _PE_TOGGLE will turn off the ON output, but it will NOT generate a diagnostic message and will NOT
pulse either the OFFMSGP or DGNMSGP.
An engine is "waiting-for-feedback" between the time it is triggered (with permissives true) and feedback (FDBK) comes
true. The feedback time, FBTIME, sets the length of time that the engine will remain in a "waiting" mode waiting for
feedback(FDBK) to go true in response to on-request triggers (ON_REQ and TOG_REQ). If the RPRM input goes low, or
there is a valid off request (OFF_REQ), then the engine will turn off immediately and pulse the OFFMSGP output
regardless of the state of the FDBK input.
If the FBTIME is set to -1, then the _PE_TOGGLE block will consider the FBTIME to be infinite. In this case, if the
FDBK input never goes true, the engine will continue "waiting for feedback" forever. If this engine is tied to an OC2000
LED via the STATUS output, the LED will double-strobe indicating the "waiting for feedback" mode.
CTIME is an output giving the length of time (in milliseconds) that the engine has been waiting for feedback.
If the FDBK input goes TRUE while the RPRM input is TRUE, then the _PE_TOGGLE engine will turn on, but the
ONMSGP output will not strobe. The SPRM input does not have to be TRUE for the FDBK to start the _PE_TOGGLE
engine. If the FDBK goes FALSE after the _PE_TOGGLE engine has been on for a period longer then the FBTIME, then
the engine will turn off immediately (ON output will go low). However, neither the OFFMSGP or DGNMSGP outputs will
strobe under this condition, and no diagnostic message is sent.
At any time (except when ENABLE is FALSE), if the feedback (FDBK) is true while the run permissive (RPRM) is false,
then the OFFMSGP output will pulse at 1 second intervals for 10 seconds. If the FDBK is brought false or the RPRM is
brought true before 10 seconds are up, then the OFFMSGP will stop pulsing, and the _PE_TOGGLE will reset. Each time
the OFFMSGP output strobes under this condition, a diagnostic message is generated. To reinitiate this "broken-run"
condition, the FDBK must transition false-then-true and/or the RPRM must transition true-then-false before entering the
"broken-run" condition again.

86 SBLIB Block Library

Off Request

When a leading edge of the OFF_REQ input is detected (or a leading edge of the TOG_REQ input), the engine will
generate an output pulse, OFFMSGP, for one scan of the task if the OFFPRM is true and the ON output is TRUE (FDBK is
TRUE or waiting for FDBK). If the OFFPRM is false, then a diagnostic message is generated, and the DGNMSGP output
is strobed.
The input, OFF_REQ or TOG_REQ is ignored upon power up of the InnovSCtrlr, so that a stuck trigger does not cause an
output pulse merely upon power up of the InnovSCtrlr. In power up cases, a stuck trigger must be brought low and then
high again to generate an output pulse.
Diagnostic Message Pulse output (DGNMSGP)

The engine pulses this output for one scan of the task under certain circumstances.
Summarized below are the circumstances under which the _PE_TOGGLE block will generate diagnostic messages:
1. Broken run permissive. The RPRM input is false while the FDBK (or waiting-for-feedback) is true.
2. Broken off permissive. The OFFPERM input is false and the FDBK (or waiting-for-feedback) is true when the
OFF_REQ or TOG_REQ is edge-detected.
If FDBK goes low after the engine output , ON, has been true, a diagnostic message is not generated.
Disable Diagnostic Messages

If DDIAG input is TRUE, then the engine will not send any diagnostic messages. However, the DGNMSGP output will
still strobe as described in this document.
Display Group

The DISPGRP input is used to direct the diagnostic messages to particular OC2000's. The modelogger records all
diagnostic messages regardless of this input. This input is a 3-character alphanumeric code that is defined in the Toolbox
as Alarm Groups in the System Device ( *.SYB file). In the configuration of OC2000's, it is possible to define the Groups
which the OC2000 should listen for.
STATUS

The STATUS output of the _PE_TOGGLE block is a special output intended primarily for use by the OC2000 to control its
LED behavior. Generally, it is not used by the application code except in special cases.
Not only does it contain state information for use by the OC2000, but the signal name attached to the output along with its
extended description is sent to the OC2000 and HMI as part of the diagnostic message. This text essentially forms the title
or header of the diagnostic message and will help in identifying the source of the problem when a diagnostic occurs. The
STATUS signal name can be considered to be a "block name". The user can assign any r1\r2\r2\name to the signal for this
pin, but should give some indication as to what this block does. This signal name will be included in any diagnostic
message that is sent on the Drive LAN.

SBLIB Block Library 87

Preset SIOB Counter


_PRESET_CNTR, I/O
The Preset Counter block provides a mechanism to preset a given SIOB (I/O pwb) counter input to a specified value.
Subsequent counts accrued on the counter are then applied to the preset value, which acts as a count starting point.

_PRESET_CNTR
l

CNT_IN

CNT_OUT

PRESET

STATE

PRE_EN

Input
CNT_IN
PRESET
PRE_EN
CNT_OUT

Long Integer
Long Integer
Boolean
Long Integer

Signal attached to an SIOB counter input point.


Preset value in counts.
Level activated signal enabling a preset operation.
Preset output counts (raw input counts "normalized" by the PRESET pin's value).

Output
STATE

Long Integer

State value used to maintain a delta counts used to convert the raw inputs count value to the
normalized CNT_OUT value.

The _PRESET_CNTR block does not preset SIOB counters themselves, which are maintained independently. The
CNT_OUT pin value is a representation of a specified raw input counts value normalized by the given preset value. It
remains equal to the PRESET value as long as the PRE_EN pin is held TRUE. Afterwards, it counts up or down
incrementally as counts are accrued. Rollovers in the SIOB raw count values are taken into account and do not adversely
affect the CNT_OUT value. (However, it eventually can roll over if enough counts are accrued either counting up or
down.)

88 SBLIB Block Library

Proportional-Integral Regulator
PI, Regulators
The PI block computes the integral of the input error and sums the integrator output with the error signal multiplied by the
proportional gain.

PI

ENABLE
REF

FDBK

KPROP

f
f

KINT

PIOUT

INHILMT

INLOLMT

INITIAL
HILIMIT

LOLIMIT

PRESET

Input
ENABLE
REF
FDBK
KPROP
KINT
INITIAL
HILIMIT
LOLIMIT
PRESET

Boolean
float
float
float
float
float
float
float
Boolean

Enable block execution


Reference value.
Feedback value.
Proportional gain.
Integral gain.
Initial preset value.
Upper clamp value.
Lower clamp value.
Preset command.

Output
PIOUT
INHILMT
INLOLIMT

float
Boolean
Boolean

Output value.
In hi limit output status.
In low limit output status.

The PI regulator block computes the integral of the input error and sums the integrator with the error signal multiplied by
the proportional gain. The input error signal is derived by subtracting the FDBK input from the REF input. The proportional
path has the effect of a lead term. For example, the integral gain is KINT, the proportional gain, KPROP is equal to ( KINT
* Lead Time Constant in seconds). The integrator output can be preset to an initial value with the PRESET Boolean and
INITIAL value. The internal state of the integrator is clamped between the high and low limit clamps, HILIMIT and
LOLIMIT.
The output of the block is PIOUT. There are two status output Boolean that tell whether the integrator is clamped,
INHILMT and INLOLMT.
To implement a Lead, once the KINT gain is determined, make KPROP = KINT * Lead Time Constant in seconds.
To implement a straight integrator, make KPROP and FDBK = 0.0

SBLIB Block Library 89

Proportional-Integral Regulator with Suicide


PISUC, Regulators
The PI block computes the integral of the input error and sums the integrator output with the error signal multiplied by the
proportional gain.

b
f

PISUC
ENABLE
REF

FDBK

KPROP

f
f

KINT

INITIAL
HILIMIT

LOLIMIT

PRESET

SUICIDE

Input
ENABLE
REF
FDBK
KPROP
KINT
INITIAL
HILIMIT
LOLIMIT
PRESET
SUICIDE

Boolean
float
float
float
float
float
float
float
Boolean
Boolean

Enable block execution


Reference value.
Feedback value.
Proportional gain.
Integral gain.
Initial preset value.
Upper clamp value.
Lower clamp value.
Preset command.
Suicide command.

Output
PIOUT
INHILMT
INLOLIMT

float
Boolean
Boolean

Output value.
Hi limit output status.
Low limit output status.

PIOUT

INHILMT

INLOLMT

The PI regulator block computes the integral of the input error and sums the integrator with the error signal multiplied by
the proportional gain. The input error signal is derived by subtracting the FDBK input from the REF input. The proportional
path has the effect of a lead term. For example, the integral gain is KINT, the proportional gain, KPROP is equal to ( KINT
* Lead Time Constant in seconds). The integrator output can be preset to an initial value with the PRESET Boolean and
INITIAL value. The internal state of the integrator is clamped between the high and low limit clamps, HILIMIT and
LOLIMIT.
The output of the block is PIOUT. There are two status output Boolean signals that tell whether the integrator is clamped,
INHILMT and INLOLMT.
The integrator output and state are commanded to zero with the SUICIDE command.
To implement a Lead, once the KINT gain is determined, make KPROP = KINT * Lead Time Constant in seconds.
To implement a straight integrator, make KPROP and FDBK = 0.0

90 SBLIB Block Library

Proportional Integral Derivative Control


_PID, Regulators
The _PID block performs proportional, integral and derivative control on the setpoint, measured value feedback, and a
derivative source. It provides a smooth transition between operating modes using an internal lockon sequence.
_PID

f
b
f
f
f

SETPT

MAX

KP
KP

D_ACT

+
-

KI

OUT

LALM

KP

MIN

HALM

D_SRC
KP*KD*d(DSRC)

KD

dt

OFFSET

LOCKON[32]

i
i

CTL_VAR

f
f

ERROR

MODE
MODE = 0 31

MAXOUT

MINOUT

Lockon
Mode Change

Control

+
F
D

Detection
MSTATE
STATE[4]

Input
CTL_VAR
SETPT
KP
D_ACT
KI
DSRC
KD
OFFSET
LOCKON[ ]
MODE
MAXOUT
MINOUT

Float
Float
Float
Boolean
Float
Float
Float
Float
Integer
Integer
Float
Float

Controlled variable (primary feedback).


Setpoint (primary reference).
Proportional gain.
Direct acting switch. If FALSE then KP' = -KP, else KP' = KP.
Integral gain.
Derivative source.
Derivative gain.
Offset modifier.
Lockon control array (maximum of 32 elements).
Operating mode, used as an index into the LOCKON[ ] array.
Maximum output clamp limit.
Minimum output clamp limit.

Output
ERROR
OUT
LALM
HALM

Float
Float
Boolean
Boolean

Error. If mode = PASSTHRU then ERROR = 0, else ERROR = CTL_VAR - SETP.


PID Output Correction.
Set to TRUE if OUT is less than or equal to MINOUT, else set to FALSE
Set to TRUE if OUT is greater than or equal to MAXOUT, else set to FALSE.

i
d

SBLIB Block Library 91

State
MSTATE
STATE[5]

Integer
Long Float

Previous state of MODE.


Five internal state variables defined as the following:
STATE[0] -> KI * PROPORTIONAL ERROR COMPONENT(t-1)
STATE[1] -> INTEGRATOR STATE(t-1)
STATE[2] -> DSRC(t-1)
STATE[3] -> DSRC(t-2)
STATE[4] -> OUT(t-1)

The lockon control operates as follows:


The LOCKON[ ] array may contain up to 32 elements, each of which must be initialized with one of the following three
modes indicating a lockon function:
LOCKON = 0
NO_LOCKON = 1
PASSTHRU = 2
*** Caution: If the integral gain is set to zero (0), do not attempt to use LOCKON mode (0). ***
The MODE pin selects a process mode (external to the _PID block) that requires the block to perform one of the three
types of lockon functions. Using the MODE as the index into LOCKON[ ] array accomplishes the binding. When the
block detects a mode change it performs the corresponding lockon function during that sweep.
Clamp MODE to within the size of the LOCKON array
If LOCKON[MODE] = NO_LOCKON, or
If LOCKON[MODE] is undefined then
Calculate PID correction
Route correction signal to OUT (F = 0)
Ignore any mode changes
If LOCKON[MODE] = LOCKON then
If mode changes then
Set all derivative states equal to DSRC
Set integral state with OUT(t-1) - (A + B + OFFSET)
Update state variable for (KI * (CTL_VAR -SETPT))
Calculate PID correction
Route correction signal to OUT (F = 0)
IF LOCKON[MODE] = PASSTHRU then
Set all integral and derivative states to zero
Route SETP to OUT (F = 1)
Ignore any mode changes
ERROR = 0
The integration is calculated using a bilinear transformation for the trapezoidal rule:
1/s = (T/2)*(Z+1)/(Z-1)
y(t) = (T/2)*[x(t) + x(t-1)] + y(t-1)
If OUT is in one of the clamps the integrator state is not allowed to wind up.
The derivative is calculated using the three-point formula:
s = (3Z^^2 - 4Z + 1) / (Z^^2 * 2T)
y'(t) = [3y(t) - 4y(t-1) + y(t-2)] / 2T

92 SBLIB Block Library

Pulse
_PULSE, Sequencing
The Pulse block generates a boolean one-shot of the specified width at the output pin on the rising edge of the trigger. Once
the pulse has been initiated it persists until it times out regardless of the value of the trigger. The previous state of the
trigger is stored with each execution sweep so the falling edge of the next trigger may be seen prior to the end of the pulse.
A specified pulse width of 0 will result in a one sweep pulse.

_PULSE
b

^TRIG

OUT

WIDTH

CWIDTH

STATIC[2]

Input
^TRIG
WIDTH
CWIDTH

Boolean
Long Integer
Long Integer

Triggers a new pulse on its rising edge.


Period of the pulse in milli-Seconds.
Elapsed time since the pulse began in milli-Seconds.

Output
OUT
STATIC[2]

Boolean
Long Integer

Pulse output.
Internal state information. Do not attach to any other block.

SBLIB Block Library 93

Pulse_s
_PULSE_S, Sequencing
The Pulse_s block generates a boolean one-shot of the specified width at the output pin on the rising edge of the trigger.
Once the pulse has been initiated it persists until it times out regardless of the value of the trigger. The previous state of the
trigger is stored with each execution sweep so the falling edge of the next trigger may be seen prior to the end of the pulse.
A specified pulse width of 0 will result in a one sweep pulse. This block differs from the PULSE block in that the Width
parameters is limited to 32,767 milliseconds.
_PULSE_S
b

^TRIG

OUT

WIDTH

CWIDTH

STATIC[3]

Input
^TRIG
WIDTH
CWIDTH

Boolean
Short Integer
Short Integer

Triggers a new pulse on its rising edge.


Period of the pulse in milli-Seconds.
Elapsed time since the pulse began in milli-Seconds.

Output
OUT
STATIC[3]

Boolean
Short Integer

Pulse output.
Internal state information. Do not attach to any other block.

94 SBLIB Block Library

Put Into Array


_PUT_B, _PUT_D, _PUT_F, _PUT_I, _PUT_L, Memory_Move
The Put Into Array blocks move a value from a signal into an array element of the same datatype. A block exists for each
of the analog datatypes and is identified by its suffix. The data transfer occurs each time the block executes and the
ENABLE pin is TRUE. The array index N is interpreted as an unsigned long integer. If N is out of range the block
transfers into the last element of the array.
_PUT_a
b

ENABLE

SRC

DEST[ ]

Input
ENABLE
SRC
N

Boolean
Analog
Long Integer

If TRUE the block executes.


Source variable.
Source array index (0 based, interpreted internally as unsigned).

Output
DEST[]

Analog

Destination array.

SBLIB Block Library 95

Ramp
_RAMP, Regulators
The RAMP Block takes a current_ramp and increments and decrements the value until the final value is reached. The
current value is modified each time by the value specified in the accel_rate or decel_rate.

_RAMP

ENABLE

FINAL

ACCEL

DECEL

f
b

PRESET

QUIKPASS

ATFINAL
CURRAMP

f
b

PR_VAL

Input
ENABLE
FINAL
ACCEL
DECEL
PR_VAL
PRESET
QUIKPASS

Boolean
Float
Float
Float
Float
Boolean
Boolean

Enable block execution


Ramp Final(target) Value
Ramp acceleration rate in units /sec
Ramp deceleration rate in units / sec
Preset Value of Ramp output
Preset Ramp command
Bypass Ramp command

Output
ATFINAL
CURRAMP

Boolean
Float

Ramp status, TRUE when CUR_RAMP=FINAL


Ramp current output

The accel_rate and decel_rate must both be positive. The current_ramp value is compared against the final value and the
accel_rate value will be added or the decel_rate value will be subtracted to/from current_ramp value depending on the
results of the compare. Once the final value is reached, the at_final is set and current_ramp is clamped to final value.
Current_ramp is set to pr_val when the PRESET Boolean is set and the at_final Boolean is set. Current_ramp is set to final
value when the QUIKPASS Boolean is set and at_final Boolean is set. The accel_rate and decel_rate are in units per
second. For example, if the output is desired to ramp to 500 in 25 seconds, set accel_rate at (500/25) = 20.

96 SBLIB Block Library

Ramp with Hold


_RAMPH, Regulators
The _RAMPH Block increments or decrements a current ramp value (CURRAMP) until the final value (FINAL) is reached.
The current ramp value is modified each sweep by the ascending rate (ACCRATE) or descending rate (DECRATE).

_RAMPH
b

ENABLE

FINAL

ACCRATE

DECRATE

f
b

PRESET

PASS

HOLD

CURRAMP

ATFINAL

PR_VAL

Input
ENABLE
FINAL
ACCRATE
DECRATE
PR_VAL
PRESET
PASS
HOLD

Boolean
Float
Float
Float
Float
Boolean
Boolean
Boolean

Enable block execution.


Ramp final (target) Value.
Ramp ascending rate in units /sec.
Ramp descending rate in units / sec.
Preset value of ramp output.
Preset ramp command.
Bypass ramp command.
Hold ramp output command.

Output
CURRAMP
ATFINAL

Float
Boolean

Ramp current output.


Ramp status, TRUE when CURRAMP=FINAL.

The ascending rate and the descending rate must both be positive. The current ramp value is compared against the final
value and the ascending rate value is added to, or the descending rate value is subtracted from the current ramp value,
depending on the results of the comparison. Once the final value is reached, the ramp status (ATFINAL) is set to TRUE and
the current ramp is clamped to the final value. The current ramp value is set to the preset value (PR_VAL) and the ramp
status is set to TRUE when the preset ramp command (PRESET) is TRUE.
The current ramp is held at its current value when the hold ramp command (HOLD) is TRUE.
The current ramp is set to the final value and the ramp status is set TRUE when the bypass command (PASS) is TRUE. The
ascending rate and the descending rate are in units per second. For example, if the output is desired to ramp up to 500 in 25
seconds, set the ascending rate to 20 (500/25).

SBLIB Block Library 97

S-Curve Ramp
_SRAMP, Regulators
The SRAMP block modifies the SPEED Output to the FINAL value following a S-Curve.
SRAMP
b

ENABLE

HOLD

SET_PNT

SPEED

CURRATE

MAX_ACC

ACCEL

MAX_DEC

DECEL

ACC_RIN

AT_FINAL

ACC_ROT

DEC_RIN

DEC_ROT

PASS

Input
ENABLE
HOLD
SET_PNT
MAX_ACC
MAX_DEC
ACC_RIN
ACC_ROT
DEC_RIN
DEC_ROT
PASS

Boolean
Boolean
Float
Float
Float
Float
Float
Float
Float
Boolean

Enable block execution


HOLD speed command
Sample target value
Maximum acceleration value in units/sec
Maximum deceleration value in units/sec
Acceleration round in time in seconds
Acceleration round out time in seconds
Deceleration round in time in seconds
Deceleration round out time in seconds
Bypass Ramp command

Output
SPEED
CURRATE
ACCEL
DECEL
AT_FINAL

Float
Float
Boolean
Boolean
Boolean

SRAMP output
Current ramp accel/decel rate in units/sec
In acceleration status
In deceleration status
Ramp output reached target status

This block modifies the speed parameter to a final value following an S curve. The speed modification is done in 3 parts.
The first part of the curve increases the rate of acceleration at a steady rate until the maximum acceleration rate is reached,
max_acc, or until the point when the third part must take over for a smooth transition to the set_point. The second part of
the curve accelerates the speed at the MAX_ACC rate. The second part of the curve may not be required. The third part of
the ramp decrease the rate of acceleration at a steady rate until the set_point speed is reached.
The time for the first and third part of the curve is given by the parameters ACC_RIN and ACC_ROT. The time specified
is in seconds.
Similar parameters are specified for the deceleration of speed. Different parameters may be specified for deceleration mode.
The corresponding time parameters for the first and third parts of the deceleration curve are DEC_RIN and DEC_ROT.
The speed and set_point values are specified in terms of PU. MAX_ACC and MAX_DEC are all specified in terms of PU/
Sec . The MAX_DEC is also a positive number. The routine converts it to a negative value internally.

98 SBLIB Block Library

Select
_SELECT_B, _SELECT_D, _SELECT_F, _SELECT_I, _SELECT_L, Memory_Move
The Select blocks move one of the eight inputs, or the cascade pin into the output, based on the prioritized evaluation of the
eight selection pins. Working in ascending order from SEL1 the first TRUE value encountered causes the corresponding
input to be gated. If none of the selection pins is TRUE then the cascade pin is gated. In this manner multiple Select blocks
may be chained to create large selection groups.

_SELECT_V

Input
ENABLE
CASC
IN1
SEL1
IN2
SEL2
IN3
SEL3
IN4
SEL4
IN5
SEL5
IN6
SEL6
IN7
SEL7
IN8
SEL8

Boolean
Simple
Simple
Boolean
Simple
Boolean
Simple
Boolean
Simple
Boolean
Simple
Boolean
Simple
Boolean
Simple
Boolean
Simple
Boolean

ENABLE

CASC

IN1

SEL1

IN2

SEL2

IN3

SEL3

IN4

SEL4

IN5

SEL5

IN6

SEL6

IN7

SEL7

IN8

SEL8

OUT

Allows the block to execute.


Default (cascade) selection.
First input variable.
First selection input.
Second input variable.
Second selection input.
Third input variable.
Third selection input.
Fourth input variable.
Fourth selection input.
Fifth input variable.
Fifth selection input.
Sixth input variable.
Sixth selection input.
Seventh input variable.
Seventh selection input.
Eighth input variable.
Eighth selection input.

SBLIB Block Library 99

Sequence Function Block


_SFB, Sequencing
The Sequence Function block creates a step in an automatic sequence. A sequence consists of a number of _SFB blocks
wired together with _BRANCH and _MERGE blocks. The active or on outputs are used to indicate that a step is active.
The plug control output provides a simple interface to the _PENG block for step control
_SFB
i

START

PLUGCTL

STRT1ST

ACTIVE

DONEFB

ON

FBTIME

NEXT

FORCEFB

FAULT

HOLD

CTIME

SSMODE

RTIME

^SSTRIG

STATUS

DISPGRP

GSTAT

RESET

STATE[4]

RETRY

#DisplayGroup

#b

ERRHOLD

#b

PASSTHR

DDIAG

Input
START
STR1ST
DONEFB
FBTIME
FORCEFB
HOLD
SSMODE
^SSTRIG
DISPGRP
RESET
RETRY
ERRHOLD
PASSTHR
DDIAG

Integer
Boolean
Boolean
Long Integer
Boolean
Boolean
Boolean
Boolean
Constant DisplayGroup
Boolean
Boolean
Constant Boolean
Constant Boolean
Boolean

Starts the _SFB. Connect from NEXT output of another step. Bit-encoded.
Starts the step if this is the first step.
Done feedback input. Causes a transition to the next step.
Feedback input time in milli-Seconds.
Forces the done feedback to TRUE.
Places _SFB into hold mode.
Single step mode (semi automatic mode).
Edge sensitive single step trigger.
Display group code for diagnostics (3 chars).
Resets the _SFB from any state.
Retry after a fault.
Go to hold mode after an error.
When started just go to the next step if the done feedback is TRUE.
Disable diagnostics input.

Output
PLUGCTL
ACTIVE
ON
NEXT
FAULT
RTIME

Integer
Boolean
Boolean
Integer
Boolean
Integer

Bit-encoded connection to a _PENG.


Indicates the _SFB is active.
Indicates the _SFB is active and on with no faults.
Pin to connect to next _SFB, _BRANCH, or _MERGE block. Bit-encoded.
Fault status output.
Remaining feedback time in Seconds.

State
CTIME
STATUS
GSTAT
STATE[4]

Long Integer
Integer
Integer
Integer

Current feedback time in milli-Seconds.


Bit-encoded status output.
Global input and output connection to the sequence manager block. Bit-encoded.
Internal state information.

100 SBLIB Block Library

Each Sequence Function Block represents a step in a sequence. The _SFB's are tied together to form a sequence by wiring
the NEXT output pin of the present block to the START input pin of the next block, and so on for however many steps are
required. The DONEFB input is used to tell the _SFB to transition to the next step. The ACTIVE output of the _SFB
indicates when the step is active while the ON output indicates active with no faults. The ACTIVE or ON outputs are used
to trigger the actions that are required to happen for a particular step (or a _PENG can be connected directly to the _SFB
via the PLUGCTL pin).
The first step of a sequence is started by using the STR1ST boolean input, since the bit-encoded START & NEXT pins can
only be used to connect _SFB's together.
Diagnostic messages are broadcast in the case of an error in the _SFB, or in transitioning from one step to the next. Each
block can be configured (via the ERRHOLD input) to either hold or continue when an error occurs.
The _SFB keeps track of how long it has been active. A timeout error condition will occur if the _SFB is active longer then
the FBTIME value (DONEFB input has not become true). A timeout condition is considered to be an error, and will set the
fault output to true. A FBTIME of -1 will disable the function that checks current time against transition time. In this case
the _SFB will never go into a time out condition.
Some inputs can be considered to be global to the autosequence. Specific pins of an _SFB can be made global by assigning
the same signal to like pins of each _SFB in the autosequence, or the SEQMGR block can be used, and the same signal can
be tied to the GSTAT pin of each _SFB. In this case, no signal assignments are necessary for the inputs that are controlled
by the SEQMGR block. The inputs which are global are: HOLD, RESET, RETRY, SSMODE, and SSTRIG.
The HOLD input of an _SFB is used to stop the FBTIMER so that a timeout condition cannot occur. Other then stopping
the timer and not checking done feedback (cannot transition when in hold), the hold input has no other effect. If actions
need to take place when an auto sequence goes into hold, then other logic can be used which has the hold signal and active
step signal as inputs.
A useful feature of the _SFB is single step mode, implemented by using the SSMODE and SSTRIG inputs. These inputs
are global and so can be set via the SEQMGR for whole sequence. This feature can be used to implement a semi auto mode
for a sequence. When SSMODE input is true, then the _SFB will wait for the SSTRIG input to go from a zero to a one
before it sets its ON output (the active output will be on already). While waiting for the SSTRIG, the active output boolean
will be TRUE. The trigger will only been seen by the _SFB if its active output is TRUE.
The RETRY input is intended to get an _SFB out of an error hold condition when a fault has occurred. This input is
effective only if there has been a fault. When a retry is detected and the _SFB is faulted, it will reset its done feedback
timer, clear the fault output and then start timing again. It will also start checking for its DONEFB. A retry is strictly
required only if ERRHOLD input is true (although it can be used when ERRHOLD is false). If the _SFB is in a fault
condition and ERRHOLD is false, the _SFB will continue to watch for the DONEFB to come true regardless of the RETRY
input. However, a RETRY will clear the fault and the feedback timer will be reset (If feedback still does not become true in
time, another diagnostic will be issued).
The PASSTHRU input controls how the _SFB behaves if the DONEFB is true when the _SFB is first started. If
PASSTHRU is true, then only the ACTIVE output becomes true while the _SFB transitions to the next step. If
PASSTHRU is false, then both the ACTIVE and the ON outputs become true while the _SFB transitions to the next step.
The _SFB can be used to directly control a _PENG block by use of the PLUGCTL output. This is done by wiring the
PLUGCTL output of the _SFB to the PLUGCTL input of the _PENG. How the two blocks behave when they are tied
together is outlined below.
1. When an _SFB becomes active, then the _SFB will start the _PENG block.
2. For normal operation, the _PENG will turn on and strobe it's ONMSGP output.
3. When the _SFB detects that it's DONEFB is true, then the _SFB will check the _PENG's OFFPRM and FDBK. If they
are ok, then the _SFB will turn off the _PENG block.
4. The _SFB will now transition to the next step.
Any errors in the _PENG will cause the _SFB to fault, but only if the _SFB is active and had started or attempted to stop the
_PENG. the _SFB block will send the diagnostic message under this condition. Note that the _SFB and _PENG block
should reside in the same task in order to be assured of proper operation.

SBLIB Block Library 101

Sequence Manager
_SEQMGR, Sequencing
The Sequence Manager block collects global status information from all of the Sequential Function blocks (_SFBs) in a
sequence and distributes global inputs to each of these blocks.

_SEQMGR
b

RESET

RETRY

HOLD

SSMODE

SSTRIG

GSTAT

ON

ACTIVE

FAULT

Input
RESET
RETRY
HOLD
SSMODE
SSTRIG
GSTAT

Boolean
Boolean
Boolean
Boolean
Boolean
Integer

Global reset input to all the _SFBs.


Retry input to the _SFBs after a fault.
Hold input to all the _SFBs.
Global single-step mode.
Global single-step trigger.
Global input and output connection on the Sequence Manager.

Output
ON
ACTIVE
FAULT

Boolean
Boolean
Boolean

ON status output.
Sequence is active status output.
Sequence is faulted status output.

The Sequence Manager block must be in the same task as all the _SFBs in the sequence, and it must be at the beginning or
the end of the task for the status outputs to show accurate sequence information. Each _SFB (and _MERGE and
_BRANCH block) in a sequence should have the same signal attached to their GSTAT output pin.
The _SEQMGR block is used to show the status of a whole sequence. If any _SFB in the sequence is active, then the
ACTIVE output of the _SEQMGR will be true. The same applies to the ON and FAULT outputs. Note that for sequences
which have multiple branches that can run at the same time, all three outputs may be true ( one branch running, and another
faulted).
The five boolean inputs are used as global inputs for every Sequence block attached to the GSTAT signal. For instance,
when the RESET input goes high, all _SFB's (and _BRANCH and _MERGE blocks) in the sequence will reset, just as if
their own reset inputs had been set to TRUE.

102 SBLIB Block Library

Set Array
_SET_ARRAY_B, _SET_ARRAY_D, _SET_ARRAY_F, _SET_ARRAY_I, _SET_ARRAY_L,
Memory_Move
The Set Array blocks initialize an entire array with a single value when enabled.

_SET_ARRAY_a
b

ENABLE

SET

DEST[ ]

Input
ENABLE
SET

Boolean
Analog

If TRUE the block performs the initialization.


Source value.

Output
DEST[]

Analog

Destination array.

SBLIB Block Library 103

Split_xx
_SPLIT_FS, _SPLIT_LS, Memory Move
The SPLIT_xx blocks break apart large variables into smaller variables. They perform the dual function of the
_COMBINE_xx blocks. For example the _SPLIT_FS block creates two short integers from a single float. Likewise the
_SPLIT_LS block creates two short integers from a single long integer. The splitting of the signals is strictly mechanical.
That is, there is no attempt to interpret the data, or to perform any clamping, scaling, datatype conversion, or sign extension.

_ SPLIT_xx
b
f,l

Input
ENABLE
INPUT
Output
LOWORD
HIWORD

ENABLE

LOWORD

INPUT

HIWORD

Boolean
float or long
Integer

If TRUE the block executes.


Variable to split.

Integer
Integer

Low order 16 bits of the INPUT variable.


High order 16 bits of the INPUT variable.

104 SBLIB Block Library

Status-S Command Message Maker


_SS_ONE_DEST, Communications
The _SS_ONE_DEST block transmits Status-S Command (protocol 2) messages over any DLAN+ network attached to the
InnovSCtrlr. Multiple data types (i.e. boolean or analog) may be specified on the same block. One destination means that
the signals listed on the block must all have the same forwarding address. That is some of the signals cannot be sent
directly to a single device, while others are broadcast to a group of devices. The local variables listed on the LVAR[n] pins
are commanded into their associated SIG[N] signals after being scaled from the signals' scale records. Message
transmission is controlled by the ENABLE, WHN2SND, and SEND pins.
_SS_ONE_DEST

b
Chg_det_T

Boolean
Chg_det_T

SEND
DLOG
HOW

Boolean
Boolean
HowToSend

MSG_DIAG

WHN2SND

SEND

DLOG
^HOW

HowToSend

Input
ENABLE
WHN2SND

ENABLE

Drop

FROM

Drop

TO

Simple

LVAR1

SIG1

Command_S

Simple

LVAR2

SIG2

Command_S

Simple

LVAR3

SIG3

Command_S

Simple

LVAR4

SIG4

Command_S

Simple

LVAR5

SIG5

Command_S

Simple

LVAR6

SIG6

Command_S

Simple

LVAR7

SIG7

Command_S

Simple

LVAR8

SIG8

Command_S

Allows the block to execute.


Specifies how to evaluate the SEND pin as a trigger for message transmission:
level - send a message every sweep that SEND is TRUE
rising - send a message only on the rising edge of SEND
falling - send a message only on the falling edge of SEND
both - send a message on both rising and falling edges of SEND
Triggers a message to be transmitted.
Disable mode logging of the messages sent by this block.
Specifies whether the message is to be sent to one device, a group of devices, or all devices.
direct - the message will be sent directly to a single device identified as the owner of the
signals on the SIG[N] pins.
broadcast - the message will be broadcast to the devices specified by the FROM and TO
pins. If the FROM and TO pins are 0 the message will be sent to all devices on the

network.
group_name - If a group name is connected to this pin the message will be sent to all
devices in the group specified by the FROM , TO pins. Similar to the broadcast
specification
the message will be sent to all devices in the group on the network if FROM and TO are
0.

SBLIB Block Library 105

FROM
TO
LVAR1
LVAR2
LVAR3
LVAR4
LVAR5
LVAR6
LVAR7
LVAR8

Drop
Drop
Simple
Simple
Simple
Simple
Simple
Simple
Simple
Simple

From drop number range specifier (used if nonzero)


To drop number range specifier (used if nonzero)
First local variable in message to send.
Second local variable in message to send.
Third local variable in message to send.
Fourth local variable in message to send.
Fifth local variable in message to send.
Sixth local variable in message to send.
Seventh local variable in message to send.
Eighth local variable in message to send.

Output
MSG_DIAG
SIG1
SIG2
SIG3
SIG4
SIG5
SIG6
SIG7
SIG8

Long Int
Command_S
Command_S
Command_S
Command_S
Command_S
Command_S
Command_S
Command_S

Internal message ID used in low level monitor SS_Msg command


Target signal for the value of LVAR1.
Target signal for the value of LVAR2.
Target signal for the value of LVAR3.
Target signal for the value of LVAR4.
Target signal for the value of LVAR5.
Target signal for the value of LVAR6.
Target signal for the value of LVAR7.
Target signal for the value of LVAR8.

While signals of multiple datatypes may be specified on the block, they are not all guaranteed to be sent in a single message.
Consecutive pins of the same datatype are grouped together as a message. Therefore for more efficient operation, group the
signals by datatype.
Refresh bits are an exception to the grouping rule. They are always sent one signal per message. A refresh bit is a special
Status-S signal that is used to indicate the health of the sender to the receiver. The reception of the signal causes an action
to occur for as long as it is ON. Transmitting a refresh bit consists of sending an ON message followed by Second
periodic heartbeat messages to keep it ON, and terminating with an OFF message. If the receiver hears the ON message and
doesn't hear a new heartbeat message at least once every 1.28 Seconds it automatically turns the signal OFF.
The _SS_ONE_DEST block implements refresh bits in the following fashion. The SEND pin is used to trigger the
transmission of the ON message just like any other command. The heartbeat messages are automatically transmitted by the
block as long as the local variable LVAR[n] associated with the signal remains TRUE. When it transitions to FALSE the
OFF message is sent. This allows for more than one refresh bit to be sent by the same block and have the OFF messages
controlled separately.
Note that as a result of the refresh bit implementation if the local variable is hardcoded or forced to TRUE the heartbeat
messages will never stop being transmitted, and the OFF message will never be sent.
Additionally, the local variable must be TRUE when the SEND specification evaluates to TRUE or a FALSE will be
erroneously sent in the ON message. On the next sweep the block will see that the local variable is FALSE and send the
OFF message.
A typical example of configuring the block for a single refresh bit is to wire the local variable to both the SEND pin and the
LVAR[n] pin, and set the WHN2SND pin to rising.
Do not use the both specification on the WHN2SND pin to attempt to cause OFF messages to be sent by the falling edge of
the SEND pin.
The transmission of a Status-S message may be delayed by internal queuing, slow network token times, or low idle time in
the InnovSCtrlr. The _SS_ONE_DEST block does not wait for the message to complete, rather it queues the message for
transmission and exits so that the next block in the task is not delayed. It should never assumed that the message sent by the
block has been received when the block exits. If an error occurs during transmission the message is lost. The block will
have to be re-triggered by the SEND pin to transmit another message.

106 SBLIB Block Library

Status-S Feedback Page Update Period Modifier


_SS_PERIOD, Communications
The _SS_PERIOD block changes the transmission period of an owned Status S feedback page. A TRUE value on one of
the selection pins causes the associated time period to be programmed. The selection pins are prioritized such that lowernumbered pins prevail over higher-numbered pins. If no selection pin is TRUE the transmission period remains unchanged

_SS_PERIOD
b
Point_s

ENABLE

DONE

SIGNAL

LSTRATE i

SEL1

PERIOD1

SEL2

PERIOD2

SEL3

PERIOD3

SEL4

PERIOD4

Input
ENABLE
SIGNAL
SEL1
PERIOD1
SEL2
PERIOD2
SEL3
PEROD3
SEL4
PERIOD4

Boolean
Point_S
Boolean
Integer
Boolean
Integer
Boolean
Integer
Boolean
Integer

If TRUE allow the block to execute.


A signal on the owned page whose period is being changed. This uniquely identifies the page.
First period selector, TRUE to select PERIOD1.
First period in milli-Seconds. Must be no slower than 320 milli-Seconds.
Second period selector, TRUE to select PERIOD1.
Second period in milli-Seconds. Must be no slower than 320 milli-Seconds.
Third period selector, TRUE to select PERIOD1.
Third period in milli-Seconds. Must be no slower than 320 milli-Seconds.
Fourth period selector, TRUE to select PERIOD1.
Fourth period in milli-Seconds. Must be no slower than 320 milli-Seconds.

Output
DONE

Boolean

LSTRATE

Integer

Indicates that a change has been made. DONE is set FALSE upon the selection of a new
period and set TRUE when the network driver confirms that the new period has been accepted.
Last rate state pin. If more than one _SS_PERIOD block is used to control the period of the
same SS page all of the LSTRATE pins must be connected together through the same signal.

SBLIB Block Library 107

Steer
_STEER_B, _STEER_D, _STEER_F, _STEER_I, _STEER_L, Memory_Mov
The Steer blocks move the input to one of the eight outputs, or to the cascade pin, based on the prioritized evaluation of the
eight selection pins. All other outputs are set to zero (FALSE for _STEER_B). Working in ascending order from SEL1 the
first TRUE value encountered causes the input to be gated to the corresponding output. If none of the selection pins is
TRUE then the input is gated to the cascade pin. If any of the selection pins or the CLR pin are TRUE then the ACT pin is
set to TRUE. If CLR is TRUE then all of the outputs and the cascade pin are set to zero. By tying ACT pins to CLR pins
Steer blocks may be cascaded with the highest priority selections placed on the first blocks in the string.

_STEER_v
b

ENABLE

CASC

CLR

ACT

IN

OUT1

SEL1

OUT2

SEL2

OUT3

SEL3

OUT4

SEL4

OUT5

SEL5

OUT6

SEL6

OUT7

SEL7

OUT8

SEL8

Input
ENABLE
CLR
IN
SEL1
SEL2
SEL3
SEL4
SEL5
SEL6
SEL7
SEL8

Boolean
Boolean
Simple
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean

If TRUE the block executes.


If TRUE all outputs and CASC are cleared.
Input variable.
First selection input.
Second selection input.
Third selection input.
Fourth selection input.
Fifth selection input.
Sixth selection input.
Seventh selection input.
Eighth selection input.

Output
CASC
OUT1
OUT2
OUT3
OUT4
OUT5
OUT6
OUT7
OUT8

Simple
Simple
Simple
Simple
Simple
Simple
Simple
Simple
Simple

Default selection.
First output variable.
Second output variable.
Third output variable.
Fourth output variable.
Fifth output variable.
Sixth output variable.
Seventh output variable.
Eighth output variable.

108 SBLIB Block Library

Task Scan
_SCAN, Regulators
The Task Scan block returns the task scan time, the scheduled scan rate and the value of the InnovSCtrlr System Clock
Tick.. The SCAN value may not always equal SCAN_RT if higher priority tasks preempt this task.

_SCAN
SCAN

Output
SCAN
SYSTICK
SCAN_RT
SCAN_FINE

Float
Float
Float
Float

SYSTICK

SCAN_RT

SCAN_FINE

Actual Task Scan Time in seconds.


System Clock Tick (500 sec units).
Scheduled Task Scan Rate in seconds.
Actual task time in microseconds.

SBLIB Block Library 109

Temperature Set
TEMP_SET, Diagnostics
The temperature set block specifies the temperatures at which airflow and overtemperature diagnostic messages are
generated for the controller CPU module. The temperature values are stored as global variables so there should be only one
instance of the block per device to avoid data overwrites. For TMR systems the temperature values can be set individually
in each controller.
_TEMP_SET

Output
BRD_SET

Integer

CPU_SET

Integer

BRD_SET

CPU_SET

The board ambient temperature setpoint in degrees Celsius that triggers the AIRFLOW
diagnostic if board ambient temperature is available in this hardware.
The CPU die temperature setpoint in degrees Celsius that triggers the OVERTMP diagnostic if
the CPU die temperature is available in this hardware.

110 SBLIB Block Library

Timer
_TIMER, Timer_Counters
The Timer block accumulates incremental time into CURTIME while RUN is TRUE. When CURTIME is equal to
MAXTIME, AT_TIME transitions to TRUE. If RUN is FALSE then timing is suspended but the value in CURTIME
remains. If RESET is TRUE then CURTIME is set to zero and counting is suspended. The AUTO_RS flag can be set to
automatically reset the timer after it reaches MAXTIME. In this mode, AT_TIME will be true for one scan and the
CURTIME will be set to the residual count so that no time is lost.
_TIMER
l

MAXTIME

AT_TIME

RESET

CURTIME

AUTO_RS

LST_TCK

RUN

STATIC [2]

Input
MAXTIME
RESET
AUTO_RS
RUN

Long Integer
Boolean
Boolean
Boolean

Maximum time value in milli-Seconds.


Zeros the timer.
Automatically zeros the timer when AT_TIME is set. Maintains residual count.
Enables the timer.

Output
AT_TIME
CURTIME
LST_TCK
STATIC[2]

Boolean
Long Integer
Long Integer
Short Integer

Indicates the timer has reached the maximum time value.


Current time value in milli-Seconds.
Internal state information. Do not attach to any other block. (hidden)
Internal state information. Do not attach to any other block. (hidden)

SBLIB Block Library 111

Timer_s
_TIMER_S, Timer_Counters
The Timer_s block accumulates incremental time into CURTIME while RUN is TRUE. When CURTIME is equal to
MAXTIME, AT_TIME transitions to TRUE. If RUN is FALSE then timing is suspended but the value in CURTIME
remains. If RESET is TRUE then CURTIME is set to zero and counting is suspended. The block will continuously count
to the MAXTIME value and reset if the AUTO_RS flag is set. This block differs from the Timer block in that the
MAXTIME parameter must be less than 32,767 milliseconds.

_TIMER_S
i

MAXTIME

AT_TIME

RESET

CURTIME

AUTO_RS

LST_TCK

RUN

STATIC [2]

Input
MAXTIME
RESET
AUTO_RS
RUN

Short Integer
Boolean
Boolean
Boolean

Maximum time value in milliseconds.


Zeros the timer.
Auto reset. Set curtime to 0 after reaching MAXTIME
Enables the timer.

Output
AT_TIME
CURTIME
LST_TCK
STATIC[2]

Boolean
Short Integer
Long Integer
Short Integer

Indicates the timer has reached the maximum time value.


Current time value in milliseconds.
Internal state information. Do not attach to any other block. (hidden)
Internal state information. Do not attach to any other block. (hidden)

112 SBLIB Block Library

Totalizer
_TOTALIZER, Timer_Counters
The totalizer block uses a special area of the NVRAM to maintain critical application code counter values. The Totalizer
block has 64 totalizers (counters) that accumulate rising edges of the INCx pin in the TOTALx variable. When a rising
edge of INCx is detected 1 is added to the value stored in TOTALx. When TOTALx reaches its maximum value (2^31 -1)
then on the next rising edge of INCx, ROLLx transitions to TRUE and TOTALx is set to zero until the next rising edge of
INCx. TOTALx is never negative. Totalizer values may be set by using the "Set totalizer values" menu option from the
Toolbox.
The totalizer block should always be implemented in a protected macro to prevent unauthorized users from modifying the
logic driving the counters.
Only one instance of the totalizer block is allowed in the application code.

_TOTALIZER

INC1

TOTAL1

INC2

ROLL1

TOTAL2

ROLL2

TOTAL64

ROLL64

INC64

Inputs:
INCx

Boolean

The specified totalizer increments on the rising edge of this pin.

Outputs:
TOTALx
ROLLx

Long integer
Boolean

The output value of the totalizer for use by other application code.
TRUE if the totalizer value has overflowed. The pin stays TRUE until INCx increments again.

SBLIB Block Library 113

Transfer Function
_TRNFUN_D, _TRNFUN_F, Regulators
The Transfer Function block provides a digital implementation of the following transfer function:

a2 * s 2 + a1 * s + a0
b2 * s 2 + b1 * s + b0
This equation can approximate a phase lead, phase lag, simple lag, phase lead/lag, or a bridged-T (Notch) compensator
depending upon the choice of the appropriate coefficients. The block can also be used to create Butterworth, Chebyshev,
etc., second order filters and can be cascaded to form higher order filters.

_TRNFUN
b

ENA_FUN

OUT

ENA_DYN

STATES[2]

DLOCK

CI_ERR

IN

A2

A1

A0

B2

B1

B0

PRESET

Input
ENA_FUN
ENA_DYN

Boolean
Boolean

DLOCK

Boolean

IN
A2
A1
A0
B2
B1
B0
PRESET

Float
Float
Float
Float
Float
Float
Float
Boolean

Output
OUT
CI_ERR

Float
Boolean

f
d
b

a2 * s 2 + a1 * s + a0
b2 * s 2 + b1 * s + b0

If TRUE the function is enabled, else the input value is moved to the output.
If TRUE the coefficients are re-evaluated in the foreground each sweep. Otherwise this
calculation is performed in the background.
If TRUE an error found by the stability checker does NOT prevent the block from accepting the
new coefficients. Normally coefficients that result in unstable transfer functions are rejected.
Note that if this pin is set AFTER discovering that a specified function is deemed unstable, the
coefficients must be altered again to cause the block to recalculate and then accept the new
values.
Input value.
Second order numerator coefficient.
First order numerator coefficient.
Zero order numerator coefficient.
Second order denominator coefficient.
First order denominator coefficient.
Zero order denominator coefficient.
If TRUE, and ENA_FUN is TRUE calculate the state variables so as to drive the output to the
input value.

Output value.
If TRUE it indicates that the specified transfer function is unstable.

114 SBLIB Block Library

State
STATES[2]

Long Float

Two internal state variables.

The nature of the transfer function may be altered online by changing the values of the equation coefficients. The block
calculates whether the new coefficients result in an unstable function (i.e. one or more poles lie outside the unit circle). If
found to be unstable the block does not switch to the new function but maintains the old coefficients. The switching lockout
may be defeated by using the DLOCK pin but CI_ERR will still be set TRUE if the stability check fails.
Note the stability check is intended to protect the user against transfer functions that are grossly unstable. It cannot replace
sound engineering judgement. Limitations in the stability check may cause erroneous results when the coefficients specify
a marginally stable transfer function. Neither can it guarantee anything about the stability of the loop in which it is placed.
The evaluation of coefficients normally occurs in the background and the coherent set is transferred to the foreground.
Therefore the change from one set of coefficients to another may require over 500 milliseconds to occur. If ENA_FUN is
set to TRUE this calculation is performed in the foreground, but the block incurs an execution time penalty as a result. If
foreground coefficient evaluation is chosen the block is preset with the unity gain function at initialization time. The first
evaluation occurs at the first foreground execution and if found to be unstable, the unity gain function remains in effect.
The _TRNFUN_F form should be used to implement second order and simpler functions. The _TRNFUN_D form should
be used when cascading blocks to create higher order forms because it maintains the resolution of a double floating point
number between the blocks. A datatype conversion block (e.g. _MOVE_F) is required to convert the output of the final
block back to a single precision floating point number for use with most other blocks.
The transformation from the continuous domain (s) into the discrete domain (z) is accomplished by bilinear transformation.
This method produces accurate results for frequencies of interest that are less than 0.3/T (w < 0.3/T). For tasks executing at
32 milliseconds this is about 10 radians, or 1.5 Hz. For tasks executing at 2 mSec this is about 150 radians, or 24 Hz.

SBLIB Block Library 115

Transport Delay
TRAN_DLY, Regulators
The transport delay block accumulates float input samples into a list with a new entry added to the list each time the block is
executed. The block outputs the oldest value stored in the array as well as the Nth value stored prior to the inclusion of the
current input value.
TRAN_DLY
f

IN

OLD

N_DELAY

OUT

LIST []

STATE

Input
IN
N_DELAY

Float
Float

Next value to be entered into the list.


Value to be returned in the OUT variable

Output
OLD
OUT
LIST[]
STATE

Float
Float
Float Array
Long Integer

Oldest value stored in LIST array.


Nth newest stored value in the list as specified by N_DELAY.
Storage array for the delay list.
Internal state information. Do not attach to any other block.

116 SBLIB Block Library

VME Array Read


_VME_ARD, I/O
The VME array read block reads a section of continuous VME memory into a signal array.
_VME_ARD
b

ENABLE

AM_CODE

BUS_SIZ

BYT_SWP

VME_ADR

STATUS

ARRAY[]

TEMP_1

Input
ENABLE
BYT_SWP
VME_ADR

Boolean
Boolean
long int.

Enables VME block.


Exchange high & low byte on each VME access..
Offset into the VME memory space to start the transfer.

Constant
AM_CODE
BUS_SIZ
TEMP1

short int.
short int.
short int.

VME Address modifier code. Determines VME address space.


Type of VME bus access. 8 or 16 bit.
Data type of array - initialized by ISC.

Output
STATUS
ARRAY[]

Boolean.
analog array

Bus Status after VME transfer. True = OK, False = error.


Storage array for the VME data. Determines transfer size.

The data is read from a specific VME offset for an AM code. The block then places the results of the read in an analog
signal array. Data can be transferred by bytes or words across the VME back plane and data can be swapped to conform to
16 bit Motorola format. The size of the transfer is determined by the size of the signal array.
The VME bus error signal is checked for the transfer. The output status will be set to TRUE if no bus error was detected.
The bus error is checked after the first transfer and after the entire transfer. No data will be transferred if the error occurs
on the first access.
Data coherency is limited to the bus size. The best coherency possible at this time is 16-bits.

SBLIB Block Library 117

VME Array Write


_VME_AWR, I/O
The VME array write block writes a signal array into a section of continuous VME memory.

_VME_AWR
b

ENABLE

AM_CODE

BUS_SIZ

BYT_SWP

ARRAY[]

VME_ADR

STATUS

TEMP_1

Input
ENABLE
BYT_SWP
VME_ADR

Boolean
Boolean
long int.

Enables VME block.


Exchange high & low byte on each VME access..
Offset into the VME memory space to start the transfer.

Constant
AM_CODE
BUS_SIZ
TEMP1

short int.
short int.
short int.

VME Address modifier code. Determines VME address space.


Type of VME bus access. 8 or 16 bit.
Data type of array - initialized by ISC.

Output
STATUS
ARRAY[]

Boolean.
analog array

Bus Status after VME transfer. True = OK, False = error.


Input array for the VME data. Determines transfer size.

The data is taken from an analog signal array and placed in a specific VME offset for an AM code. The data can be
transferred by bytes or words across the VME back plane and data can be swapped to conform to 16 bit Motorola format.
The size of the transfer is determined by the size of the signal array.
The VME bus error signal is checked for the transfer by reading the first byte of the VME memory. The output status will
be set to TRUE if no bus error was detected. The bus error is checked after the first transfer and after the entire transfer.
No data will be transferred if the error occurs on the first access.
Data coherency is limited to the bus size. The best coherency possible at this time is 16-bits.

118 SBLIB Block Library

VME Boolean Read


_VME_BRD, I/O
The VME Boolean read block reads a byte of VME memory and stores one of the bits into a Boolean Signal.

_VME_BRD
b

ENABLE

AM_CODE

BIT_MSK

VME_ADR

STATUS

SIGNAL

Input
ENABLE
VME_ADR

Boolean
long int.

Enables VME block.


Offset into the VME memory space to start the transfer.

Constant
AM_CODE
BIT_MSK

short int.
short int.

VME Address modifier code. Determines VME address space.


Bit mask for VME data. Selects bit within byte for operation

Output
STATUS
SIGNAL

Boolean.
Boolean.

Bus Status after VME transfer. True = OK, False = error.


Storage Boolean for the VME masked data.

A data byte is read from a specific VME offset for an AM code. It is then masked and the results placed in a Boolean
Signal.
The VME bus error signal is checked for the transfer. The output status will be set to TRUE if no bus error was detected
during the VME transfer.

SBLIB Block Library 119

VME Boolean Write


_VME_BWR, I/O
The VME Boolean write block takes Boolean signal and stores the bit in a VME memory byte.

_VME_BWR
b

ENABLE

AM_CODE

BIT_MSK

SIGNAL

VME_ADR

STATUS

ORG_VAL

Input
ENABLE
VME_ADR
SIGNAL

Boolean
long int.
Boolean

Enables VME block.


Offset into the VME memory space to start the transfer.
Data to be masked and transferred to VME memory.

Constant
AM_CODE
BIT_MSK

short int.
short int.

VME Address modifier code. Determines VME address space.


Bit mask for VME data. Selects bit within byte for operation

Output
STATUS
ORG_VAL

Boolean
Boolean

Bus Status after VME transfer. True = OK, False = error.


Original state of a Boolean bit in VME prior to write.

A Boolean signal is read and its state is placed in VME memory, based on a bit mask and VME offset. The original state of
the bit is returned in the ORG_VAL signal.
The VME bus error signal is checked for the transfer. The output status will be set to TRUE if no bus error was detected
during the VME transfer.
Note that there is a potential that another VME write from a different agent may modify the VME memory between this
blocks read and write operation. Only one agent should write to any specific byte in VME memory to eliminate this
possibility.

120 SBLIB Block Library

VME Byte Read


_VME_BYT_R, I/O
The VME Byte read block reads a byte of VME memory and stores it into a short integer.
_VME_BYT_R
b

ENABLE

AM_CODE
l

VME_ADR

STATUS

SIGNAL

Input
ENABLE
VME_ADR

Boolean
long int.

Enables VME block.


Offset into the VME memory space to start the transfer.

Constant
AM_CODE

short int.

VME Address modifier code. Determines VME address space.

Output
STATUS
SIGNAL

Boolean.
short int.

Bus Status after VME transfer. True = OK, False = error.


Storage word for the VME masked data.

A data byte is read from a specific VME offset for an AM code. It is then stored as in unsigned character into a short
integer.
The VME bus error signal is checked for the transfer. The output status will be set to TRUE if no bus error was detected
during the VME transfer.

SBLIB Block Library 121

VME Byte Write


_VME_BYT_W, I/O
The VME byte write block takes a short integer and stores its lower 8 bits into a VME memory byte.

_VME_BYT_W
b

ENABLE

AM_CODE

SIGNAL

VME_ADR

STATUS

Input
ENABLE
SIGNAL
VME_ADR

Boolean
short int.
long int.

Enables VME block.


Data to be truncate and transferred to VME memory.
Offset into the VME memory space to start the transfer.

Constant
AM_CODE

short int.

VME Address modifier code. Determines VME address space.

Output
STATUS

Boolean.

Bus Status after VME transfer. True = OK, False = error.

A short integer signal is read and the lower 8 bits are stored in VME memory.
The VME bus error signal is checked for the transfer by reading the location prior to writing the value. The output status
will be set to TRUE if no bus error was detected during the VME transfer.
.

122 SBLIB Block Library

VME Read
_VME_READ, I/O
The VME read block collects up to 32 signals from VME memory.

_VME_READ
b

ENABLE

AM_CODE

BUS_SIZ

BYT_SWP

ADDR_[1..32]

STATUS

SIG_[1..32]

TEMP_[1..32]

Input
ENABLE
BYT_SWP
ADDR_x

Boolean
Enables VME block.
Boolean.
Exchange high & low byte on each VME access..
long int.[1..32] 1-32 Offset into the VME memory space to start the transfer.

Constant
AM_CODE
BUS_SIZ
TEMP_x

short int.
VME Address modifier code. Determines VME address space.
short int.
Type of VME bus access. 8 or 16 bit.
short int.[1.32] 1-32 Data type of signal - initialized by ISC.

Output
SIG_x
STATUS

analogs[1..32]. 1-32 Storage signals for the VME data. Determines transfer size.
Boolean.
Bus Status after VME transfer. True = OK, False = error.

Data is read from multiple VME offsets for an AM code. The results are then placed in a set of analog signals of various
data types. Data can be transferred by bytes or words across the VME back plane and data can be swapped to conform to
16 bit Motorola format. The size of the transfer is determined by the data type of each signal.
The VME bus error signal is checked for the transfer. The output status will be set to TRUE if no bus error was detected.
The bus error is checked after the first transfer and after the entire transfer. No data will be transferred if the error occurs
on the first access.
Data coherency is limited to the bus size. The best coherency possible at this time is 16-bits. The ISC will disable
interrupts while it transfers each signal, but other VME agents may be able to read or write the signal between multi-word
accesses.

SBLIB Block Library 123

VME Test
_VME_TEST, I/O
The VME test block writes a 1 to a VME byte using the RMW cycle of the VME bus.

_VME_TEST
b

ENABLE

AM_CODE

VME_ADR

STATUS

LOCKED

Input
ENABLE
VME_ADR

Boolean
long int.

Enables VME block.


Offset into the VME memory space to start the transfer.

Constant
AM_CODE

short int.

VME Address modifier code. Determines VME address space.

Output
STATUS
LOCKED

Boolean.
Boolean.

Bus Status after VME transfer. True = OK, False = error.


Set to true if the byte was originally a 0.

A value of 1 is written to the low order bit of a VME memory offset using a RMW access cycle. The RMW access reads a
value and stores a 1 to that location in one VME cycle. The locked status is set to TRUE if the original value was 0
indicating that the test operation has acquired a semaphore lock. If the byte was already locked (byte = 1), the locked status
is set to FALSE.
Note that the UCVA does not support a RMW cycle nor do a lot of third party VME cards. If the block determines that the
RMW cycle is not supported, it will do the operation, but in multiple VME cycles. In this case another VME agent could
attempt to lock the memory at the same time and both could think that they have access to the area.
The VME bus error signal is checked for the transfer. The output status will be set to TRUE if no bus error was detected
during the VME transfer.

124 SBLIB Block Library

VME Write
_VME_WRITE, I/O
The VME write block takes up to 32 signals and stores them in various offsets in VME memory.

_VME_WRITE
b

ENABLE

AM_CODE

BUS_SIZ

BYT_SWP

SIG_[1..32]

ADDR_[1..32]

STATUS

TEMP_[1..32]

Input
ENABLE
BYT_SWP
ADDR_x

Boolean
Enables VME block.
Boolean.
Exchange high & low byte on each VME access..
long int.[1..32] 1-32 Offset into the VME memory space to start the transfer.

Constant
AM_CODE
BUS_SIZ
TEMP_x

short int.
VME Address modifier code. Determines VME address space.
short int.
Type of VME bus access. 8 or 16 bit.
short int.[1.32] 1-32 Data type of signal - initialized by ISC.

Output
SIG_x
STATUS

analogs[1..32]. 1-32 Input signals for the VME data. Determines transfer size.
Boolean.
Bus Status after VME transfer. True = OK, False = error.

Data is read from 1 to 32 analog signals of various data types and stored to multiple VME offsets. Data can be transferred
by bytes or words across the VME back plane and data can be swapped to conform to 16 bit Motorola format. The size of
the transfer is determined by the data type of each signal..
The VME bus error signal is checked for the transfer by reading the first byte of the signal. The output status will be set to
TRUE if no bus error was detected. The bus error is checked after the first transfer and after the entire transfer. No data
will be transferred if the error occurs on the first access.
Data coherency is limited to the bus size. The best coherency possible at this time is 16-bits. The ISC will disable
interrupts while it transfers each signal, but other VME agents may be able to read or write the signal between multi-word
accesses.

SBLIB Block Library 125

126

SBLIB Block Library

*(,QGXVWULDO6\VWHPV
*HQHUDO(OHFWULF&RPSDQ\



5RDQRNH%OYG

ZZZ*(LQGXVWULDOFRP

6DOHP9$86$

S-ar putea să vă placă și