======SLICE-DCC API====== ====Links==== * **Quick-Start Guides** * [[slice:quick_start_dcc|SLICE-DCC Quick Start]] * **Electronics** * [[slice:dcc|SLICE-DCC Manual]] * [[slice:dcc:firmware|SLICE-DCC firmware upgrade instructions]] * **Websites** * [[https://www.vescent.com/products/electronics/slice/slice-cc-dual-channel-current-controller/|SLICE-DCC web page]] * [[https://github.com/Vescent|Github page for SLICE-DCC GUI]] * [[https://github.com/Vescent/|Github page for SLICE-DCC firmware revisions]] THIS LINK NEEDS UPDATING! =====Implementation Instructions===== Listed below is the command set for the Application Programming Interface (API) for the SLICE-DCC. Most operations that can be performed via the touchscreen or PC-resident GUI can be also be performed via the API. Computer communication to the SLICE instrument occurs by first establishing a Serial COM port via the USB 2.0 physical interface. Computer communication should be platform independent, though appropriate USB drivers may have to be installed. The following table shows the serial port settings: ^ Baud Rate | 9600 | ^ Data Bits | 8 | ^ Parity | None | ^ Stop Bits | 1 | ^ Flow Control | None | To perform an operation, an ASCII-based text message is first constructed from a command and its arguments, and then the message is transmitted to the SLICE instrument through the COM port. The following rules apply: - Syntax is //insensitive// to case. - A message is an ASCII string composed of a command followed by zero or more arguments. - A command and its arguments are delimited by spaces. - Messages are terminated by a carriage return ("\r"). - All valid messages return an ASCII string value. - [Int] refers to an integer argument that has no decimal point. - [Float] refers to a floating point argument that has a decimal point in its value. - Changes effected by issuing a serial command from this API are not permanently stored in non-volatile memory until you issue a SAVE command. Configuration changes without the SAVE command will be lost with power cycling. The Save command stores the entire configuration and so several configuration changes can be implemented and then a single SAVE command could be issued. ===== SLICE-DCC Specific Notes ===== - Valid values for the CHANNEL argument are {1, 2}. - All enable commands use an integer argument to convey the state: 0 = Off, 1 = On. - All currents are set and returned in Amperes [A]. ---- ===== Global SLICE Commands ===== The following commands are operational on all SLICE products. ---- ====Firmware Version==== Returns firmware version of System Controller. /*Note: For the Return Question mark, we had to use a slightly different question mark image. This one: ?. Rather than this one: ?. */ ---- ====Reset to Factory Default Settings==== Restores "Personality Board" to factory default settings. No return value. \\ | {{ :take-note.png?80&nolink }} | Power cycle the SLICE unit to complete factory reset. | ---- Saves "Personality Board" settings into EEPROM. Unsaved changes will be lost if the board is powered off without issuing a SAVE command. The SAVE command saves the entire configuration into non-volatile memory. A single SAVE command can be issued after any number of configuration changes. When changes are made to the SLICE configuration through the touch screen, the new values are automatically saved and it is not necessary to issue a SAVE command.\\ \\ __Slot Number__\\ * 1 = first slot * 2 = second slot __Possible Responses__\\ * SUCCESS * FAIL ---- ===== SLICE-DCC-specific Commands ===== The following commands are specific to the SLICE-DCC dual current controller.\\ | {{ :take-note.png?350&nolink }} | Changes to operation parameters executed by these commands are stored only in RAM. If you wish to permanently save new parameter values, you must execute a [[slice:dcc:api#global_slice_commands|SAVE command]] after parameter changes. | ---- Returns the current operating mode for channel CHANNEL. In the example, the status of channel 1 is reported to be Constant Current mode, current off.\\ \\ __Channel input range__\\ CHANNEL: {1,2}\\ __Possible system responses__\\ 0 = Constant Current mode, OFF\\ 1 = Constant Power mode, OFF\\ 2 = Constant Current mode, ON\\ 3 = Constant Power mode, ON\\ ---- Sets the operating mode to MODE for channel CHANNEL. Returns CONTROL? CHANNEL. In the example, channel 1 is set to Constant Power mode, current on.\\ \\ __CHANNEL input range__\\ CHANNEL: {1,2}\\ __MODE input range & possible system responses__\\ 0 = Constant Current mode, OFF\\ 1 = Constant Power mode, OFF\\ 2 = Constant Current mode, ON\\ 3 = Constant Power mode, ON\\ ---- Returns the operating current set point in Amps for channel CHANNEL. In the example, channel 1 current is set to 0.422800 A.\\ \\ __CHANNEL input range__\\ CHANNEL: {1,2}\\ __System response__\\ Current set point of channel CHANNEL in AMPS\\ ---- Sets the set point operating current to CURRENT in Amps for channel CHANNEL. Returns CURRENT? CHANNEL. In the example, the current for channel 1 is set to 0.288 A.((System may not deliver CURRENT Amps due to the high impedance of the specific load or other irregular system configurations.))\\ \\ __Input parameter ranges__\\ CHANNEL: {1,2}\\ CURRENT: (0((Negative currents are not accepted)) to Max Current((as defined by MAXCURR and/or SLICE-DCC unit capacity)))\\ __Possible system responses__\\ Requested current in Amps or closest value as bounded by unit capacity.\\ | {{ :take-note.png?200&nolink }} | CURRSET does not turn on or off the current. It only changes the set point value. Use a CONTROL command to change the operation mode. | ---- Returns user-set maximum current in Amps for channel CHANNEL. In the example, the maximum current supplied by channel 2 has been set to 1.435300 A.\\ \\ __Input range__\\ CHANNEL: {1,2}\\ __System response__\\ Maximum allowed current of channel CHANNEL in AMPS\\ ---- Sets the maximum allowed current to CURRENT in Amps for channel CHANNEL. Returns MAXCURR? CHANNEL. In the example, the maximum allowed current for channel 2 is set to 1.3 A.\\ \\ __Input parameter ranges__\\ CHANNEL: {1,2}\\ CURRENT: (0((Negative currents are not accepted)) to Max Current((as defined by SLICE-DCC unit capacity)))\\ __Possible system responses__\\ Requested current maximum in Amps or closest value as bounded by unit capacity.\\ ---- Returns measured current in milliamps for channel CHANNEL. In the example, the measured current of channel 1 is 100//e// mA.((CURRENT? may be < CURRSET if, for instance, the load has higher impedance than can be driven by the SLICE-DCC.))\\ \\ __Input range__\\ CHANNEL: {1,2}\\ __System response__\\ Measured current being delivered by channel CHANNEL in milliamps\\ ---- Returns the Constant Power Mode power set point for channel CHANNEL. In the example, the power set point of channel 1 is 314.0 mW.\\ \\ __Input range__\\ CHANNEL: {1,2}\\ ---- Sets the set point power level in milliwatts to which the Constant Power Mode will attempt to servo for channel CHANNEL. Returns PWRSET? CHANNEL. In the example, the set point power for channel 2 is set to 314.0 mW.\\ \\ __Input parameter ranges__\\ CHANNEL: {1,2}\\ PWRSET: (0 to TBD)((as defined by SLICE-DCC unit capacity)))\\ __Possible system responses__\\ Requested power set point or closest value as bounded by unit capacity.\\ ---- Returns the measured power for channel CHANNEL in milliwatts. In the example, the power measured at channel 1 is 314.0 mW.\\ \\ __Input range__\\ CHANNEL: {1,2}\\ ---- Returns the measured compliance voltage across channel CHANNEL in volts. In the example, the voltage drop across channel 1 is 3.345 V.\\ \\ __Input range__\\ CHANNEL: {1,2}\\ ---- Returns the Integral Gain of the Constant Power feedback loop for channel CHANNEL in dB. In the example, the Gain for Constant Power mode feedback for channel 1 is +30.000 000 dB. The default value of the Gain is +30.000 000 dB.\\ \\ __Input range__\\ CHANNEL: {1,2}\\ ---- Sets the Integral Gain of the Constant Power feedback loop for channel CHANNEL. Returns GAIN? CHANNEL. In the example, the Gain of the Constant Power feedback loop is set to -31.41596 dB.\\ \\ __Input parameter ranges__\\ CHANNEL: {1,2}\\ GAIN: (-100 to +100)\\ ---- Returns the Constant Power mode external (customer-supplied) detector responsivity in Amps per Watt for channel CHANNEL. In the example, the responsivity of the detector for channel 1 is 0.0035 A/W.\\ \\ __Input range__\\ CHANNEL: {1,2}\\ ---- Sets the Constant Power mode external (customer-supplied) detector responsivity in Amps per Watt for channel CHANNEL. Returns RESPVTY? CHANNEL. In the example, the responsivity of the detector for channel 1 is set to 0.0035 A/W.\\ \\ __Input parameter ranges__\\ CHANNEL: {1,2}\\ RESPONSIVITY: (TBD)\\ ---- Returns the Constant Power mode Optical Power polarity setting of the input transimpedance amplifier for channel CHANNEL. In the example, the optical power polarity for the channel 1 transimpedance amplifier is positive (default).\\ \\ __Input range__\\ CHANNEL: {1,2}\\ __Possibe Responses__\\ ON = Negative Polarity\\ OFF = Positive Polarity (default) ---- Sets the Polarity of the input transimpedance amplifier for Constant Power Mode for channel CHANNEL. Returns POL? CHANNEL. In the example, the polarity of the transimpedance amplifier for channel 2 is set to Negative (ON).\\ \\ __Input parameter ranges__\\ CHANNEL: {1,2}\\ POL: {0,1}\\ __Possible Responses__\\ 0 = Positive = OFF\\ 1 = Negative = ON ---- Returns the status of the interlock. In the example, the interlock is closed and the system is operational.\\ \\ __Possible Responses__\\ ON = Interlock circuit is closed and unit is operational\\ OFF = Interlock circuit is open and the unit is disabled\\ ---- Returns the analog modulation source for channel CHANNEL. In the example, the modulation source for channel 1 is the front-panel input (labeled A).\\ \\ __Return Values__\\ 0 = Modulation input is the SMA connector labeled Mod In on the back of the unit for the respective channel (default).\\ 1 = Modulation input is the front panel Input BNC\\ When using the front-panel input:\\ * Channel 1 uses input A * Channel 2 uses input B ---- | {{ :take-note.png?40&nolink }} | Only one modulation input can be active at any given time. | ---- Sets the modulation input source for channel CHANNEL. Returns AMODSEL? CHANNEL. In the example, the modulation input source for channel 2 is set to the front-panel BNC (input B).\\ \\ __Input parameter ranges__\\ CHANNEL: {1,2}\\ SOURCE: {0,1}\\ 0 = Modulation input is the SMA connector labeled Mod In on the back of the unit for the respective channel (default).\\ 1 = Modulation input is the front panel Input BNC\\ When using the front-panel input:\\ * Channel 1 uses input A * Channel 2 uses input B ---- Returns the location to which the measured power of the monitor photodiode is delivered for channel CHANNEL TRANSFER FUNCTION?. In the example, the measured power of the monitor photodiode for channel 1 is delivered to the front-panel output (output 1).\\ \\ __Return Values__\\ 0 = The measured power of the monitor photodiode is not delivered to any output port\\ 1 = The measured power of the monitor photodiode is delivered to front-panel output BNC\\ __2 = Optical Power on Analog Output Optical Power from Optical Power input SMA connector on back panel NEEDS CLARIFICATION__ \\ When using the front-panel output:\\ * Channel 1 uses input 1 * Channel 2 uses input 2 ---- Sets the location to which the measured power of the monitor photodiode is delivered for channel CHANNEL TRANSFER FUNCTION?. Returns AOUTSEL? CHANNEL. In the example, the measured power of the monitor photodiode for channel 1 is directed to be delivered to the front-panel output (output 1).\\ \\ __Input parameter ranges__\\ CHANNEL: {1,2}\\ DESTINATION: {0,1,2}\\ 0 = The measured power of the monitor photodiode is not delivered to any output port\\ 1 = The measured power of the monitor photodiode is delivered to front-panel output BNC\\ __2 = Optical Power on Analog Output Optical Power from Optical Power input SMA connector on back panel NEEDS CLARIFICATION__ \\ When using the front-panel output:\\ * Channel 1 uses output 1 * Channel 2 uses output 2 ---- Returns the effect of the input trigger on channel CHANNEL. In the example, the input trigger controls the operation of channel 1.\\ \\ __Return Values__\\ 0 = Trigger input disabled \\ 1 = Trigger input controls operation \\ * Trigger input high enables channel \\ * Trigger input low disables channel\\ | {{ :take-note.png?100&nolink }} | The trigger function can operate on both channels, a single channel, or neither channel | ---- Sets the effect of the input trigger on channel CHANNEL. Returns TRIGIN? CHANNEL. In the example, the input trigger is given control over channel 1.\\ \\ __Input parameter ranges__\\ CHANNEL: {1,2}\\ STATUS: {0,1}\\ 0 = Trigger input disabled \\ 1 = Trigger input controls operation \\ * Trigger input high enables channel \\ * Trigger input low disables channel\\ ---- Returns the response of the output trigger to the status of the interlock. In the example, the output trigger will echo the interlock circuit status.\\ \\ __Input parameter ranges__\\ CHANNEL: {1,2}\\ __Return Values__\\ 0 = Trigger output does not respond to interlock status \\ 1 = Trigger output echoes interlock status \\ * Trigger output high: interlock is open \\ * Trigger output low: interlock is closed\\ ---- Sets the response of the output trigger to the interlock status. Returns TRIGOUT? CHANNEL. In the example, the output trigger is directed to echo the status the interlock circuit.\\ \\ __Input parameter ranges__\\ CHANNEL: {1,2}\\ STATUS: {0,1}\\ 0 = Trigger output does not respond to interlock status \\ 1 = Trigger output echoes interlock status \\ * Trigger output high: interlock open \\ * Trigger output low: interlock closed\\ ---- Returns the temperature of the SLICE-DCC "personality board" at the sensor point for channel CHANNEL. In the example, the temperature at the sensor point for channel 1 is 43.358°C.\\ \\ __Input parameter ranges__\\ CHANNEL: {1,2}\\ ---- Returns the maximum power (in Watts) available as configured. In the example, the power available is 41.5 W.\\ \\ __Input parameter ranges__\\ CHANNEL: {1,2}\\ __Possible output values__\\ Power: (0 to 42.5 W) ---- ===== Error Handling ===== ---- Returns the error code for channel CHANNEL. In the example, the error code for channel 2 is 49152 (No errors).\\ \\ __Possible Responses__\\ 49152 = No errors\\ 49153 = Open circuit/over voltage (posible disconnected load)\\ 49184 = Hardware Temperature Limit Exceeded\\ 49280 = Interlock Circuit Open\\ 49408 = Device total power limit exceeded\\ ---- Clears an error code for channel CHANNEL. Returns post-command ERROR? CHANNEL. In the example, error code 49280 (interlock circuit open) is cleared.\\ \\ __Input parameter ranges__\\ CHANNEL: {1,2}\\ CODE: {1,32,128,256}\\ 1 Clears error code 49153 (open circuit)\\ 32 Clears error code 49184 (hardware temperature limit)\\ 128 Clears error code 49280 (interlock open)\\ 256 Clears error code 49408 (power limit exceeded)\\ __Returns__\\ Error code resulting from clearing the error\\ Note: use this command to clear an error code obtained from the ERROR? command. This command will not clear an error message on the SLICE-DCC touch screen.