General-Purpose - Omron R88A-MCW151-DRT-E Operation Manual

Mcw151 series motion control option board
Table of Contents

Advertisement

Serial Communications
Example:
4-1-3

General-purpose

Example:
Consider a MCW151-E connected to the NT11S Programmable Terminal
using port 2 (RS-422A). The Host Link Slave can be configured by using the
following program:
' Define Host Link Slave node
HLS_NODE = 15
' Define Host Link Slave model code
HLS_MODEL = $FA
' Set up Host Link Slave for port 2
SETCOM(9600,7,2,2,2,5)
The MC Unit is now set up to communicate with the Programmable Terminal.
The MCW151 provide a set of commands to implement any user-defined pro-
tocol. The list of commands is provided here.
BASIC Command
SETCOM
GET
INPUT
KEY
LINPUT
PRINT
Refer to SECTION 6 BASIC Motion Control Programming Language for fur-
ther details on the commands.
Consider a MCW151-E connected to a general-purpose device using port 2
(RS-422A). The following problem will receive a series of data elements and
write it to VR variables:
' Set up General-purpose protocol for port 2
SETCOM(9600,7,2,2,2,0)
' Receive input
FOR i=0 to 99
INPUT#2, VR(i)
NEXT i
Description
SETCOM configures the serial communication port,
including enabling the Host Link protocols.
GET assigns the ASCII code of a received charac-
ter to a variable.
INPUT will assign numerical input string values to
the specified variables.
KEY returns TRUE or FALSE depending on if a
character has been received.
LINPUT assigns the ASCII code of the characters to
an array of variables.
PRINT outputs a series of characters to a serial
port.
Section 4-1
67

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

R88a-mcw151-e

Table of Contents