In (input variable), General – Yaskawa LEGEND-MC User Manual

Page 144

Advertising
background image

134

LEGEND-MC User’s Manual

IN (Input Variable)

[General]

DESCRIPTION:

The IN command allows a variable to be input from the serial port or Ethernet. An optional prompt message
can be displayed. The variable value must be followed by a carriage return. The entered value is assigned to
the specified variable name.

The IN command holds up execution of following commands in the program thread until a carriage return or
semicolon is entered. If no value is given prior to a semicolon or carriage return, the previous variable value
is kept. Input Interrupts, Error Interrupts and Limit Switch Interrupts will still be active.

ARGUMENTS: IN{P1} ”m” , n {So}

where

"m" is the prompt message. May be letters, numbers, or symbols up to maximum line length and must be
placed in quotations.

n is the name of variable to store the new value in.

{P1} specifies the port, if omitted, the default port is assumed.

{So} specifies string data where o is the number of characters from 1 to 6

NOTE 1: The IN command defaults to {P1}, and must only be used with the serial port.
NOTE 2: IN command can only be used in thread 0.

USAGE:

EXAMPLES: Operator specifies material length in inches and speed in inches/sec (2 pitch lead screw, 2000 counts/rev
encoder).

While Moving

Yes

Default Value

In a Program

Yes

Default Format

Position Format

Command Line

No

Can be Interrogated

No

Used as an Operand

No

Distributed Control

No, Local

#A

Program A

CI -1

Clear Input Buffer

IN "Enter Speed (in/sec)",V1

Prompt operator for speed

IN "Enter Length(in)",V2

Prompt for length

V3=V1*4000

Convert units to counts/sec

V4=V2*4000

Convert units to counts

SP V3

Speed command

PR V4

Position command

BGX;AMX

Begin motion; Wait for motion complete

MG "MOVE DONE"

Print Message

EN

End Program

Advertising