This is a telnet server that accepts commands to connect to and control ILMUs.

There is an application version in /Application that you can start up and try it out, however, it obviously has to stay open to work. For that, a service version is supplied as well.

It will open up TCP port 45000 per default, you can however change the setting in the file 'IlmuCmdServer.config'. Also you will find a list of user logins in that file, which you need to login later.

Quickstart
----------

1. Start the executable 'Item.IlmuCmdServer.Application.exe'
2. Connect to port 45000 (or whatever you put into the file) with a telnet client like Putty (see image provided).
3. Press RETURN and you will get a 200 WELCOME message with the list of possible commands.
4. Login using the command: LOGIN root password (if you did not change anything in the config)
5. Connect to an ILMU with the command: CONNECT usb 0 (if the ILMU is attached to USB, otherwise try SEARCH 192.168.0.0 to find ILMUs or use the command help)
6. If any command does not work, type it without options to see the command help
7. If the connect was successful, it will report the serial of the connected ILMU. Otherwise use this command: LIST
8. Enable the ILMU with the command: ENABLE IlmuSerial
9. Move the ILMU with the command: MOVETOMM IlmuSerial 100.0 (for Millimeters) or MOVETO IlmuSerial 0.5 (for Percentage of ILMU length)
10. Explore the other commands, like subscriptions, which will send you the ILMU variables periodically with an asynchronous datagram

After that
----------

1. Write a software in some programming language that can open TCP sockets to control your ILMU from almost any language
2. Install the service version of this software so it automatically starts up with Windows by using the batch files in the 'ServiceWindows' directory (admin needed to install services)
3. Just copy the folder somewhere on your harddisk and then start 'service_install.bat' as Administrator to setup the service and start it

Command List
------------

HELP LOGIN CONNECT RECONNECT DISCONNECT LIST ENABLE DISABLE REF LIMITS HASERROR ERRORS RESET MOVETO MOVETOMM MOVETOWP MOVEFWD MOVEBACK STOP SUBSCRIBE UNSUBSCRIBE GET VARS SEARCH GETWP SETWP STARTSCRIPT ENDSCRIPT EXECUTE SIGNAL

Error Handling
--------------

if an ILMU reports an error, it will send the following Async Message (example for two errors, 08-00 and 03-00):

!!ERROR:122:08-00 Winkelgeberfehler Resolver|03-00 ?bertemperatur Motor (analog)

Explaination:

!! = Async message
ERROR = Message Type
: = Field separator
122 = ILMU serial
: = Field separator
08-00 = Error code, Section 08 / Suberror 00
Winkelgeberfehler Resolver = Translated error message
| = Error separator
03-00 = Next error code
?bertemperatur Motor (analog) = Next error message, German Umlaut Ü not correctly transformed due to ASCII

Message Handling
----------------

There are generally two types of messages: ASYNC (starts with "!!") and direct messages.

Async Message:

Happens event driven, at any time, whenever the ILMU feels like responding (e.g. errors, subscriptions, move commands)
The async message format follows the same general principle as the error message above, using an ":" as a field separator.
GETWP message format is: !!GETWP:WP Index:Position:Speed:Accel:Mode:Successor1:Successor2

Direct Message:

Happens immediately after the command you sent (e.g. ILMU not found, bad request, no permission)
The direct messages start with an HTTP status code and the message text.

Newest Command Changes
----------------------

WebSocket Support! -> You can connect to this server from any WebSocket enabled programming language, for example a browser using JavaScript. Check out the file WebSocket_MoveSample.html for an example. Before you try the WebSocket Sample you should understand how the command flow works, so try Putty access first.

STOP -> You can stop a waypoint program that is running without disabling the controller
MOVETO... -> The move commands got an option to select a different mode when starting a movement: A = Append move so it happens after the current move  I = Ignore move if the ilmu is currently moving  R = Replace movement with the new one
SEARCH -> You can search for compatible controller hardware on all networked interfaces
GETWP -> You can check if your edits did actually happen
SETWP -> You can edit the waypoints inside the controller
MOVEPORTAL Speed Accel AxisSerial1 AxisPos1 ... [AxisSerialX AxisPosX] -> Synchronous movement of multiple axis, so they all arrive at the same time
ENABLE ALL
DISABLE ALL
REF ALL
RECONNECT ALL
RESET ALL
DISCONNECT ALL
HELP -> Instead of pressing just return, works even without login
HASERROR -> Get information if the ILMU is in an error state
ERRORS -> Get all error codes from the ILMU (will happen automatically if an error happens)
UNSUBSCRIBE ERRORS -> If you do not want to see errors popping up automatically
MOVEBACK -> Jog the ILMU backwards
MOVEFWD -> Jog the ILMU forward