Legacy Commands

From SPM-Wiki
Revision as of 21:34, 27 April 2014 by Ltspm (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Remote

We recommend the use of the new more powerful OLE/COM interface instead. For example through Matlab. This TCPIP interface will not be longer supported in future versions of the program.

The STMAFM program accepts external commands through remote operation. Communication is via a TCPIP connection through the port given by the port pumber. To enable remote access press the <Remote On> button. When enabled remote commands are allowed at any time, i.e. it is the users responsibility that the remote operation does not interfere with the normal operation. Status information is permanently updated.

Clipremote.png

The remote commands are simple Ascii commands. A suitable Scripting program is available through Createc.

STMAFM Remote Commands (Further commands will be added on user request)

The Commands and Parameters are send as Strings. The Strings have to be separated by ',' or CR LF. Only one Command can be send at a time. Parameters are returned as Strings separated by CR LF The first String returned is READY or an ErrorCode.

stmbeep  : For testing: STM beeps

setparam  : Set Parameter // Param[1]: key Name in Param Field, Param[2]: new value (See old parameter menu)

getparam  : Get Parameter // Param[1]: key name in Param Field

scanstart : Start Scan

scanstop  : Stop Scan

scanwaitfinished : Wait until Scan is finished

quicksave : Save the Scanfile

btn_vertspec  : Take a single Vert. Spektrum in point: //param[1], Param[2] ]=imagepixelx,y,coordinate

btn_vertspec_mult: Take multiple Vert. Spectra in points // param[n],param[n+1] in imagepixel coordinates

btn_vertspec_line: Take several spectra along a line / start point: param[1],param[2], end point param[2], param[3]

vertsave  : Save the Vertfile

move_tip_imagecoord: move tip to new position: startpoint: param[1],param[2], endpoint param[3], param[4], number of steps: param[5], delay in dsp cycles: param[6]

getscanstatus: get the present scanstatus; Scanstatus returned as String and as Number

Client - Server Control

We recommend to consider first the use of a normal remote desktop connection to control the STM/AFM program.

The STMAFM program allows remote control operation through a TCPIP connection. The program connected directly to the DSP board has to be switched into Server Mode first. Then another instant of the STMAFM program can connect to the Server program, switching from analysis mode into client mode. The client STMAFM program can be located on the same or another computer having TCPIP access to the Server machine. Apart from running the STMAFM from a remote place, the client server mode also allows more than one client program. A useful application is to control the DSP board directly without using the STMAFM program. For example you want to write a specialized spectroscopy software which should run in parallel with the STMAFM program. Then you use an STMAFM client to do all the other operations, and your own software to send additonal control commands to the DSP directly, bypassing the STMAFM client. A detailed description of the DSP command format, will be given below.

Server-Client operations are operated through FormPC32, which is accessible under Menu option DEBUG. If the program is in Data Acquisition mode, it can be put into Server-Mode by selecting the Server Mode check box. Communication is done using a specific port number, which has to be the same for the server and the client and should not be in conflict with other software running on the host system. Moreover take care that access is not blocked by a wrongly configured Firewall on either the server and the client machine. Once the program is in server mode the program windows are disabled. To go out of server mode simply deselect the server mode checkbox.

To switch the STMAFM program into client mode input the hostname or host address of the server machine. Use the server port number. Then press the 'Connect to Server' button. The client will automatically connect to the server. The successful connection will be displayed in the Comm-Info box, otherwise an error message will appear. To go out of Client mode press the button again. When the Client connects the server will send the server parameters to the client, so that the client will resemble the same configuration as the server. During Client operation the server parameters will not be updated by the client. Only when the client finishes the connection the client will update the server parameters with the actual client parameters.

The speed of the Client-Server operation will depend on the network performance.

Files are always stored on the computer which is operated by the user.

Clipclientserver.png


An alternative way to operate the STM from a different computer is to use a Remote Desktop Connection for example available directly in the Windows XP operating system. If the network is fast enough Createc recommends remote operation in this mode. In particular if the optional high speed USB2.0 adapter is installed.


For completeness below the low level command structure is shown. For user control the Remote operation alternative is suggested

Format of the commands send over TCPIP: It consists of an array of 32 bit integers:

1. CMD_Type: integer always =1 2. CMD: integer number which defines the command 3. CMDLength: length of the command including all parameters 4. Parameter_0 : integer 5. Parameter_1: integer .. N+4: Parameter_N: integer

The length of the commands is 16 integers for short and 64 integers for long commands

Format of the data received over TCPIP: 32bit Integer Array:

1. Channel 2. Commandtype: 1 for command response 2 for scanning/spectroscopy etc data 3. Lenght of the received data in byte

If command reponse: 4. Returned parameter 0 .. 11. Returned Parameter 7

If data response: Data. The data is packed in 5byte=20bit format.