
求助利用現(xiàn)有函數(shù)通信COM串口控制串口設(shè)備最后由 vince 于 -6-11 12:24下面是該軟件的命令函數(shù)和結(jié)構(gòu),希望有大神能幫我做個基本代碼架構(gòu),可以通信COM串口,我本地的串口端是COM4。這個設(shè)備是馬達(dá)旋轉(zhuǎn)臺的設(shè)備,一共有6個旋轉(zhuǎn)等級。
nclick="copycode($('code0'));">復(fù)制代碼
- 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:
- ParameterSetting
- Baud Rate115.2 K Bits per Second
- Data Bits8
- Parity None
- Stop Bits1
- 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:
- CommandSyntax Description
- Get ID *idn?Returns the model number and firmware version
- Set Positionpos=nmoves the wheel to filter position n
- Get Positionpos? 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=0Sets the external trigger to the input mode
- ~trig=1Sets the external trigger to the output mode
- Get Trigger Mode Trig?Returns the trigger mode
- Set Speed Modespeed=0 Sets the move profile to slow speed
- ~ speed=1Sets the move profile to high speed
- Get Speed Modespeed? Returns the move profile mode
- Set Sensor Mode sensors=0Sensors turn off when wheel is idle to eliminate stray light
- ~ sensors=1Sensors remain active
- Get Sensor Mode sensors? Returns the sensor mode
- Set Baud Rate baud=0Sets 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 Settingssave 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

