RS V8849 Hoja De Instrucciones página 27

Tabla de contenido

Publicidad

Idiomas disponibles
  • ES

Idiomas disponibles

  • ESPAÑOL, página 12
—————————————————————————————————————
lcd
Output on the LCD
—————————————————————————————————————
Purpose:
Generate output on the LCD display
Syntax:
lcd lcdlist
where lcdlist is made up of expressions and strings separated by
commas.
Remarks:
An attempt to use a non-existent LCD display causes an error. The
strings may include the following control characters:
\f
clear the display
\r
go to beginning of current line
\n
go to next line
\b
go back one space
\t
go to next tab position (if possible)
Example:
lcd "\fX= ",x
—————————————————————————————————————
list
—————————————————————————————————————
Purpose:
Generate a list of part or all of the program currently in the control
board.
Syntax:
list
list n1,n2
Remarks:
This is useful to output a program to a PC for modification with a text
editor or for storage off the control board. The listing can be sent
back to the control board at a later date to reprogram it. Use with the
PC requires the user software disk.
Example:
list
// list the whole program
list 10,20
// list lines 10 to 20
—————————————————————————————————————
new
Command
—————————————————————————————————————
Purpose:
This erases the program and all variables.
Syntax:
new
Remarks:
This cleans out the control board ready for a new program.
It is not advisable to incorporate it in a program.
Example:
new
—————————————————————————————————————
nlist
List program with line numbers
—————————————————————————————————————
Purpose:
Generate a list of part or all of the program currently in the control
board together with line numbers.
Syntax:
nlist
nlist n1,n2
Remarks:
This is useful to view a section of program to see the origin of errors.
Example:
nlist
// list the whole program
nlist 10,20
// list lines 10 to 20
—————————————————————————————————————
print
Print output on controlling terminal
—————————————————————————————————————
Purpose:
Generate output over RS232 link to PC or terminal
Syntax:
print prlist
where prlist is made up of expressions and strings separated by
commas.
Remarks:
This command is of no use during program execution unless a
terminal or PC is connected.
The strings may include the following control characters:
\f
formfeed (^L)
\r
carriage return (^M)
\n
linefeed (^J)
\b
backspace (^H)
\t
tab (^I)
Example:
print "\fX= ",x
// display the value of x
—————————————————————————————————————
proc
Procedure definition
—————————————————————————————————————
Purpose:
To define a procedure for use in a program
Syntax:
proc name() {
...procedure statements using %1,%2 etc..
}
Remarks:
Defining a procedure does not cause its execution. A procedure does
not return a value. The arguments of a procedure (if any) are referred
to by the dummy variables %1,%2 etc:
Any variables defined outside the procedure are known to the
procedure. Any variables changed inside the procedure are changed
outside the procedure.
IF THE USER DEFINES A PROCEDURE CALLED autoexec() THIS
WILL BE RUN AUTOMATICALLY WHENEVER THE CONTROL
BOARD IS TURNED ON.
This allows the user to make "switch and run" programs.
Example:
proc turn_on() {
out(%1,1)
}
turn_on(2)
—————————————————————————————————————
return
Return from function
——————————————————————————————— ——————
See entry for function
—————————————————————————————————————
symbols
list user symbols
—————————————————————————————————————
Purpose:
To show what user variables, functions and procedures are defined
and to show the values of variables.
Syntax:
symbols
Remarks:
This intended for use during program development.
Example:
symbols
—————————————————————————————————————
while
—————————————————————————————————————
Purpose:
To repeatedly execute a program fragment while a condition remains
true.
Syntax:
while (expression) statement
Remarks:
The statement is repeatedly executed while the expression has a
// display the value of x
List program
// this only defines the procedure
// turn on output %1
// turns on output 2
Command
non-zero (true) value. The statement may often need to be a null
statement (see below).
Example:
i=0
while (i<3) {
i = i+1
print i," squared=",i*i,"\n"
}
while (NOTin(0)) {
}
BUILT IN FUNCTIONS
—————————————————————————————————————
arc()
—————————————————————————————————————
Purpose:
To start moving along an arc for profiling.
Syntax:
arc(xc,yc,angle)
arc(xc,yc,angle,n)
Remarks:
The arc() command waits until the motion is completed before
returning. The reason is that the arc is made up of many very short
straight lines, and the parameters for each line are only calculated
when the previous line is complete. This means that the command
returns just after calculating the last line in the arc, but each line
is so short that as far as the user is concerned it is returning at the
end of the arc. The first form "single steps" from the current position
about the position (xc,yc) through "angle" degrees. If angle is positive
the motion is anticlockwise and if the angle is negative the motion is
clockwise. The second form does not attempt to move on an exact
circle. It approximates the circle as a polygon of n sides (n>3).
This function returns 0 if the arguments were satisfactory,
1 if the CONTROL BOARD was already active
-1 if the arguments are faulty
Example:
move(100,0)
while(moving()){
}
arc(0,0,180)
See also:
moving()
—————————————————————————————————————
cmove()
Move at constant speed
—————————————————————————————————————
Purpose:
To start a move at the constant speed set by the cvel() function to the
specified position.
Syntax:
cmove(x,y)move to position x,y where x and y are in units of motor
steps
Remarks:
The cmove() command does not wait until the command is
completed before returning. This is because one might well want the
program to do something else while the motor is moving (ie:
sample the inputs). If a cmove command is issued while the motors
are already moving first the motors will halt and then the cmove
command will be executed.
cmove() will return
Example:
cmove(1000,1000)
See also:
moving(), cvel(), cmovel(), move(), movel()
—————————————————————————————————————
cmovel()
Move to limits at constant speed
—————————————————————————————————————
Purpose:
To start a move to the limits at the constant speed set by the cvel()
function.
Syntax:
cmovel(x,y) move to limits specify by sign and value of x and y
ie:
1 move to positive limit
0 do not move
-1 move to negative limit
Remarks:
The cmovel() command does not wait until the command is
completed before returning. This is because one might well want the
program to do something else while the motor is moving (ie: sample
the inputs).
If a cmovel command is issued while the motors are already moving
first the motors will halt and then the cmovel command will be
executed.
cmove() will return
Example:
cmovel(-1,-1)
See also:
moving(), cvel(), cmove(), move(), movel(), limit()
—————————————————————————————————————
cvel()
Set constant speed velocity
—————————————————————————————————————
Purpose:
To set the constant speed for the two axes in units of motor steps per
second.
Syntax:
cvel(u) sets the constant speed along the diagonal of a move in the
x and y direction
Remarks:
There are limits on the range of possible speeds which depend on
the type of motor used. The basic range is from 63 to 4000000 but
this is scaled by the prescale() command.
This function returns 0 if the arguments were satisfactory,
-1 if the arguments are faulty
Example:
cvel(100)
See also:
cmove(), cmovel(), prescale()
—————————————————————————————————————
datum()
—————————————————————————————————————
Purpose:
To force a value for the current position. No motion is involved.
Typically to make the current position the origin.
Syntax:
datum() set current position to be 0 on both axes
datum(axis) make position of specified axis 0
datum(axis,val) make position of specified axis val
Remarks:
It is important to understand that no motion is
involved. This command sets a new frame of
reference for position.
V8849
// start a multiline statement
// null statement.. wait for
// input #0 to switch on
Drawing an arc
// move to 100,100
// wait till move complete
// move over semicircle
0 if there was no error
1 if a previous move was active
-1 if the arguments are .....wrong
(there must be 2).
// move to 1000,1000
0 if there was no error
1 if a previous move was active
-1 if the arguments are wrong
(there must be 2).
// move to negative limits
Set datums
27

Publicidad

Tabla de contenido
loading

Tabla de contenido