Specifications

BASIC commands
PROGRAMMING MANUAL 165
Revision 5.0
3.2.244 SETCOM
/i
/i
/i
/i
/i
3.2.245 SGN
/i
3.2.246 SIN
/i
Arguments bit_number
The number of the bit to be set. Range: [0,23].
vr_number
The number of the VR variable for which the bit is set. Range: [0,1023].
Example No example.
See also CLEAR_BIT, READ_BIT, VR.
Type Communication command
Syntax SETCOM(baud_rate, data_bits, stop_bits, parity, port_number, mode)
Description The SETCOM command sets the serial communications for the serial ports.
The command will enable the Host Link protocols or define the general-pur-
pose communication.
The serial ports have 9,600 baud rate, 7 data bits, 2 stop bits, even parity and
XON/XOFF enabled for general-purpose communication by default. These
default settings are recovered at start-up.
Arguments baud_rate
1200, 2400,4800, 9600,19200, 38400
data_bits
7, 8
stop_bits
1, 2
parity
0 = None; 1 = Odd; 2 = Even.
port_number
See the table below.
port_number value Description
1 RS-232C serial port 1
2 RS-422A/485 serial port 2
mode
Select one of the modes listed in the table below for serial ports 1 and 2.
Mode Description
0 General-purpose communication (no XON/XOFF mechanism)
5 Host Link Slave protocol
6 Host Link Master protocol
Example SETCOM(19200, 7, 2, 2, 1, 6)
This sets RS-232C port to 19200 baud rate, 7 data bits, 2 stop bits, even par-
ity for communication as a Host Link Master.
See also N/A
Type Mathematical function
Syntax SGN(expression)
Description The SGN function returns the sign of a number. It returns value 1 for positive
values (including 0) and value -1 for negative values.
Arguments expression
Any valid BASIC expression.
Example >> PRINT SGN(-1.2)
-1.0000
See also N/A
Type Mathematical function