DIFFERENTIAL CONDUCTANCE PROTOCOLS
======================================
Started 2013 June 12  A.Stummer
Last revised 2014 Dec 2  A.S. (changed 90/270� to normalized phase angle, changed "S" to all settings, changed "A" to ASCII)

All communication between host and unit is UDP/IP with DHCP and port 37829.
Generally, the host sends a command and the unit reacts.
Loss of communication between host and unit will shutdown unit outputs.

HOST TO UNIT COMMANDS
---------------------
Cmd Size Description
--- ---- -------------------------
 H   1   Heartbeat, unit will echo heartbeat.  Loss of HB will stop unit from running
 M   1   Measure all voltages and currents at the set phase angle
 S   1   Request all settings then reset ADC overflow flags
 D   7   Set the DC voltage, normalized to �1
         Byte 1: 'D', header for DC voltage command
              2: '+' or '-', polarity
              3: '0' or '1', units (if 1 then must be 1.000)
              4: '.' always
              5: tenths of output
              6: hundredths of output
              7: thousandths of output
 F   5   Set the Frequency in integer Hz, 25 to 1000Hz
         Byte 1: 'F', header for frequency command
              2: '1' or '0', thousands of Hz
              3: hundreds of Hz
              4: tens of Hz
              5: units of Hz
 A   4   Set the AC voltage level (0-255, unitless)
         Byte 1: 'A', header for AC voltage command
              2: hundreds
              3: tens
              4: units
 P   4   Set the Phase angle for measurement (0-359�)
         Byte 1: 'P', header for phase angle command
              2: hundreds
              3: tens
              4: units
 Q   5   Set the Number of samples to average
         Byte 1: 'Q', header for averaging count command
              2: thousands
              3: hundreds
              4: tens
              5: units
 G   3   Set the AC-Voltage gain
         Byte 1: 'G', header for AC voltage gain command
              2: "1" or "3" for gain x1 or x3
              3: decade gain, power of 10 ("0", "1", "2") for gain: 1, 10, 100
 C   3   Set the AC-Current gain
         Byte 1: 'C', header for AC current gain command
              2: "1" or "3" for gain x1 or x3
              3: decade gain, power of 10 ("0", "1", "2") for gain: 1, 10, 100
EXAMPLES (exclude quotes):
  "D+0.500"  or "D0.5000" or "D.50000"  DC normalized voltage of 50%
  "F0050"    AC frequency 50Hz, can also be "F  50" or "F 50 "
  "P123"     Measure at 123� phase angle
  "G32"      AC voltage gain is 300
  "A2"+0x00  AC voltage output is 50 (the "2" is ASCII 0x32 or decimal 50, plus 0x00)
  "Q0100"    Average over 100 samples


UNIT TO HOST PACKETS
---------------------
Cmd Size Description
--- ---- -------------------------
 H   1   Heartbeat, echoed when received from host
 V   -   Version, as per following:
            First byte "V"
            Then Rabbit version string (e.g. "1.2.3")
            Then a \n char (0x0A)
            Then unit name (e.g. "Diff Con")
 D  21   All four ADC raw values (unsigned 16-bit)
         Byte 1: 'D', header for ADC values
              2-6:   DC voltage (00000 to 65535)
              7-11:  AC voltage (00000 to 65535)
              12-16: DC current (00000 to 65535)
              17-21: AC current (00000 to 65535)
 S   48  Send all settings
         Byte 1: 'S', header for sending all settings
		      2-8:   Normalized DC voltage (format same as command "D")
			  9:     Space
			  10-14:  Frequency (format same as command "F")
			  15:    Space
			  16-19: Phase angle (format same as command "P")
			  20:    Space
			  21-25: Samples to average (format same as command "Q")
			  26:    Space
			  27-29: AC voltage gain (format same as command "G")
			  30:    Space
			  31-33: AC current gain (format same as command "C")
			  34:    Space
			  35-38: AC voltage level (format same as command "A")
			  39:    Space
              40:    DC-V ADC saturated low  ("0"=okay, "1"=saturated)
              41:    DC-V ADC saturated high ("0"=okay, "1"=saturated)
              42:    AC-V ADC saturated low  ("0"=okay, "1"=saturated)
              43:    AC-V ADC saturated high ("0"=okay, "1"=saturated)
              44:    DC-I ADC saturated low  ("0"=okay, "1"=saturated)
              45:    DC-I ADC saturated high ("0"=okay, "1"=saturated)
              46:    AC-I ADC saturated low  ("0"=okay, "1"=saturated)
              47:    AC-I ADC saturated high ("0"=okay, "1"=saturated)
			  48:    Space
EXAMPLES (exclude quotes):
  "D3725 335984567814678" Data from ADCs are DC voltage 3725 (note space), AC voltage 33598, DC current 45678, AC current 14678.
  "SD+0.000 F1000 P000 Q0010 G10 C10 A00 00000000 " is the default cold boot settings