![Sollae Systems PES-2403 Скачать руководство пользователя страница 18](http://html1.mh-extra.com/html/sollae-systems/pes-2403/pes-2403_user-manual_1316208018.webp)
PES-2403 User Manual > How to use > Controlling by goto
2017-07-28
Sollae Systems
page 18 of 26
Controlling by goto
A command goto is for controlling a stepper motor based on the initial position, not the current
position of the motor.
This method can be used even when the motor is running.
"goto [sign](pos) [speed] [accel] [decel]"
※ Caution: there is no space between [sign] and (pos)
Descriptions of the arguments are as follows:
argument
description
mandatory/optional
sign
direction, "+"(forward) or "-"(reverse)
optional(default: "+")
pos
target counter position
mandatory
speed
speed(unit: pps)
optional
accel
acceleration(unit: pps/s)
optional
decel
deceleration(unit: pps/s)
optional
The argument pos is based on the initial position, not the current position of the counter.
If the decel(deceleration) is omitted, it is automatically set to the same value of the acceleration.
an example of using goto
<?php
include_once "/lib/sd_spc.php";
spc_reset();
spc_sync_baud(460800);
$sid = 1;
spc_request_dev($sid, "set mode full");
spc_request_dev($sid, "set vref stop 2");
spc_request_dev($sid, "set vref drive 8");
spc_request_dev($sid, "set rsnc 120 250");
spc_request_dev($sid, "set pos -400");
spc_request_dev($sid, "goto +400 200 0");
sleep(1);
spc_request_dev($sid, "goto -400 200 0");
sleep(1);
spc_request_dev($sid, "goto +400 200 0");
while((int)spc_request_dev($sid, "get state"))
usleep(1);
?>
※ This command can be used even when stepper motor is in operation. Therefore, if a new goto
command is executed while the motor is running, it is executed immediately.