LabView Example Code
--------------------

While it is possible to load the ObjectService.dll into LabView via the .NET integration, there are certain behaviours of LabView that will cause problems (like missing generics and action event support).
Because of that, there is a wrapper DLL for the ObjectService.dll that exposes only one command (SendCommand) and only one event (replySent).
The wrapper DLL is called ObjectServiceWrapper.dll and should be loaded into LabView via the .NET constructor node.

The DLL uses the same text API that is used in our "TCPController" server that can also be found in the SDK folder.

Quickstart
----------

1. Start the executable 'bin/LabView_MoveSample.exe'
2. You will get a 200 OK message with the list of possible commands.
3. Connect to an ILMU with the command: CONNECT usb 0 or CONNECT AUTO or press the "Connect Auto" button (if the ILMU is attached to USB, otherwise try SEARCH 192.168.0.0 to find ILMUs or use the command help)
4. If any command does not work, type it without options to see the command help
5. If the connect was successful, it will report the serial of the connected ILMU. Otherwise use this command: LIST (or press the "List Connected" button)
6. Enable the ILMU with the command: ENABLE IlmuSerial (or press the "Enable" button, which will issue the "ENABLE ALL" command)
7. Move the ILMU with the command: MOVETOMM IlmuSerial 100.0 (for Millimeters) or MOVETO IlmuSerial 0.5 (for Percentage of ILMU length) or use the interface by writing your axis serial into the respective box and using the buttons to the right
8. Explore the other commands, like subscriptions, which will send you the ILMU variables periodically with an asynchronous datagram

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

1. Check out the source .vi of the LabView application in the src/LabViewILMUHandling folder.
2. See how the commands are constructed and how the event is subscribed to and handled in the subVI
3. Integrate the code into your own LabView application to drive the ILMU.

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

HELP 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
----------------------

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
