![Sollae Systems PES-2403 User Manual Download Page 15](http://html1.mh-extra.com/html/sollae-systems/pes-2403/pes-2403_user-manual_1316208015.webp)
PES-2403 User Manual > How to use > Getting States
2017-07-28
Sollae Systems
page 15 of 26
Getting States
A command get is for getting states of a stepper motor.
Getting operation states
A command state is for getting an operation state of a stepper motor.
"get state"
Return values of this command are as follows:
value
state
0
stopped
1
control locked
otherwise
running
an example of getting states of a stepper motor
<?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 speed 400");
spc_request_dev($sid, "set accel 800");
spc_request_dev($sid, "set rsnc 120 250");
$state = 0;
spc_request_dev($sid, "move 400");
while($state = (int)spc_request_dev($sid, "get state"))
{
echo "state: $state\r\n";
usleep(200000);
}
echo "state: $state\r\n";
?>
the output example
state: 3
state: 2