Basic programming guide – Remote Processing BASIC for the CX-10 Modbus User Manual

Page 66

Advertising
background image

BASIC PROGRAMMING GUIDE

2-57

SGN

Syntax:

SGN(expr)

Function:

Returns +1 if expr is greater than zero, zero if the expr equals zero, and -1 if expr is less than zero.

Mode:

Command, run

Use:

PRINT SGN(SIN(X)))

DESCRIPTION

Use SGN in level control applications. If a level is high or low, it can direct control to the appropriate
program.

EXAMPLE

100

ON SGN(A)+1 GOSUB 2000,3000,4000

Advertising