###########################################################################################################
################################################ USB Update ###############################################
###########################################################################################################

1) Paste your "usb_update" folder into the usb. This folder and its content can  be automaticaly generated
 by the aquarius builder.
2) Plug the USB into control unit.
3) You can trigger the update via "Menu" -> "Sensor setup" -> "NH6000SC" -> "Maintenance" -> "Factory Service"
   -> "Software Update" -> Press "OK"
4) If there is an ".autoupdate" file just wait for some time

Notes:
	1) Convention
The versions displayed are read from the file names.
The correct naming convention is:
For application   "NH6000sc_USBUPDATE_P#_AC_V#_#_#.BIN"
For device driver "NH6000sc_USBUPDATE_P#_DD_V#_#_#.BIN"
For script        "NH6000sc_USBUPDATE_P#_PCS_V#_#_#.BIN"
with # range [0-999]. It is supposed to be "Package-Major-Minor-Patch".

	2) Integrity check
On update, a check is done to verify the file's integrity.
On application and script this check looks at a magic word in the header of the file, and on device driver 
it makes sure that the version in the name is the same than the one in the file. Therefore you can overwrite
 the versions in the file names for script and application and it will still work. On device driver, however,
 it will make the update fail.

	3) Behaviour
The update process will upload the bank 2 with the new software, available from USB. On USB you should have
 only the code you want to update in the machine. Do not have more than one file for each packages 
(application/ device driver/ script) copied on your USB stick.  Codes for missing packages will be copied from 
bank 1 to bank 2. The update process only updates the packages for which there is a  firmware on USB.
Once the bank 2 is ready, the control unit restarts only if the application has been changed. It then restarts
 a second time on bank 1. The aquarius might then update the subnodes if the code is more recent.

	4) Version
You can revert the firmware on control unit and on subnode. In that case you muss go into the menu and start 
manually. Reverting the code is not possible with the autoupdate since the autoupdate will only work if the
 available code is more recent.

	5) Subnodes
With that feature you can update the subnodes. The code for subnodes can be attached to the application code,
 in which case the size of the application file will be bigger (approx. 1000KB with subnodes agains approx. 270KB
 without). This update will occur after the second restart, when the new code is loaded on bank 1.

	6) Update time
The operation from USB to bank 2 is what takes most of the time, all other operations can be considered as much 
faster. With a new application code, including subnodes, the whole process can last up to 5 minutes.

	7) Autoupdate
The autoupdate will happen if there is a .autoupdate file in the "usb_update" folder. This .autoupdate do not need 
to contain any data. However, this only works if the versions on the key are higher than the actual ones. The 
check against package version is only done on the application code. If an autoupdate is triggered, everything will
 be copied from the USB stick, including the software that might be outdated, so be wise when packaging your software.

	8) Script
The script can be attached to the application code. If you use the generated application code (created by aquarius
 builder) there is already a script integrated in the application code so you won't need any specific script file.
 However you can overwrite that script by adding your own script file.

	9) Endless update
Endless update should not happen, however if there is a mismatch between the naming and the content of the binary
 this will happen. In case of an endless update you might just want to pull the USB out after a while to break the
 loop.

	10) Endless node update
Again, this should not happen. After an update the control unit will update the nodes. If there is an endless loop
 here this means that a bug makes it impossibly to check for the node version (for instance). If there is such an
 issue please contact the software development team.