CANStepper boards with firmware 1.18 or newer (current: 1.20) understand plain text commands on
their USB port. LabVIEW talks to the board the way it talks to a lab
instrument: open the COM port with NI-VISA, write a command such as ON or
MOVE:ABS 1,90, read the reply.
You need only LabVIEW + NI-VISA and a USB cable. There are no drivers to install, no Python, and no background program to run.
LabVIEW / TestStand ──NI-VISA (USB COM port)──► CANStepper ══CAN bus══► more CANStepper boardsWhat you need
| Item | Notes |
|---|---|
| CANStepper NEMA 17 board with firmware 1.18 or newer (1.20 recommended) | Check with *IDN? (below). Older boards: install firmware 1.20 or use the Python gateway |
| 5–24 V power supply (typically 24 V) | USB-C carries data only; the board and motor need the main supply |
| USB-C cable to the PC | Windows shows the board as USB Serial Device (COMx) |
| LabVIEW with NI-VISA | Any recent LabVIEW. In the NI installer, NI-VISA is the only driver you need |
Downloads
| File | Use |
|---|---|
| GrafitoCANStepper_C3_fw1.20.bin | Ready-built firmware 1.20 (app image). Flash at 0x10000 without compiling; also the CAN OTA image |
| boot_app0.bin | Flash at 0xE000 together with the .bin so the board boots the new image |
| GrafitoCANStepper_C3.ino | Firmware 1.20 source (Arduino sketch) |
| scpi.h | Required header, the SCPI command layer. Put it in the same folder as the .ino |
| canstepper-scpi-gateway.zip | Only for boards on firmware 1.17 or older: PC gateway (Python 3.9+) that adds the same commands. See "Older firmware" below |
| CANStepper_Query.vi | LabVIEW 2026 starter VI: sends one command, shows the reply. Set VISA resource to your COM port |
Quick start (5 minutes)
1. Connect. Power the board, then plug in USB. Open Device Manager →
Ports (COM & LPT) and note the number in USB Serial Device (COM3). In
VISA that port is called ASRL3::INSTR.
2. Say hello (optional, no programming). Open NI MAX → Devices and
Interfaces → ASRL3 → Open VISA Test Panel. Under Configuration → I/O
Settings, tick Enable Termination Character (Line Feed \n). On the
Input/Output tab, write *IDN?\n and read. You should see:
Grafito,CANStepper NEMA17,NODE1,1.203. Run the starter VI. Open CANStepper_Query.vi. Set VISA resource
to ASRL3::INSTR (your port), type a command and press Run (Ctrl+R):
| Send | Reply | Note | |
|---|---|---|---|
| ON | OK | the motor starts turning at 90°/s | |
| OFF | OK | the motor ramps down and stops | |
| ENAB 1,1;MOVE:REL 1,90;MOVE:WAIT? 1,1.5;POS? 1 | OK;OK;DONE;90.02 | turns 90°, waits, reports the position |
The starter VI is shipped pointing at TCPIP0::127.0.0.1::5025::SOCKET (an
older setup). Change VISA resource to your COM port, then right-click it →
Data Operations → Make Current Value Default and save.
Build your own VI
Every command answers with exactly one line, so every VI follows the same pattern: write a line, read a line.
VISA Open (ASRL3::INSTR)
→ Property Node: Message Based Settings → Termination Character Enable = True
→ VISA Write "*CLS\n" → Wait (ms) 50 → VISA Flush I/O Buffer (mask 16) ← start-up step, once
→ VISA Write "<command>\n" → VISA Read (byte count 1024) → reply ← repeat as needed
VISA Close → Simple Error Handler- End every command with a line feed (
\n). In LabVIEW, use Concatenate Strings with a Line Feed Constant. - The start-up step clears out anything left in the port by another program, for example a Python tool. It does nothing harmful on a freshly powered board.
- Opening the port does not restart the board, so a VI can open and close the port as often as it likes.
- Timeout: set the VISA timeout longer than any wait you ask for. For
example, use 15 s if you send
MOVE:WAIT? 1,10. - Keep the session open in a loop for operator panels; open-write-read-close is fine for single commands.
Commissioning a motor, step by step
Do this once for every new motor, with the axis free to move. Send each line
from NI MAX's VISA Test Panel or the starter VI. The replies shown are what a
healthy board returns. The copy button next to a command copies only the
command, never the reply. Paste one line per run into the starter VI, and
keep any MOVE:WAIT? time shorter than the VI's VISA timeout (2 s by default).
Step 1: Mechanics and wiring
- Mount the board on the back of the motor. The round magnet on the motor shaft must sit centred over the board's encoder chip, with about 1–2 mm air gap.
- Connect the motor's four wires to the board.
- Several boards: daisy-chain CANH, CANL and GND from board to board. Only the two boards at the ends of the chain keep their 120 Ω termination. On boards in the middle, remove the 0 Ω termination jumper. See Hardware → CAN bus rules.
- Endstop (optional): wire it to IO8 as shown in Hardware → Endstop wiring. IO8 must not be held low while the board powers up.
Step 2: Power up and connect
- Switch on the 5–24 V supply first (typically 24 V), then plug in USB.
- In Device Manager, note the COM number. In VISA the port is
ASRL<n>::INSTR. - Every board starts with the motor unpowered. The shaft turns freely
until you send
ENAB.
Step 3: Identify the board
| Send | Reply | |
|---|---|---|
| *IDN? | Grafito,CANStepper NEMA17,NODE1,1.20 | |
| SYST:ERR? | 0,"No error" |
No reply to *IDN? means the board has firmware 1.17 or older.
Install firmware 1.20 or use the
Python gateway.
Step 4: Give each board its own node ID (only if you use several boards)
Boards are node 1 unless they were numbered before. Two boards with the same
ID on one CAN bus clash, so give every board its own ID. Firmware 1.20 does this
with one command, SYST:NODE. The new ID is saved at once and kept after
power-off and firmware updates.
The board on USB:
| Send | Reply | Note | |
|---|---|---|---|
| SYST:NODE? | 1 | ID of the board on USB | |
| SYST:NODE 2 | OK | this board only; nothing is sent on the CAN bus | |
| *IDN? | Grafito,CANStepper NEMA17,NODE2,1.20 |
A board further down the CAN cable: give its current ID, then the new one.
| Send | Reply | Note | |
|---|---|---|---|
| SYST:NOD? | 1,2 | ||
| SYST:NODE 1,3 | OK | node 1 on the bus becomes node 3 | |
| SYST:NOD? | 2,3 |
Only the board on USB needs firmware 1.20; the board being renumbered over the cable can run any CANStepper firmware.
Several new boards (all still node 1): renumber the board on USB first
(SYST:NODE 2), then add the new boards to the cable one at a time, each
followed by SYST:NODE 1,<new ID>:
| Send | Reply | Note | |
|---|---|---|---|
| SYST:NODE 2 | OK | board on USB | |
| …connect the next new board, then: | |||
| SYST:NODE 1,3 | OK | ||
| …connect the next new board, then: | |||
| SYST:NODE 1,4 | OK | ||
| SYST:NOD? | 2,3,4 | ||
SYST:NODE refuses instead of guessing:
| Reply | Meaning |
|---|---|
ERROR 209,"Node 3 already on the bus" | The new ID is in use. Pick another one |
ERROR 201,"Node 1 not responding" | No board has the old ID. Check SYST:NOD? |
ERROR 210,"Two boards answer as node 1…" | Two boards share the old ID. Unplug one, or connect each one by USB and use SYST:NODE <new> |
ERROR 211,"Node 1 is moving…" | Stop the motor first |
To check whether another board on the cable uses the same ID as the board on
USB, send SYST:NODE:DUP?: 0 is fine, 1 means a clash. SYST:NODE <new>
then fixes it, because it changes only the board on USB.
Write the ID on a label on the motor. From now on, use that number in every
command (ENAB 2,1, POS? 2 …).
Boards on firmware 1.18 or 1.19
These do not have SYST:NODE. Plug in one board at a time, with the CAN
cable unplugged, and send these two lines exactly as shown. They are raw bus
frames, not SCPI, and assume the board is currently node 1.
Unplug the CAN cable first
The board on USB also sends these lines out on the CAN bus. Every board on the
bus with the same old ID changes its ID and saves it too, so two boards end
up with the same new ID. Their frames then collide and the bus reports
errors. Check with SYST:NOD? before you start: it must list only the board
on USB.
| New ID | Line 1 | Line 2 |
|---|---|---|
| 2 | 49 0 0102000000 | 8B 0 |
| 3 | 49 0 0103000000 | CB 0 |
| 4 | 49 0 0104000000 | 10B 0 |
| 5 | 49 0 0105000000 | 14B 0 |
| 6 | 49 0 0106000000 | 18B 0 |
| 7 | 49 0 0107000000 | 1CB 0 |
| 8 | 49 0 0108000000 | 20B 0 |
| 9 | 49 0 0109000000 | 24B 0 |
| 10 | 49 0 010A000000 | 28B 0 |
Line 1 changes the ID and line 2 saves it. Then send *CLS, wait a moment,
flush the read buffer, and check with *IDN?.
Step 5: Health check (motor still unpowered)
| Send | Reply | Note | |
|---|---|---|---|
| STAT? 1 | 0,0,0,0,x,0,1,0,0 | 7th value 1 = encoder OK, 4th 0 = no e-stop, last 0 = no fault | |
| STAT:DRIV? 1 | 1,0,0,0,0,… | first value 1 = driver chip answers | |
| ALAR? 1 | 0,NONE | ||
| POS? 1 | 104.502 | turn the shaft by hand, ask again: the number must change | |
| STAT:TEMP? 1 | 38.3 | board temperature, °C |
If the encoder value does not change when you turn the shaft, check the magnet (step 1) before going on.
Step 6: Set the motor current
| Send | Reply | Note | |
|---|---|---|---|
| CONF:CURR:RUN 1,30 | OK | percent of the driver's maximum; start low | |
| CONF:CURR:HOLD 1,5 | OK | current while standing still |
Start around 20–40 % and raise it only if the motor loses steps or cannot move its load. Above about 40 %, fit the driver heatsink. See Hardware → Cooling.
Step 7: First move and direction
| Send | Reply | Note | |
|---|---|---|---|
| ENAB 1,1 | OK | ||
| MOVE:REL 1,10 | OK | ||
| MOVE:WAIT? 1,5 | DONE | ||
| POS? 1 | 10° more than before |
Watch which way the shaft turned. If positive moves should go the other way:
| Send | Reply | Note | |
|---|---|---|---|
| CONF:DIR 1,1 | OK | send CONF:DIR 1,0 to undo |
Step 8: Speed and acceleration
| Send | Reply | Note | |
|---|---|---|---|
| CONF:SPE 1,180 | OK | °/s, start gently | |
| CONF:ACC 1,720 | OK | °/s², deceleration is the same | |
| MOVE:REL 1,360 | OK | ||
| MOVE:WAIT? 1,10 | DONE | ||
| POS:ERR? 1 | 0.04 | should be well under 0.35° |
Raise speed and acceleration in steps until the motion looks right for the
machine, repeating the 360° move each time. If MOVE:WAIT? reports
FAULT,2,NO_PROGRESS, the motor cannot keep up. Lower the speed or
acceleration, or raise the current.
Step 9: Units for a linear axis (optional)
| Send | Reply | Note | |
|---|---|---|---|
| CONF:UNIT 1,MM,8 | OK | 8 = millimetres travelled per motor turn | |
| MOVE:ABS 1,25 | OK | now in mm |
Speeds become mm/s and accelerations mm/s².
Step 10: Home position
With an endstop switch:
| Send | Reply | Note | |
|---|---|---|---|
| CONF:HOM 1,0,2,30 | OK | keep run current, back off 2 units, give up after 30 s | |
| HOME 1,ENDS,-1,20 | OK | towards the switch at 20 units/s; use 1 for the other direction | |
| MOVE:WAIT? 1,35 | DONE | ||
| HOME? 1 | 1 |
Press the switch by hand first and check STAT? 1: the 5th value must be
0 when released and 1 when pressed. If it is 1 with the switch released (or
with no switch wired), the polarity is wrong: a released switch that leaves IO8
high needs CONF:ENDS 1,1,0,1 (active-low). Since firmware 1.19, HOME 1,ENDS
refuses to start while the switch reads pressed and answers
ERROR 208,"Node 1 endstop active: …", so a wrong setting can no longer report
a false home. The endstop settings are reset at every power-up, so send
CONF:ENDS in your start-up block.
Without a switch, move the axis to its reference point and send HOME 1,ZERO.
Sensorless homing (no switch, axis runs into a hard stop):
| Send | Reply | Note | |
|---|---|---|---|
| CONF:STAL 1,10 | OK | stall threshold; higher = more sensitive | |
| HOME 1,STAL,-1,90 | OK | at least 60°/s; slower is refused with ERROR -222 | |
| MOVE:WAIT? 1,35 | DONE |
The driver's stall sensor only works at speed: below about 45°/s it reports a
stall even on a free shaft. Firmware 1.19 therefore uses at least 60°/s
(default 90°/s) and ignores the start-up ramp. Check it on your machine: with
the axis free, HOME 1,STAL,1,90 with a short timeout must end in
HOMING_FAILED,2,HOMING_TIMEOUT, not DONE.
Step 11: Short endurance run
Repeat a typical move ten times, then check that nothing complained:
| Send | Reply | Note | |
|---|---|---|---|
| MOVE:ABS 1,360;MOVE:WAIT? 1,10 | OK;DONE | ||
| MOVE:ABS 1,0;MOVE:WAIT? 1,10 | OK;DONE | ||
| … (×10) | |||
| ALAR? 1 | 0,NONE | ||
| STAT:DRIV? 1 | 1,0,0,0,0,… | 2nd value 1 would mean "driver getting hot" | |
| STAT:TEMP? 1 | compare with step 5: it should level off, not keep climbing | ||
Step 12: Save, and know what to set at every start
| Send | Reply | |
|---|---|---|
| CONF:SAVE 1 | OK |
The board keeps most settings after power-off, but for safety it re-applies a few defaults at every switch-on:
Kept after power-off (after CONF:SAVE) | Set again by your program at every start |
|---|---|
| Node ID, speed, acceleration, microstepping, direction, PID gains, homing settings, closed loop on/off | Run current above 40 % (capped to 40 % at power-up) and hold current above 5 % |
| Endstop settings (reset to enabled, active-high, stop-on-hit) | |
Units (CONF:UNIT) | |
Motor power: always off at power-up, so send ENAB n,1 |
A good start-up block for any test program:
| Send | Reply | Note | |
|---|---|---|---|
| *CLS | then wait 50 ms and flush the read buffer | ||
| *IDN? | check NODE and firmware | ||
| CONF:CURR:RUN 1,60 | only if you need more than 40 % | ||
| CONF:UNIT 1,MM,8 | only for linear axes | ||
| CONF:ENDS 1,1,0,1 | only if your switch is active-low, see step 10 | ||
| ALAR:CLE 1 | OK | clears a leftover e-stop | |
| ENAB 1,1 | OK | ||
| HOME 1,ENDS,-1,20 | OK | ||
| MOVE:WAIT? 1,35 | DONE |
Commands
Commands are not case-sensitive. Words can be shortened to their capital
letters (CONFigure:SPEed → CONF:SPE), and several commands can share one
line separated by ;. The first number in most commands is the motor's node
ID (1 for a single board). Positions are in degrees unless you change the
unit.
Connection
| Command | Reply | Meaning |
|---|---|---|
*IDN? | Grafito,CANStepper NEMA17,NODE1,1.20 | Who is connected, node ID, firmware |
SYST:NOD? | 1,2,3 | All motors found on the CAN bus |
SYST:NODE? | 1 | Node ID of the board on USB |
SYST:NODE 2 | OK | Give the board on USB node ID 2 (saved; fw 1.20) |
SYST:NODE 1,3 | OK | Give the board that is node 1 on the CAN bus node ID 3 (saved; fw 1.20) |
SYST:NODE:DUP? | 0 | 1 if another board on the bus uses the USB board's ID |
SYST:ERR? | 0,"No error" | Next error message, if any |
Run, stop and move
| Command | Meaning |
|---|---|
ON · ON 1,180 · ON 1,-90 | Start turning (default 90°/s) · faster · reverse |
OFF | Ramp down and stop (motor holds its position) |
ENAB 1,1 / ENAB 1,0 | Power the motor / release it (shaft turns freely) |
MOVE:ABS 1,90 | Go to 90° |
MOVE:REL 1,-45 | Move 45° backwards from where it is |
MOVE:WAIT? 1,10 | Wait up to 10 s for the move to finish, then answer DONE |
JOG 1,30 / JOG 1,0 | Turn at 30°/s / stop |
HOME 1,ENDS,-1,20 | Home onto the endstop switch, moving backwards at 20°/s |
HOME 1,ZERO | Call the current position zero |
STOP 1 | Controlled stop |
ESTOP:ALL | Emergency stop, every motor. Power is cut and stays off until cleared |
Settings
| Command | Meaning |
|---|---|
CONF:SPE 1,360 | Top speed 360°/s |
CONF:ACC 1,1440 | Acceleration 1440°/s² (deceleration is always the same value) |
CONF:MICR 1,16 | Microstepping 1–256 (powers of two) |
CONF:CURR:RUN 1,40 | Motor current 40 % |
CONF:UNIT 1,MM,8 | Work in millimetres on an 8 mm-per-turn lead screw (DEG, REV also possible) |
CONF:SAVE 1 | Keep the settings after power-off |
Add ? to read a setting back, e.g. CONF:SPE? 1 → 360.
Status
| Command | Reply example | Meaning |
|---|---|---|
POS? 1 | 89.934 | Real shaft position from the built-in encoder |
VEL? 1 | 92.15 | Speed |
ON? | 1 | Is the motor turning? |
STAT? 1 | 1,0,0,0,1,0,1,0,0 | powered, moving, homed, e-stop, endstop, stall, encoder OK, mode, fault |
ALAR? 1 | 0,NONE | Most important active alarm |
STAT:TEMP? 1 | 42.3 | Board temperature, °C |
Recipes for common operations
Each block is a sequence of Write → Read steps. Replace 1 with your motor's
node ID.
Turn continuously, change speed, reverse, stop
| Send | Reply | Note | |
|---|---|---|---|
| ON 1,60 | OK | 60 °/s; powers the motor if needed | |
| ON 1,180 | OK | speed change while running | |
| ON 1,-90 | OK | reverse | |
| OFF 1 | OK | ramped stop, motor holds position | |
| MOVE:WAIT? 1,5 | STOPPED |
Go to a position and check it
| Send | Reply | |
|---|---|---|
| ENAB 1,1 | OK | |
| MOVE:ABS 1,270 | OK | |
| MOVE:WAIT? 1,10 | DONE | |
| POS? 1 | 269.96 | |
| POS:ERR? 1 | 0.04 |
Index in fixed steps (e.g. 8 stations of 45°; repeat the block 8 times)
| Send | Reply | |
|---|---|---|
| MOVE:REL 1,45;MOVE:WAIT? 1,10;POS? 1 | OK;DONE;45.02 |
Back-and-forth cycling (repeat; count cycles in your loop)
| Send | Reply | |
|---|---|---|
| MOVE:ABS 1,180;MOVE:WAIT? 1,10 | OK;DONE | |
| MOVE:ABS 1,0;MOVE:WAIT? 1,10 | OK;DONE |
Linear axis in millimetres (lead screw 8 mm per turn)
| Send | Reply | Note | |
|---|---|---|---|
| CONF:UNIT 1,MM,8 | OK | ||
| CONF:SPE 1,20 | OK | 20 mm/s | |
| HOME 1,ENDS,-1,5 | OK | ||
| MOVE:WAIT? 1,60 | DONE | ||
| MOVE:ABS 1,100 | OK | 100 mm from home | |
| MOVE:WAIT? 1,15 | DONE |
Jog buttons on a front panel: on button press send JOG 1,30 (or
JOG 1,-30); on release send JOG 1,0.
Move several motors at the same time
| Send | Reply | Note | |
|---|---|---|---|
| MOVE:ABS 1,90 | OK | all moves start immediately, one after another | |
| MOVE:ABS 2,90 | OK | ||
| MOVE:WAIT? 1,10 | DONE | then wait for each | |
| MOVE:WAIT? 2,10 | DONE |
Data logging loop (e.g. every 100 ms while a move runs)
| Send | Reply | Note | |
|---|---|---|---|
| POS? 1;VEL? 1;POS:ERR? 1;STAT:TEMP? 1 | 45.2;89.7;0.31;41.8 | ||
| MOVE:DONE? 1 | 0 | 1 when the move has finished |
Emergency stop and recovery
| Send | Reply | Note | |
|---|---|---|---|
| ESTOP:ALL | OK | every motor stops, power cut, latched | |
| ALAR? 1 | 10,ESTOP_LATCHED | ||
| … make the machine safe … | |||
| ALAR:CLE 1 | OK | repeat for every node | |
| ENAB 1,1 | OK | ||
Adjust by hand, then define the position
| Send | Reply | Note | |
|---|---|---|---|
| ENAB 1,0 | OK | shaft turns freely | |
| … move the axis by hand … | |||
| ENAB 1,1 | OK | ||
| POS:SET 1,0 | OK | this spot is now 0; nothing moves | |
Back to factory settings (keeps the node ID)
| Send | Reply | |
|---|---|---|
| CONF:DEF 1 | OK |
Replies you will see
| Reply | Meaning |
|---|---|
OK | Command accepted |
a value, e.g. 90.02 | Answer to a question (?) |
ERROR <code>,"<text>" | Something was wrong; the text says what (table below) |
MOVE:WAIT? answers with one of:
| Reply | Meaning |
|---|---|
DONE | The move finished at its target |
STOPPED | Stopped by STOP / OFF / JOG 1,0 |
ENDSTOP | The endstop switch was hit and stopped the motor |
ESTOP | An emergency stop happened |
FAULT,2,NO_PROGRESS | The motor could not reach the target (jammed or overloaded) |
HOMING_FAILED,1,HOMING_TIMEOUT | Homing did not find the switch (or stall) in time. 1 = endstop, 2 = sensorless |
HOMING_FAILED,1,HOMING_SWITCH_ACTIVE | Homing refused: the switch already read pressed (sent by older hosts; the SCPI command itself answers ERROR 208) |
TIMEOUT | Still moving when your wait ran out. Wait again, or send STOP 1 |
Example: automated test sequence
| Send | Reply | Note | |
|---|---|---|---|
| *IDN? | Grafito,CANStepper NEMA17,NODE1,1.20 | ||
| CONF:SPE 1,180 | OK | ||
| CONF:ACC 1,720 | OK | ||
| ENAB 1,1 | OK | ||
| HOME 1,ZERO | OK | ||
| MOVE:ABS 1,90 | OK | ||
| MOVE:WAIT? 1,10 | DONE | ||
| POS? 1 | 89.934 | log it, compare with limits | |
| MOVE:ABS 1,0 | OK | ||
| MOVE:WAIT? 1,10 | DONE | ||
| ALAR? 1 | 0,NONE | ||
| OFF | OK | clean-up: always run, also after an error | |
| ENAB 1,0 | OK |
In LabVIEW, build it as a state machine (Init → Configure → Test → Cleanup), passing the error cluster through every step. Each line above is one Write + Read. In TestStand, each line is one step.
Alarms and recovery
ALAR? 1 shows the most important alarm; ALAR:LIST? 1 shows all of them.
Most alarms are cleared with ALAR:CLE 1, which stops the motor and powers
it back on.
| Alarm | What it means | What to do |
|---|---|---|
10,ESTOP_LATCHED | An emergency stop was sent | Make it safe, then ALAR:CLE 1 |
2,NO_PROGRESS | The motor could not follow the move | Remove the obstruction, ALAR:CLE 1, move again |
4,DRIVER_OVERTEMP | The driver chip got too hot | Let it cool, lower the current or add a heatsink, ALAR:CLE 1 |
5,DRIVER_SHORT | Short in the motor wiring | Check the wiring first, then ALAR:CLE 1 |
1,ENCODER / 12,ENCODER_SIGNAL | Position sensor problem | Check the magnet on the motor shaft, then home again |
3,HOMING_TIMEOUT | Homing did not find the switch | Check the switch wiring and direction, ALAR:CLE 1, home again |
6,HOMING_SWITCH_ACTIVE | Homing refused: switch already pressed (fw 1.19) | Move off the switch, or fix the polarity with CONF:ENDS, then ALAR:CLE 1 |
11,STALL | Stall detected | Clear, then home again |
Error codes
| Code | Meaning | Fix |
|---|---|---|
202 | Motor not powered | Send ENAB 1,1. Boards start unpowered after switch-on |
203 | Emergency stop is active | ALAR:CLE 1 |
201 | A motor on the CAN bus did not answer | Check its power, CAN wiring and node ID |
204 | The board refused a setting | Value outside the allowed range |
207 | An alarm is still active after clearing | See Alarms |
208 | Endstop homing refused: the switch already reads pressed | Move off the switch, or fix the polarity: CONF:ENDS 1,1,0,1 for a switch that leaves IO8 high when released |
209 | SYST:NODE: the new ID is already in use | Pick a free ID (SYST:NOD?) |
210 | SYST:NODE: two boards answer on the old ID | Unplug one, or renumber each over its own USB with SYST:NODE <new> |
211 | SYST:NODE: the motor is moving | STOP, then retry |
-113 | Unknown command | Check the spelling. SYST:NODE needs firmware 1.20 |
-109 / -108 | Too few / too many values | Check the command format |
-222 / -224 | Value out of range / not allowed | e.g. node ID must be 1–31 |
Several motors on one cable
Connect the PC to one board. Every other board on the same CAN bus is reached through it by its node ID:
| Send | Reply | Note | |
|---|---|---|---|
| SYST:NOD? | 1,2,3 | ||
| ENAB 2,1 | OK | ||
| MOVE:ABS 2,180 | OK | ||
| POS? 3 | 12.5 | ||
| ESTOP:ALL | OK | all motors |
ON and OFF without a number act on the board the USB cable is plugged
into. Every board needs its own node ID: see
Step 4.
Install firmware 1.20
Boards already on 1.20 need nothing; check with *IDN?. Boards on 1.18 or 1.19
work with every command on this page except SYST:NODE, but should be updated:
1.19 makes homing safe (see Step 10) and 1.20 adds
SYST:NODE (see Step 4). To update a board,
connect the main power supply, plug in USB and close LabVIEW, NI MAX and any
other program using the COM port.
Option A: Arduino IDE (from source). Download GrafitoCANStepper_C3.ino
and scpi.h into a folder named GrafitoCANStepper_C3. In the Arduino
IDE install the esp32 boards package and the libraries FastAccelStepper
and TMC2209. Choose board ESP32C3 Dev Module with USB CDC On Boot:
Enabled, then click Upload. Full details: Flashing firmware.
Option B: ready-built file, no compiling. Use Espressif's browser flasher ESP Tool in Chrome or Edge. Connect at 115200 baud, then program both files in one go:
| Flash address | File |
|---|---|
0xE000 | boot_app0.bin |
0x10000 | GrafitoCANStepper_C3_fw1.20.bin |
Do not erase the flash first. The board keeps its node ID and tuning.
Unplug and replug USB afterwards, then check *IDN?.
Boards further down the CAN bus can also be updated over the bus itself with
the same .bin. See Flashing → CAN OTA.
Older firmware: Python gateway
Boards on firmware 1.17 or older do not understand text commands
themselves. *IDN? gets no reply, and VISA Read times out. You can either
install firmware 1.20, which is recommended, or run the
small SCPI gateway program on the PC. The gateway accepts exactly the same
commands, so your LabVIEW program stays the same; only the VISA resource
changes.
LabVIEW ──VISA TCP (TCPIP0::127.0.0.1::5025::SOCKET)──► gateway on the PC ──USB COM port──► boardSet it up (Windows):
- Install Python 3.9 or newer from python.org. In the installer, tick "Add python.exe to PATH".
- Download
canstepper-scpi-gateway.zipfrom Downloads and unzip it anywhere. - Double-click
start_gateway.bat. The first run installs the library, which takes about 10 seconds. - Type the board's COM port when asked (e.g.
COM3) and press Enter. The window showsVISA resource: TCPIP0::127.0.0.1::5025::SOCKET. - Leave that window open while LabVIEW runs. Closing it stops the gateway.
In LabVIEW:
| Setting | Value |
|---|---|
| VISA resource | TCPIP0::127.0.0.1::5025::SOCKET |
| Termination character | \n, enabled, as for the COM port |
Start-up step (*CLS, wait, flush) | Not needed. It does no harm if left in |
Check it:
| Send | Reply | |
|---|---|---|
| *IDN? | Grafito,CANStepper SCPI Gateway,COM3,1.0/canstepper-0.2.1 | |
| ON | OK | |
| OFF | OK |
Differences to firmware 1.20:
-
SYST:NODEneeds the old and the new ID (SYST:NODE 1,3);SYST:NODE?andSYST:NODE:DUP?are firmware only. -
*IDN?names the gateway and COM port instead of the board. -
ON/OFFwithout a number act on node 1. -
The gateway holds the COM port. Close it before flashing the board or opening the port in NI MAX.
-
Try it without hardware:
python -m canstepper.scpi --sim 1,2,3 --ackin the unzipped folder, after the first run ofstart_gateway.bat. -
For test stands with one long LabVIEW session, start it with
--stop-on-disconnect, so the motors stop if LabVIEW is closed or crashes:python -m canstepper.scpi --serial COM3 --ack --stop-on-disconnect.
Tips and troubleshooting
| Problem | Fix |
|---|---|
VISA Open error -1073807343 | Wrong VISA resource. Use ASRL<n>::INSTR with your COM number |
| VISA Read times out | Check the termination character is enabled and you send \n. No reply to *IDN? at all means old firmware: install 1.20 or use the gateway |
Gateway: VISA Open fails on TCPIP0::… | The gateway window is not running, or was started with a wrong COM port |
A motor answers only sometimes, SYST:NOD? misses a board, or moves go to the wrong motor | Two boards share an ID. SYST:NODE:DUP? checks the board on USB; see Step 4 |
First reply looks like 61 0 0000… | Leftover data from another program. Add the start-up step (*CLS, wait, flush) |
ERROR 202 on every move | The motor is not powered: ENAB 1,1 |
| COM port missing or busy | Main supply on? Another program (NI MAX panel, serial monitor) still has the port open? |
TIMEOUT from MOVE:WAIT? | Give a longer wait, or slow the move down. The motor is still running |
No Python required. Python users can keep using the Python library on the same firmware: the board switches automatically between Python and text commands. Command details for developers: Protocol reference.