Basic operators -6, Basic operators – Rockwell Automation 1746-BAS-T SLC 500 Basic Basic-T Modules User Manual
Page 54

Publication 1746-UM004B-EN-P - December 2005
4-6 Programming Overview
Refer to the BASIC Language Reference Manual, publication
1747-RM001, for additional information on these statements.
BASIC Operators
BASIC operators are programming instructions that are executed
during Run mode. Typically these operators perform a predefined
operation on either variables or constants. Operators require either
one or two operands. The following table lists the BASIC
programming operators.
RETI
RETURN from interrupt.
RETI
RETURN
RETURN from subroutine.
RETURN
ST@
Store top of stack at user specified location.
ST@ 1000H, ST@ A
STOP
Break program execution.
STOP
STRING
Allocate memory for STRINGs.
STRING 50, 10
Statement
Function
Examples
Operator
Function
Examples
ABS ( )
Return the absolute value of expression.
ABS (-3)
( ) + ( )
Add expressions together.
1+1
ASC ( )
Return integer value of ASCII character.
ASC (3)
ATN ( )
Return arraignment of argument.
ATN (1)
CHR ( )
Convert numeric expression to ASCII value.
CHR (65)
COS ( )
Return the cosine of argument.
COS (0)
( ) / ( )
Divide first expression by second expression.
10/2
EOF
Test for empty input buffer.
IF (NOT(EOF))
EXP ( )
Raise number to power of argument.
EXP (10)
( ) ** ( )
Raise first expression by the power of the second
expression.
2**4
FREE
List available bytes in RAM.
FREE=
GET
Read console.
P. GET
INT ( )
Return integer portion of expression.
INT (3.2)
IP
Read/assign IP register.
IP=0
LEN
List amount of bytes in current program.
LEN
LOG ( )
Return the natural log of the argument.
LOG (10)
( ) .AND. ( )
Combine the first expression with the second expression
using .AND..
10.AND.5