VSP-G1 Remote control guide: Difference between revisions

From VSPARTICLE - Docs
No edit summary
(Add remote motor control command.)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Remote control guide =
== Introduction ==
The VSP-G1 supports remote control using the RS232 serial communication protocol. This enables you to remotely and/or programmatically set and retrieve the operational parameters of the system, e.g. to implement logging or implement controlled operational routines. This guide discusses setting up the connection as well as the command and control structure and possible errors. <mark>Additionally, libraries implementing the API for various languages are available upon request.</mark>
The VSP-G1 supports remote control using the RS232 serial communication protocol. This enables you to remotely and/or programmatically set and retrieve the operational parameters of the system, e.g. to implement logging or implement controlled operational routines. This guide discusses setting up the connection as well as the command and control structure and possible errors. Additionally, libraries implementing the API for various languages are available upon request.


== Connecting to the VSP G1 ==
== Connecting to the VSP G1 ==
The VSP-G1 can be controlled remotely via a female 9 pin D-SUB connector on the back panel of the device. It implements the RS232 communication protocol for serial communication. Use a straight through serial cable or a RS232-to-USB dongle for connecting the system.
The VSP-G1 can be controlled remotely via a female 9 pin D-SUB connector on the back panel of the device. It implements the RS232 communication protocol for serial communication. Use a straight through serial cable or a RS232-to-USB dongle for connecting the system. Only pins 2,3 (RX,TX) and 5 (ground) need to be connected for successful communication between two systems.
{{Warning|Be careful with custom connections:|The VSP-G1  communicates using voltage swings between ±12V as is common for RS232. This is not compatible with TTL serial implementations, which commonly use ±3.3V or ±5V signals for communication. Ensure the equipment connected to the VSP-G1 explicitly supports RS232!}}
{{Warning|Be careful with custom connections:|The VSP-G1  communicates using voltage swings between ±12V as is common for RS232. This is not compatible with TTL serial implementations, which commonly use ±3.3V or ±5V signals for communication. Ensure the equipment connected to the VSP-G1 explicitly supports RS232!}}
=== Connection settings ===
=== Settings ===
{| class="table table-bordered table-striped"
{| class="table table-bordered table-striped"
|-
|-
Line 44: Line 44:
Answer: <code>I1.05</code><br>
Answer: <code>I1.05</code><br>
'''To retrieve setpoint'''<br> Input: <code>I</code><br>Answer: <code>I1.05</code>
'''To retrieve setpoint'''<br> Input: <code>I</code><br>Answer: <code>I1.05</code>
|-
| <code>M</code> || Retrieves or sets (if input was provided) the motor position. || Optional: a integer number between 2 and the maximum value 40. Send 1 to enable remote motor control or 0 to disable the remote motor control. || The command and the (new) value of the  motor position.
| '''To set a new value'''<br>Input: <code>M20</code>
Answer: <code>M20</code><br>
'''To retrieve motor control enabled/disabled status '''<br> Input: <code>M</code><br>Answer: <code>M1</code>
|-
| <code>C</code> || Returns the carrier gas settings. || Optional: Send 0 to set the carrier gas as Nitrogen or 1 to set carrier gas as Argon || The command and the new set value if it is in the valid range. Otherwise an error code will be raised.
| Input: <code>C1</code> <br> Answer: <code>C1</code>
|-
|-
| <code>G</code> || Starts sparking when in idle mode. || N.A. || <code>G</code>  
| <code>G</code> || Starts sparking when in idle mode. || N.A. || <code>G</code>  
Line 60: Line 68:
| <code>E</code> || If an error was encountered, this retrieves the error code. || N.A. || An integer as error code. Refer to [[VSP-G1 Remote control guide#Error codes| Error codes]] for details on the possible error codes.  
| <code>E</code> || If an error was encountered, this retrieves the error code. || N.A. || An integer as error code. Refer to [[VSP-G1 Remote control guide#Error codes| Error codes]] for details on the possible error codes.  
| Input: <code>E</code> <br> Answer: <code>E2</code>
| Input: <code>E</code> <br> Answer: <code>E2</code>
|-
| <code>W</code> || Enable or disable glow mode || Optional: An integer value of 1 to enable glow mode or 0 to disable the glow mode. || The command and the new set value if it is in the valid range. Otherwise an error code will be raised.
| Input: <code>W1</code> <br> Answer: <code>W1</code>
|-
| <code>@</code> || Enable or disable data streaming || Optional: An integer value of 1 to enable data streaming or 0 to disable the data streaming. || The command and the new set value if it is in the valid range. Otherwise an error code will be raised.
| Input: <code>@1</code> <br> Answer: <code>@1</code>
|-
| <code>#</code> || Remote homing sequence procedure || This command can be used to allow the homing sequence procedure and the start of the G1 to be executed remotely || The command is echoed.
| Input: <code>#</code> <br> Answer: <code>#</code>
|-
| <code>$</code> || Remote locking or unlocking spark button || This command can be used to lock (send integer value 1) or unlock (send integer value 0) the usage of the spark button. Command can be used only in stand by mode of the G1.  || The original command is echoed and the state of the locking.
| Input: <code>$1</code> <br> Answer: <code>$1</code>
|-
| <code>F</code> || Start of remote update procedure. If command is executed successfully G1 should be in power off state.  || N.A. || <code>N.A</code>
| Input: <code>F</code> <br> Answer: N.A
|}
|}


Line 78: Line 101:
| 4 || The command is not valid in the current mode. E.g. a command to start sparking was issued while the device was already in spark mode.
| 4 || The command is not valid in the current mode. E.g. a command to start sparking was issued while the device was already in spark mode.
|-
|-
| 3x || The system is in interlock mode and is not functional. In interlock mode, only the <code>E</code> command can be used. The interlock error encountered is given by x. Refer to the table of interlock error codes to identify the precise interlock error. Any interlock error can only be cleared by pressing both dials on the front panel of the VSP G1.
| 3x || The system is in interlock mode and is not functional. In interlock mode, only the <code>E</code> command can be used. The interlock error encountered is given by x. Refer to the [[VSP-G1 User Manual#Interlock errors | table of interlock error codes in the troubleshooting section]] to identify the precise interlock error. Any interlock error can only be cleared by pressing both dials on the front panel of the VSP G1.
|}
|}

Latest revision as of 16:22, 8 May 2023

Introduction

The VSP-G1 supports remote control using the RS232 serial communication protocol. This enables you to remotely and/or programmatically set and retrieve the operational parameters of the system, e.g. to implement logging or implement controlled operational routines. This guide discusses setting up the connection as well as the command and control structure and possible errors. Additionally, libraries implementing the API for various languages are available upon request.

Connecting to the VSP G1

The VSP-G1 can be controlled remotely via a female 9 pin D-SUB connector on the back panel of the device. It implements the RS232 communication protocol for serial communication. Use a straight through serial cable or a RS232-to-USB dongle for connecting the system. Only pins 2,3 (RX,TX) and 5 (ground) need to be connected for successful communication between two systems.

Alert Warning: Be careful with custom connections: The VSP-G1 communicates using voltage swings between ±12V as is common for RS232. This is not compatible with TTL serial implementations, which commonly use ±3.3V or ±5V signals for communication. Ensure the equipment connected to the VSP-G1 explicitly supports RS232!

Settings

Parameter Setting
Baud rate 19200 bps
Data bits 8
Stop bits 1
Parity None
Flow control Off
Control character Carriage return (\r)

API reference

Scope

The VSP-G1 accepts the commands described in the table below. Not all commands are available during the various states of operation of the machine. E.g. during calibration of the electrodes, remote control is unavailable and when the system encounters an interlock error, the remote control is limited. All commands are terminated using the carriage return as control character (\r). The VSP-G1 echoes the command in response and optionally the requested set point or status terminated by \r.

Resolving errors

If an error is encountered, the system will reply ?. This indicates a specific error code is available. Before any new commands can be executed, the error needs to be cleared using the E command.

Command reference

Command Description Input Return Example
V Retrieves or sets (if input was provided) the spark voltage in kV. Optional: a floating point number with 2 decimal precision between 0.00 and the maximum value determined by the carrier gas setting (e.g. 1.36kV when using Argon) . The command and the (new) value of the spark voltage setpoint. To set a new value
Input: V1.05

Answer: V1.05
To retrieve setpoint
Input: V
Answer: V1.05

I Retrieves or sets (if input was provided) the spark current in mA. Optional: a floating point number with 1 decimal precision between 0 and 10.4. The command and the (new) value of the spark current setpoint. To set a new value
Input: I1.05

Answer: I1.05
To retrieve setpoint
Input: I
Answer: I1.05

M Retrieves or sets (if input was provided) the motor position. Optional: a integer number between 2 and the maximum value 40. Send 1 to enable remote motor control or 0 to disable the remote motor control. The command and the (new) value of the motor position. To set a new value
Input: M20

Answer: M20
To retrieve motor control enabled/disabled status
Input: M
Answer: M1

C Returns the carrier gas settings. Optional: Send 0 to set the carrier gas as Nitrogen or 1 to set carrier gas as Argon The command and the new set value if it is in the valid range. Otherwise an error code will be raised. Input: C1
Answer: C1
G Starts sparking when in idle mode. N.A. G Input: G
Answer: G
A Aborts sparking when in spark mode. N.A. A Input: A
Answer: A
S Returns the current status. N.A. A JSON formatted string indicating the spark status, spark current and voltage setpoints and the current reading of the spark voltage and current. The S element has values 0 and 1, indicating whether the system is sparking (1) or not (0). The SET element contains the spark voltage (V) and spark current (I) set points and, when sparking, the MON element contains the current monitor values of the spark voltage (V) and current (I). All monitor values are refreshed approximately every 10ms. Input: S
Answer when sparking: {"S":1,"SET":{"I":6.5,"V":1.05},"MON":{"I":6.4,"V":1.04}}

Answer when idle: {"S":0,"SET":{"I":6.5,"V":1.05}}

! Returns the version number of the software. N.A. A string containing the command followed by the version description of the software. Input: !
Answer: !1.0-10HV
E If an error was encountered, this retrieves the error code. N.A. An integer as error code. Refer to Error codes for details on the possible error codes. Input: E
Answer: E2
W Enable or disable glow mode Optional: An integer value of 1 to enable glow mode or 0 to disable the glow mode. The command and the new set value if it is in the valid range. Otherwise an error code will be raised. Input: W1
Answer: W1
@ Enable or disable data streaming Optional: An integer value of 1 to enable data streaming or 0 to disable the data streaming. The command and the new set value if it is in the valid range. Otherwise an error code will be raised. Input: @1
Answer: @1
# Remote homing sequence procedure This command can be used to allow the homing sequence procedure and the start of the G1 to be executed remotely The command is echoed. Input: #
Answer: #
$ Remote locking or unlocking spark button This command can be used to lock (send integer value 1) or unlock (send integer value 0) the usage of the spark button. Command can be used only in stand by mode of the G1. The original command is echoed and the state of the locking. Input: $1
Answer: $1
F Start of remote update procedure. If command is executed successfully G1 should be in power off state. N.A. N.A Input: F
Answer: N.A

Error codes

The table below lists the possible error codes returned by the E command.

Error code Reason
0 No error. This is returned when you send E, but no error was present.
1 The last command is not a valid command or it was improperly formatted.
2 The last command exceeded the maximum length for a valid command and is not valid.
3 Invalid input provided with the command. E.g. only numeric input is allowed for the I and V commands, but alphanumeric input was encountered.
4 The command is not valid in the current mode. E.g. a command to start sparking was issued while the device was already in spark mode.
3x The system is in interlock mode and is not functional. In interlock mode, only the E command can be used. The interlock error encountered is given by x. Refer to the table of interlock error codes in the troubleshooting section to identify the precise interlock error. Any interlock error can only be cleared by pressing both dials on the front panel of the VSP G1.