Syntax, Example – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual

Page 122

Advertising
background image

Publication 1746-RM001A-US-P

9-6 Math and Backplane Conversion Functions

SLC floating-point numbers are stored in two 16-bit words.

Syntax

This routine has one input and one output argument. The input argument is the
address of the module’s input buffer containing the value to be converted.
Addresses 100-163 are from the M0 file and 200-207 are from the SLC Output
Image. The output argument is the converted value.

PUSH [input buffer of value to be converted]

CALL 89

POP converted value

Example

>50

PUSH 2: REM Transfer 2 words (1 floating-point value) from

M0 file to BASIC input buffer for conversion

>60

CALL 56: REM Transfers data from M0 file to BASIC input

buffer

>70

POP 5 : REM Status for CALL 56

>80

PUSH 100 : REM module input buffer address

>90

CALL 89

>100 POP C : REM The variable C will contain the converted value

IMPORTANT

Due to the fact that the SLC floating-point number is a 7-digit
floating-point number, and the module is an 8-digit
floating-point number, some round-off error may be introduced
during number conversions.

Advertising