Special Functions (Via SBs & SIs) List

Click on the function name to view a Help topic containing specific instructions on how to implement the function.

Special Functions: without Ladder elements

U90Ladder contains special functions that are not represented by Ladder Elements.  You can perform these functions by storing values into the System Integers listed here.

To implement a special function:

  1. Store the parameters of the function in the relevant SI function operands.

  2. Store the command number into SI 140.

Note that the command number must be stored into SI 140 after the parameters are stored into the operands.

SI

Description

140

Function Number

141

Function Operand #1

142

Function Operand #2

143

Function Operand #3

144

Function Operand #4

145

Function Operand #5

146

Function Operand #6

146

Function Operand #7

The example below shows the function A*B/C, which enables the PLC to multiply 2 operand values & divide the product by a third operand.

 

Function #
(SI 140)

Description

100

Multiply A x B, Divide by C

Note that when you run Test (Debug) Mode, the current value in SI 140 will not be displayed.

 

The function stores the result in SI 144.

Functions activated by SI 140

Function Name

Description

Parameters

Execute Function, Store into SI140

A*B/C

Enables PLC to multiply 2 operand values & divide the product by a third operand.

  • SI 141  Operand A (multiplicand).

  • SI 142  Operand B (multiplicand),

  • SI 143  Operand C (divisor).

  • 100

Change COM Port Parameters

Enables you to change the serial communication port default settings for M91 controllers. M90 models do not support this function.

  •  SI 141  Baudrate

  •  SI 142  Data bits

  •  SI 143= Parity e

  •  SI 144  Hardware flow control

  •  SI 145 = Timeout 10ms units

  •  SI 146 = Stop bits

 

SB 141 indicates whether the COM port has been successfully initialized with the new parameters successfully: 1 = success, 0 =fail

SI 140: 310

Communication Utility

Enables PLC to receive data from external devices, such as bar-code readers, via an RS232 port.

  • SI 141  STX

  • SI 142  ETX

  • SI 143  ETX Length or Silent

  • SI 144  Maximum Length

  • SI 145  Start Address: Receive Buffer

  • SI 60  # of Bytes currently in Receive Buffer

  • SI 61  # of Bytes in Receive Buffer when SB 60=1

  • SI 146  Copy Data: Format

 

  • SB 60  Data Successfully Received

  • 300

Additional Functions:

  • Set SB 61 to Copy Data in Receive Buffer to Vector

  • Set SB 62 to Clear Receive Buffer, Clear SI 60, Clear SI 61,& Reset SB 60

Copy Vector

Sets a vector, copies source values, then writes those values into a corresponding target vector.

  • SI 141  Source Vector

  • SI 142  Vector Length

  • SI 143  Target Vector

  • Copy MIs to MIs: 20

  • Copy MIs to DBs: 21

  • Copy DBs to MIs: 22

  • Copy DB to DB: 23

Copy vector of MBs

Sets an MB vector, copies source values, then writes those values into a corresponding target MB vector.

  • SI 141  Source MB Vector

  • SI 142  Target Vector

  • SI 143  Vector Length

  • 24

Fill Vector

Copies a source value, then write that value into every operand within the target vector.

  • SI 141  Start of Target vector,

  • SI 142  Length of Target vector,

  • SI 143  Fill Value; register whose value will be written into each register within the target vector

  • Fill MI vector: 30

  • Fill DB vector: 31

  • Fill MB vector: 36

Set bit in MI vector

Sets a bit within an MI vector

  • SI 141  Start of MI vector,

  • SI 142  Location of bit to be set within vector (offset)

  • 37

Reset bit in MI vector

Resets a bit within an MI vector

  • SI 141  Start of MI vector,

  • SI 142  Location of bit to be reset within vector (offset)

  • 38

Test bit in MI Vector

Selects a bit within a vector of registers, and stores its status in an MB.  

  • SI 141  Start of Target vector,

  • SI 142  Location of bit to be set within vector (offset),

  • SI 143  Target Bit, determines the address of the MB, where the value of the selected bit will be stored.

  • 39

Find Mean, Maximum, and Minimum Values

Finds within vector: Mean, Minimum, & Maximum.

  • SI 141  Start of vector,

  • SI 142  Length of vector

  • Find in MI vector: 40

  • Find in DB vector: 41

GSM PIN Code via MI

Uses an MI vector to supply a GSM modem PIN code

  • SI 141  Start of vector

  • 410

Interrupt

