VX Server Mode

 

VX contains the communications code to act as a server (referred to as VX Server Mode). When VX starts it can create a second communications thread that listens for external commands. The communication is done through TCP/IP sockets and is platform independent.

 

The VX startup program "vx.exe" has the client side built into it. Commands can be sent to VX by using "vx -r hostname command". This will work across any TCP/IP network. However, vx.exe is not required.

 

The communications client can be written in any language or environment that supports sockets. It is possible to send command line switches, macro commands, and regular VX commands (~xxx, !xxx, $xxx, etc) through this interface. When sending a macro command, data is returned to the client.

 

Running VX in Server Mode

 

To run VX in server mode run "vx -server". To send a command to a copy of VX that is already running on the local machine use "vx -r local command". If VX is not running, a new instance of VX will be executed. The server mode can be controlled while running VX. Use "~CdServerStart" to start the server mode, "~CdServerStop" to stop the server mode, and "~CdServerReset" to reset and reinitialize the server mode. To get help on the VX command line switches use "vx -h" and "vx -vh".

 

 

VX Server Mode Communications

 

By default VX uses port 8000 to listen and port 9000 to respond. The port numbers can be set by the user. To set the ports use "vx -port 3000:4000". This will start VX and VX will listen on port 3000 and respond on port 4000. To send a command to this instance of VX use "vx -r hostname:3000:4000 command". The hostname argument can be the word "local", a computer name as it is recognized on the network, or an IP address such as 192.168.1.1. If the word "local" is used for the hostname, a new instance of VX will be started if it is unable to connect to an already running instance, or if no instances are currently running.

 

 

Executing VX Server Mode Commands

 

Running "vx -r local command" assumes that the command is a VX command that starts with either '~', '!', '$', '&'. If it does not start with any of these symbols then a '~' will automatically be added to the beginning of the command.

 

To specify additional command line arguments use "vx -r local -cmd command -xxx ..." This is necessary in order to identify the command correctly among the various command line arguments. To run a macro use "vx -r local -macro macro_file". To run just a single macro command use "vx -r local macro=xxx". To load a file in a running instance of VX use "vx -r local -f file.VX".

 

 

Related Topics

Return to VX CAD/CAM Index