ZW3D Server Mode
ZW3D CAD-CAM Logo  
   ZW3D Base
Home > ZW3D Applications > ZW3D Server Mode
article title ZW3D Server Mode

In this Article:

About ZW3D Server Mode
Executing ZW3D Server Mode Commands
ZW3D Server Mode Communications
Running ZW3D in Server Mode
 
 
 

About ZW3D Server Mode

ZW3D contains the communications code to act as a server (referred to as ZW3D Server Mode). When ZW3D 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 ZW3D startup program "zw3d.exe" has the client side built into it. Commands can be sent to ZW3D by using "zw3dremote -r hostname command". This will work across any TCP/IP network. However, zw3d.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 ZW3D commands (~xxx, !xxx, $xxx, etc) through this interface. When sending a macro command, data is returned to the client.


 
 
 

Executing ZW3D Server Mode Commands

Running "zw3dremote -r local command" assumes that the command is a ZW3D 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 "zw3dremote -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 "zw3dremote -r local -macro macro_file". To run just a single macro command use "zw3d -r local macro=xxx". To load a file in a running instance of ZW3D use "zw3dremote -r local -f file.Z3".



 
 
 

ZW3D Server Mode Communications

By default ZW3D uses port 8000 to listen and port 9000 to respond. The port numbers can be set by the user. To set the ports use "zw3d -port 3000:4000". This will start ZW3D and ZW3D will listen on port 3000 and respond on port 4000. To send a command to this instance of ZW3D use "zw3dremote -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 ZW3D will be started if it is unable to connect to an already running instance, or if no instances are currently running.


 
 
 

Running ZW3D in Server Mode

By default ZW3D starts in the server mode. To send a command to a copy of ZW3D that is already running on the local machine use "zw3dremote -r local command". If ZW3D is not running, a new instance of ZW3D will be executed. The server mode can be controlled while running ZW3D. 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 ZW3D command line switches use "zw3d -h", "zw3d -vh" and "zw3dremote -h".