Codigos Ascii
Codigos Ascii
Bank Setting
Command 1 Command 2 Command 3 Description (Be sure to refer to the Amplifier Instruction Manual as well.) Defalut
0 Bank Setting
1 Switches the banks. (0 - 7). Either the bank switching
button or the bank input terminal is also available to
2 switch. The bank number set at the power rising is the
3 final bank set with the button or this command when
BANK BANK 0
4 the bank input terminal is 0 (in the state that the
5 terminal is not connected), and becomes bank set in
the input terminal when the bank input terminal is
6 other than 0.
7
The value in ( ) of the initial value field is for CD4A-L.
Analog Output Setting
Command 1 Command 2 Command 3 Description (Be sure to refer to the Amplifier Instruction Manual as well.) Defalut
Setting of Analog Output Range of Calculation
Result +5.000
CAL_HI For CD4A
To use this function, set the OUTPT setting on the (+1.0000)
±9999.999
For CD4A-L screen to [ ][CAL].
The analog output of calculation result is output -5.000
CAL_LO ±999.9999
from ANALOG B terminal. (-1.0000)
Check the connection. (RS232C cable, straight, 9 pin female, 9 pin female)
Set the same communication setting at CD4 and the PC. (Baud rate, data length, parity
check)
Check if the ETX(03H) is added to the end of the command.
It takes several seconds to perform all setting reset commands from transmitting to return
of ">."
2BH 32H 35H 2EH 30H 30H 30H 30H 35H 0DH
+ 2 5 . 0 0 0 0 5 CR
2BH 32H 35H 2EH 30H 36H 30H 30H 32H 0DH
+ 2 5 . 0 6 0 0 2 CR
2BH 32H 34H 2EH 30H 30H 30H 30H 30H 0DH
+ 2 4 . 0 0 0 0 0 CR
2BH 32H 34H 2EH 30H 30H 30H 30H 35H 0DH
+ 2 4 . 0 0 0 0 5 CR
2BH 32H 34H 2EH 30H 36H 30H 30H 32H 0DH 03H
+ 2 4 . 0 6 0 0 2 CR ETX
After all buffers are read out, the function starts reading out the measurement value to the
buffer, and changes to the standby state for the next trigger.
Be sure to read out the buffer before starting the next trigger. (The buffer is not overwritten
unless it is readout.)
In case of the following conditions, the digit of 1μm of readout data remains always "0." For CD4A
When A is selected in the data setting for buffer and HEAD A is the 350 mm type.
When B is selected in the data setting for buffer and HEAD A is the 350 mm type.
When CAL or A&B is selected in the data setting for buffer and HEAD A or HEAD B is the 350
mm type.
(Example of command) STX and ETX are omitted in this example. The space (20H) is shown as ( ) for conveniencw.
Transmission Reception
Command Meaning Response Meaning
BUFFER( )TRIGGER Start trigger > Completion of triggering
(When the data buffer is completed) > Completion of buffering
2BH 31H 30H 34H 2EH 39H 39H 39H 0DH 03H
+ 1 0 4 . 9 9 9 CR ETX
(Example of Response 1) For CD4A-L
For +25.00000, +25.00005, +25.00009, +25.06002,
02H 2BH 32H 35H 2EH 30H 30H 30H 30H 30H 0DH
STX + 2 5 . 0 0 0 0 0 CR
2BH 32H 35H 2EH 30H 30H 30H 30H 35H 0DH
+ 2 5 . 0 0 0 0 5 CR
2BH 32H 35H 2EH 30H 30H 30H 30H 39H 0DH
+ 2 5 . 0 0 0 0 9 CR
2BH 32H 35H 2EH 30H 36H 30H 30H 32H 0DH 03H
+ 2 5 . 0 6 0 0 2 CR ETX
CENTER Use to record the phenomenon before and after triggering.
Until the trigger occurs, the state keeps recording into the buffer. Once the trigger
occurs, another recording to the buffers of half size of buffer size is performed.
Then recording stops.
Thus, the following is the time from the trigger enters until the recording all buffer is
completed:
100[μsec] x Buffer Record Cycle x (Buffer Size [number] ÷ 2)
(However, in the case the data for buffer is A&B, the buffer size is 1/2.)
When recording all buffers is completed, the PC receives the response ">" from
CD4.
The buffer is held until the readout is completed.
The data is read out from the oldest one.
Trigger
Measurement Data
(In this figure,
the buffer rate is
1/2.)
Buffer
BUFFER( )TRIGGER STX and ETX are omitted in this example. The space (20H) is
shown as ( ) for conveniencw.
When using the trigger from the external terminal, be sure to turn OFF the hold settings
(HEAD A, HEAD B, and the calculation result).
(They cannot be used with the hold function at the same time.)
You can run on the CD4 main unit or by transmitting the following command.
Transmission Reception
Command Meaning Response Meaning
BUFFER( )SIZE( )500 Select 500 buffers. > Completion of setting
BUFFER( )SIZE( )2000 Select 2000 buffers. > Completion of setting
BUFFER( )SIZE Readout the buffer size. 2000 Set to 2000 buffers.
Trigger
(In this figure,
the buffer rate is
Buffer
1/2.)
The number set in the buffer size
BEFORE Use to record the phenomenon before triggering.
Until the trigger occurs, the state keeps recording into the buffer. Once the trigger
occurs the record to the buffer stops.
Thus, the buffer recording is completed just after the trigger enters.
Then the PC receives the response ">" from CD4.
Normally, the buffer becomes full before the trigger enters. In this case, the data is
overwritten from the old one.
The buffer is held until the readout is completed after the trigger enters.
The data is read out from the oldest one.
Measurement Data
Trigger
(In this figure,
Buffer
the buffer rate is
1/2.)
The number set in the buffer size
The trigger mode can be selected from 3 types. When setting the buffer size to 2000,
2000 data are recorded from the time when a trigger occurs.
2000 data right before the trigger occurred are recorded.
1000 data right before the trigger occurred and the 1000 data after that are recorded.
Follow the following steps for setting and the operation test:
(Example of Command) STX and ETX are omitted in this example. The space (20H) is shown as ( ) for conveniencw.
Transmission Reception
Command Description Response Description
BUFFER( )DATA( )CAL Select the calculated result. > Completion of setting
BUFFER( )DATA( )A&B Select the measurement value of HEAD A and B. > Completion of setting
BUFFER( )DATA( )A Select the measurement value of HEAD A. > Completion of setting
BUFFER( )DATA Readout the data type to record. A Set to HEAD A.
The relationship between Buffer Rate Setting and Buffer Record Cycle is as follows:
Command Buffer Rate Setting Buffer Record Cycle
1 1/1 100[μsec]
2 1/2 200[μsec]
4 1/4 400[μsec]
8 1/8 800[μsec]
16 1/16 1.6[msec]
32 1/32 3.2[msec]
64 1/64 6.4[msec]
128 1/128 12.8[msec]
256 1/256 25.6[msec]
512 1/512 51.2[msec]
1024 1/1024 102.4[msec]
2048 1/2048 204.8[msec]
4096 1/4096 409.6[msec]
8192 1/8192 819.2[msec]
16384 1/16384 1.6384[s]
32768 1/32768 3.2768[s]
(Example of Command) STX and ETX are omitted in this example. The space (20H) is shown as ( ) for conveniencw.
Transmission Reception
Command Meaning Response Meaning
BUFFER( )RATE( )1 Select 1/1. > Completion of setting
BUFFER( )RATE( )128 Select 1/128. > Completion of setting
BUFFER( )RATE Readout the buffer rate. 128 Set to 1/128.
Example of reading out measurement value and control output
Transmission Reception
Command Meaning Response Meaning
MEASURE( )A Reads out measurement value of HEAD A. CD4A +34.123 + 34.123 mm
MEASURE( )A Reads out measurement value of HEAD A. CD4A-L +34.1230 + 34.1230 mm
MEASURE( )Q1 Reads out control output Q1. ON The output status is ON.
MEASURE( )Q5 Reads out control output Q5. OFF The output status is OFF.
MEASURE( )ALARM_A Reads out output A ON The output status is ON.
MEASURE( )ALARM "ALARM" does not exist in the command list. ? Error
Example of operating control input
Transmission Reception
Command Meaning Response Meaning
HOLD_IN( )ON_A Turn ON HOLD A input. > The status became ON.
HOLD_IN( )OFF_A Turn OFF HOLD A input. > The status became OFF.
ZERO( )A Perform Zero reset of measurement value of HEAD A. > Completion of Zero reset
ZERO( )CAN_A Cancel Zero reset of measurement value of HEAD A. > Completion of cancel of Zero reset
HOLD( )ON_A The combination of "HOLD" and "ON_A" does not exist. ? Error
Example of continuous readout of measurement value
Transmission Reception
Command Meaning Response Meaning
Continuously performs readout of measurement value of HEAD A.
MEASURE( )START_A
See below.
For + 99.999, + 100.000, + 100.001, CD4A
2BH 39H 39H 2EH 39H 39H 39H 0DH
+ 9 9 . 9 9 9 CR
2BH 32H 35H 2EH 30H 30H 30H 30H 35H 0DH
+ 2 5 . 0 0 0 0 5 CR
2BH 32H 35H 2EH 30H 30H 30H 30H 39H 0DH
+ 2 5 . 0 0 0 0 9 CR
Neither STX nor ETX exists.
The transmission speed is 1 character per 5 - 10 ms, regardless the baud rate.
CR(0DH) is inserted between the measurement values or calculation results.
To stop the continuous readout, be sure to use the continuous read out stops, however the
response to the command cannot be buaranteed.
(Example)
25.00101
For the continuous reading out of measurement value, refer to the next section
"Example of continuous reading out of measurement value."
Basically, for the response against the readout command, the string is set as shown in
Command 3 of the command table.
The followings are exceptions:
For the case of numerical value ± 9999.999: CD4A
The total is 6 - 9 characters composed of the sign, 1-4 digit(s) of integer(s), decimal point,
and 3 places of decimals.
(Example)
1 +1.000
100 +100.000
-0.3 -0.300
(Example)
1 +1.0000
10 +10.0000
-0.3 -0.3000
Note that the decimal places are five when reading out the measurement value with the
commands below.
5. Transmission Data Format (Command)
The transmission data (Command) format can be roughly divided into two types, depending
on the presence of Command 3.
The combination of Command 1 and 2 is the setting items. Command 3 is the setting value.
When sending Command 1 or 2 only, the setting value of the setting item is returned as a
response. (Reading out)
To read out (change) the setting item, add and send Command 3 as a setting value.
When written properly, the response ">"(3EH) is returned.
When the command is wrong, the response "?" (3FH) is returned.
Command 3 does not exist in case of control command (operating the control input).
When accepted successfully, the response ">" (3EH) is returned.
When the command was wrong, the response "?" (3FH) is returned.
For the item with "±9999.999," set the value from -9999.999 to +9999.999.
For the item with "0 to 9999.999," set the value from 0 to 9999.999. CD4A
(Valid example) (Invalid example)
+100 100. 00100 (integer digits are five or more.)
0100 100.0 100.0000 (decimal places are four or more.)
100 100.000 + 100 (space between the numerical values)
For the item with "±999.9999," set the value from -999.9999 to +999.9999.
For the item with "0 to 999.9999," set the value from 0 to 999.9999. CD4A-L
(Valid example) (Invalid example)
+10 10. 0010 (integer digits are four or more)
010 10.0 10.00000 (decimal places are five or more)
10 10.0000 + 10 (space between the numerical values)
When ±5.000 is written, set the value from -5.000 to +5.000.
(Valid example) (Invalid example)
+5 5 05 (integer digits are two or more.)
+5.0 5. 5.0000 (decimal places are four or more.)
+5.000 +5 (space between the numerical values)
1. Communication Function of CD4
Connecting the PC and CD4 allows following operations from the PC:
Writing and reading out the setting value
Reading out the measurement value
Reading out the control output status
Operating the control input
Data buffer function
2. Communication Specification
Communication method RS-232C
Synchro system Asynchronous
Baud rate 9600/19200/38400/115200 bps
Transmission code ASCII
Data length 7/8 bit
Stop bit length 1 bit
Parity check Nil/Even number/Odd number
Data classification STX ETX
The underlined setting is the factory defaults of CD4.
Adjust the communication setting of PC and CD4 within the the range shown in the above table.
Set the CD4 setting at 14 .RS232C in the SET mode.
3. Communication Procedure
When the PC sends a command to CD4, CD4 sends a response to the PC.
Basically, there is one response per command.
When sending a command, be sure to send after receiving the response of the previous
command.
PC
Command Command
CD4
Response
However,
The stop command can be sent while performing the continuous reading out of
measurement value. ( 7. Example of Commands and Responses)
In the Data Buffer Function, receives the response ">" when the buffer record is completed.
( 8. Data Buffer Function)
For details, refer to the relevant item.
4. Connecting to PC
Use the RS232C cable (Straight, 9 pin female, 9 pin female).
PC RS-232C D-sub9pin CD4
Straight Cable
1 DCD 1
2 RXD 2
3 TXD 3
4 DTR 4 4 & 6, and 7 & 8 are
5 SG 5 connected inside CD4.
6 DSR 6
7 RTS 7
8 CTS 8
9 RI 9
Amplifier Instruction Manual
(Communication Version)
Displacement Sensor CD4 Series
CD4A-N/CD4A-P/CD4A-LN/CD4A-LP
Laser Type
Manufactured
607-8085 andYamashina,
Kyoto, sold by Takehanadounomaecho 46-1, JAPAN
TEL: +81-(0)75-594-8123
FAX: +81-(0)75-594-8124
607-8085 Kyoto, Yamashina, Takehanadounomaecho 46-1, JAPAN
Shinjuku Green Tower Building 27F 6-14-1 Nishishinjuku Shinjuku
TEL: +81-(0)75-594-8123
160-0023 Tokyo
FAX: +81-3-3344-5770
TEL: +81-(0)75-594-8124 FAX: +81-3-3344-3367
Shinjuku Green Tower Building 27F 6-14-1 Nishishinjuku Shinjuku
Website : http://www.optex-fa.com
160-0023 Tokyo
TEL: +81-3-3344-5770 FAX: +81-3-3344-3367
Website : http://www.optex-fa.com