本帖最后由 vince 于 2019-6-11 12:24 编辑
下面是该软件的命令函数和结构,希望有大神能帮我做个基本代码架构,可以通信COM串口,我本地的串口端是COM4。
这个设备是马达旋转台的设备,一共有6个旋转等级。- Software Control
- 1. Application Software Operation
- The FW102C(NEB) and FW212C(NEB) come with a CD-ROM that contains application software to control the unit using USB 2.0, or RS232, from a PC. (See Thorlabs Motorized Filter Wheel Software Manual).
- Minimum PC Requirements
- The application program requires a minimum of a Pentium-class machine running Windows XP or newer.
- Command Line Interface
- The FW102C can also be controlled by a command line language through the USB or RS232 ports. This is offered to enable operation through a terminal interface or for those who may want to write their own program to control the wheel. Prior to running the command line interface, the unit should be powered, and a USB or RS232 cable should be connected between the FW102C and the host. The terminal emulator should be configured as follows:
- Parameter Setting
- Baud Rate 115.2 K Bits per Second
- Data Bits 8
- Parity None
- Stop Bits 1
- Flow Control None
-
- If the connection is correct, you will see the following message after pushing the Enter key:
- 2. Command error CMD_NOT_DEFINED
- This message will be followed immediately by the prompt:
- >
- The basic structure of the interface is a keyword followed by either an equals sign “=” or a question mark “?”. The“=” or “?” will determine if the string is a command or a query. All strings (commands and queries) must be terminated by a carriage return (CR) or pressing the ENTER key on the computer.
- 2.1. Command Structure
- Keyword = argument (CR)
- Here, keyword defines the function, and argument is a numerical value followed y a carriage return (CR).
- 2.2. Query Structure
- Keyword? (CR)
- Keyword defines the function, and the question mark (?) indicates a query. The string is terminated with a carriage
- return (CR). Exceptions to this and unique shortcut keys are given in the table on page 11.
- The prompt symbol “>” will appear on power-up and after a command is accepted by the FW102C and indicatesthat the FW102C is ready to receive another command line.
- 2.3. Keywords (Commands and Queries)
- The following table describes all of the available commands and queries:
-
- Command Syntax Description
- Get ID *idn? Returns the model number and firmware version
- Set Position pos=n moves the wheel to filter position n
- Get Position pos? Position Query
- Set Position Count pcount=n Sets the wheel type where n is 6 or 12
- Get Position Count pcount? Returns the wheel type
- Set Trigger Mode trig=0 Sets the external trigger to the input mode
- ~ trig=1 Sets the external trigger to the output mode
- Get Trigger Mode Trig? Returns the trigger mode
- Set Speed Mode speed=0 Sets the move profile to slow speed
- ~ speed=1 Sets the move profile to high speed
- Get Speed Mode speed? Returns the move profile mode
- Set Sensor Mode sensors=0 Sensors turn off when wheel is idle to eliminate stray light
- ~ sensors=1 Sensors remain active
- Get Sensor Mode sensors? Returns the sensor mode
- Set Baud Rate baud=0 Sets the baud rate to 9600
- ~ baud=1 Sets the baud rate to 115200
- Get Baud Rate baud? Returns the baud rate where 0 = 9600 and 1 =115200
- Save Settings save This will save all the settings as default on power up
-
- "All commands and queries are in lower case letters.
- If the keyword, format, or argument are incorrect or out of range, the unit will return an errorstring.
- In addition to the commands given above, there is also special functionality added to thearrow keys of the computer’s keyboard:
- Key Description
- Up Arrow Increments the filter position by 1
- Down Arrow Decrements the filter position by 1
复制代码
|