Causes program to stop immediately without regard to program scan

See Interrupt for details

  • 500

 

Loadcell

M91 PLCs support Loadcell via I/O Expansion modules IO-LCxx. Check the Loadcell topic for details and a commands list.

Load Indirect

Takes value contained in a source operand and loads that value into a target operand using indirect addressing

  • SI 141  Data source

  • SI 142  Load target

  • Load MI to MI: 10

  • Load SI to MI: 11

  • Load MI to SI: 12

  • Load SI to SI: 13

 

Load Timer Preset/Current Value

Load a preset or current timer value into another operand

SI 141 to select the timer; 0-63

  • Load Timer Preset: 202

  • Load Timer Current: 203

MODBUS

Enables MODBUS Master/Slave communications

See MODBUS for details

  • Configure: 600, enable PC applications access (see MODBUS topic)

  • Configure: 600

  • Read Coils: 601

  • Force Coil: 602

  • Force Coils: 603

  • Read Output Registers: 604

  • Preset Register: 605

  • Preset Registers:606

  • Read Input Registers: 609

  • Read Inputs: 611

  • Loopback Test: 612

SMS Phone Number: via MI Pointer

Uses an MI vector to supply a phone number in the SMS phone book

  • SI 141  Start address of the MI vector containing the phone number

  • Store 400 into SI 140

Store Timer's Preset/Current Value

Store a value into a timer to change the preset or current timer value.

  • SI 141 to select the timer; 0-63,

  • SI 142 to determine the timer value,

  • SI 143 to select the timer's resolution

  • Store Timer Preset: 200

  • Store Timer Current: 201

 

Square Root

Finds the square root of a number

  • SI 141  Store the number

  • Store 110 into SI 140

Temperature

Convert C° to F°

  • SI 141 Data Source: C° value

  • SI 142 Result: F° value

Degree value representation: 500 means 50.0

130

Temperature

Convert F° to C°

  • SI 141 Data Source:F° value

  • SI 142 Result: C° value

Degree value representation: 500 means 50.0

131

Functions activated by SBs

 

Function Name

Description

Parameters

Activating SB-SI

PID auto-tune (M91)

M91 controllers may be easily tuned via SBs. Each PID loop is linked to two SBs, one to activate auto-tune, and one that signals when the process is complete.

auto-tune parameters are taken from the PID function

  • SB101 Start auto-tune - Loop 1

  • SB102 Start auto-tune - Loop 2 s

  • SB103 Start auto-tune - Loop 3

  • SB104 Start auto-tune - Loop 4

  • SB109 Select PID method (OFF by default) Turn ON to perform auto-tune

Convert MB to MI, MI to MB

Converts 16 bits or more into a integer value, or an integer value into 16 bits

  • SI 170 Address of MI containing integer value

  • SI 171 Start address of MB array (vector)

  • SI 172 Amount of MBs

  • Set SB 170 to activate MB to MI

  • Set SB 171 to activate MI to MB

Copy MI to Output vector, Input vector to MI

  • Copy a vector of Inputs (I) to a register.

  • Copy a register value to a vector of Outputs (O)

  • SI 170 Address of MI containing integer value

  • SI 171 Start address of bit array (vector)

  • SI 172 Amount of bits

  • Set SB 172 to activate I to MI

  • Set SB 173 to activate MI to O

Database

The M90/91 has a special memory area containing integers that are function as a database.

Within the database, you can access and use integers 0 through 1023 via SI 40 and SI 41. See Using the Database for details.

Delete SMS messages

Delete SMS messages from a SIM card

SI 187, Number of SMS messages to be deleted

Set SB 193 to delete messages (default 20 messages)

Immediate: Read Inputs & HSC, Set/Reset Outputs

Perform immediate actions, without regard to the program scan.

Model-dependent; see Immediate: Read Inputs & HSC, Set/Reset Outputs for details.

Long Integer Functions

  • Uses adjacent MIs in performing calculations and storing results.

  • Not supported byM90.

 

  • Set SB 82 to treat 2 registers as 'long integer'

 

Linearization

Convert analog values from I/Os into decimal or other integer values

SI 80 - 85: (x,y) variable ranges.

Set SB 80 to activate the Linearization function.

Shift Register

Load SI 87 with a value, use SBs to shift register bits left/right

  • SI 87  Contains the number to be shifted

  • SI 88 contains the number of bits to be shifted (Default is 1 bit)

  • Set SB 87 to shift left

  • Set SB 88 to shift right