Parker Products OPS1200 user manual Open a device, PRINT, INPUT, Close

Page 18

OPEN

Open a device

Format:

OPEN "device string" AS #device

Group:

Character I/O

See also:

PRINT, INPUT, CLOSE

This command opens a device. The valid range for "device" is 0 to 3. Each program has it's own device #0 which is used as its default device. Devices #1 through #3 are board-wide system resources that can be opened and used from within any program or from any system or program prompt.

The "device string" describes the device that is to be opened. Serial device strings contain information required to set up communications. Valid device strings are:

"FIFO:"

"COM1:baudrate,parity,databits,stopbits"

"COM2:baudrate,parity,databits,stopbits"

"OPS:" (Valid only when using an OPS1200 Display and Keyboard)

baudrate

= 300,600,1200,2400,9600,19200,38400

parity = N,E,O

databits

=

5,6,7,8

stopbits

=

1,2

When a device is opened, the operating system attached to that device enters an idle state, allowing incoming characters to be used by a program instead of being interpreted as commands. When the device is closed, the device will enter its auto- detect mode as if it were starting from power-up.

Usage example:

10 OPEN "COM1:9600,N,8,1" AS #1

20 PRINT #1, "Hello world!"

30 CLOSE #1

12

OPS1200 User’s Manual

Image 18
Contents OPS1200 User’s Manual This page intentionally left blank Change Notice OPS1200 User’s Manual Table of Contents Tables FiguresIntroduction This page intentionally left blank Chapter OPS1200 Display and Keyboard Display OPS1200 LCD Screen Worksheet OPS1200 Displayable Character Set on the LCD Screen Keyboard OPS1200 Keyboard KEY Codes This page intentionally left blank Chapter OPS1200 Firmware Command SET Open Open a devicePRINT, INPUT, Close Clear the LCD screen CLSOpen Contrast Sets up the display viewing contrastTimeout OPS1200 Display and Keyboard Only Sets up the character input timeout valueHpos Move the horizontal cursor positionVPOS, Open Vpos Move the vertical cursor positionHPOS, Open Sets up the keypad for subroutines On Menu GotoOn Menu Goto Sets up the keypad for Goto statementOn Menu Gosub This page intentionally left blank Chapter OPS1200 Hardware Interconnection OPS1200 Interconnect Wiring Encoder Inputs P1 Usage PinAnalog Inputs/Outputs P2 Definition PinDigital Inputs / Outputs P3 Communications P5 Power InputI/O PWR Input PWR InputPower Plug Power Input Power InputXP3-Digital Outputs Auxiliary Digital Inputs / Outputs XP3 / XP4XP4 -- Digital Inputs Digital Inputs / OutputsChapter OPS1200 Technical Specification Technical Specification Chapter OPS1200 Mechanical Drawings 10.3 Cutout Size 10.7 x