We have written a basic API to allow advanced customers to automate some tasks when using the RetinaEngrave Ethernet interface. The idea was to allow a simple interface to load jobs from the microSD, run jobs, move the laser to various positions on the bed, testfire, as well as possibly controlling some basic external devices (pallet changer, indexer, etc). The API only works over the Ethernet interface (not available over USB). Jobs must be precalculated by the PC and stored as jobs on the microSD card. You must be familiar with socket programming over Ethernet to use the API.
Attached is example code in VS2010 C# 4.0. Since it relies only on network sockets, it requires no drivers and can be used under any OS (PC, Mac, Linux, Android, etc).
Currently this is the specification. This is subject to change.
Connection is over Telnet to port 12345
Command : Description
GOTOXYZ x y z : where x y z are in number of steps
GOHOME : goes home
TSTFIRE x : where x is duration in 0.1ms eg TSTFIRE 50 = 5ms pulse
CURPOS : returns current position in steps
LS : list files on SD Card
FXJOB : enter file mode
FILE filename : load filename (must be in FILE mode first)
RUN : runs the job
PAUSE : pauses job
RESUME : resumes job
ABORT : aborts job
PIN x IN : set pin as input
PIN x OUT : set pin as output
PIN x GET : get state of pin (works for input or output)
PIN x SET: where x = 1 or 2 or 3, which will set a digital pin level high (3.3v, 4mA). You must buffer this pin or risk damaging the board. Do not hook up devices directly to this pin.
PIN x CLR: where x = 1 or 2 or 3, sets the logic level low on that particular pin
STATUS : returns RUNNING if job is still running or IDLE if job is finished
GOTOXYZ -1000 -1000 0
PIN 1 OUT
PIN 1 SET
this will get the current position, move left 1000 steps, down 1000 steps then load and run the job "test.bin" then raise pin 1 to +3.3v
- (43.14 KiB) Downloaded 98 times