KEYENCE RD Series communication driver is the driver to communicate with length measurement controller of KEYENCE in Japan.
<Figure 1> is read setting example of KEYENCE RD Series communication driver.
<Figure 1> Read setting example of KEYENCE RD Series communication driver |
Device part of <Figure 1> input Com Port(COM1), Baud Rate(9600), Parity Bit(0), Data Bit(8), Stop Bit(1) respectively, according to controller.
In protocol option part, you can set 'Write after delay time'( 0 ~ 5000 , default = 1000 mSec ).
Note) Please refer Chapter 4 the baud rate setting.
KEYENCE RD Series communication driver read schedule
Read schedule setting parameters are as follows:
1) Station – Don't care.
2) Read command – Command = M – read of current measurement.
3) Read start address – Don't care.
4) Save start address for Communication Server – Saving start address of Communication Server.
5) Read Size – Fixed to 1. ( H – 5, M - 1 )
Read schedule example)
READ, 0, M, 0, 0, 1,
KEYENCE RD Series communication driver store the same data in WORD, DWORD, FLOAT, STRING memory, but the data format are different.
If you click the icon in protocol option part at <Figure 1>, you can see the dialog box such as <Figure 2>. you can also set read schedule by using this part.
<Figure 2> Example of KEYENCE RD Series communication driver¡¯s Option dialog box |
You can set read schedule by using , , button and listbox of <Figure 2>.
Also, you can set 'Write after delay time' by using the part of 'Write After Sleep' of <Figire 2>.
<Figure 3> Example of KEYENCE RD Series communication driver¡¯s read schedule Add/Edit dialog box |
When you click Add button or Edit button in dialogue box of <Figure 2>, dialogue box of <Figure 3> is shown.
You can read, write by using 'writing settings'.
Digital Write
Digital write and analog write have the same setting parameters except output value.
Analog Write
Analog write setting parameters are as follows:
1) PORT Port no. (0 ~ 255)
2) STATION Don't care.
3) ADDRESS Data saving start address when M, SR, J0 ~ J17 command. (Read, refer to <Table 1>)
4) Extra1 Command.
M, SR, J0 ~ J17 : read command,
AA0, AA1, ¡¦ : write command. ( refer to <Table 1>)
5) Extra2 Writing value or type of output value when I, SD command.
I : writing Span value. ( -9999 ~ 9999, 0 = don't use writing value )
SD : type of output value. ( 0 = HH value, 1 = HI value, 2 = LO value, 3 = LL value )
Command | Type | Contents |
Remarks |
M | Read | read of measurement value |
can read or write |
SR | setting of judgement value | read of judgement value |
read data, after reading, the readed data save from 'Address ~ ' |
J0 | setting of information | setting of average count/digital filter |
|
J1 | setting of operation mode |
||
J2 | setting of measurement mode |
||
J3 | compare of pre-measured average's use or not use |
||
J4 | use or not use of display digit's decimal point |
||
J5 | number of offset |
||
J6 ~ J13 | setting of 0 ~ 7 offset |
||
J14 | setting of output type |
||
J15 | setting of selection changing |
||
J16 | span value setting of monitor output |
||
J17 | shfit value setting of monitor output |
||
AA0 ~ AA9 | selection of filter | average count 1,4,16,64,256,1024,4096,16384,65536,262144 |
Output value = don't use |
AL0 ~ AL9 | low-pass filter 100,50,20,10,5,2,1,0.5,0.2,0.1 HZ |
||
AH0 ~ AH9 | high-pass filter 100,50,20,10,5,2,1,0.5,0.2,0.1 HZ |
||
B0 ~ B3 | selection of operation mode | X input, Y input, X+Y input, X-Y input |
|
C0 ~ C9 | selection of measure mode | Normal, peak hold, peak hold 2, bottom hold, bottom hold 2, peak to peak hold, peak to peak hold 2, sample hold, auto peak hold, auto bottom hold |
|
D0 ~ D1 | comparision selection of pre-measured average value | not exist, exist |
|
E0 ~ E6 | selection of display | 5 digit, decimal point 4,3,2,none, 4 digit, decimal point 4,3,2 |
|
FD | selection of offset | setting of offset value |
|
F0 ~ F5 | selection of offset 0 ~ 7 |
||
G0 ~ G2 | selection of output type | Normal, hold, off-delay |
|
H0 ~ H1 | selection method of judgement value | front switch, terminal input |
|
I | control of monitor | span and shift value setting of monitor output |
Extra2 = span, Output value = shift |
SD | setting of judgement value | setting of judgement value ( read 'SR' command, after writing ) |
Extra2 = type, Output value = judgement value |
SH | setting of hysteresis |
Output value = 0 ~ 100 |
|
S0 ~ S7 | selection of judgement value | selection of judgement value 0 ~ 7 |
Output value = don't use |
L | settion of MDL function | can use B, P, D, R, C, S, Q, .. command |
L command, L command order = normal mode |
T | timing | timing input ON |
Output value = don't use |
U | timing input OFF |
||
Q | hold reset | hold reset input |
|
V | auto-zero | auto-zero input |
|
W | auto-zero disable |
||
O | setting value | stop of continuous measurement (opposed to N command ) |
|
<Table 1> Read, write command and contents of KEYENCE RD Series communication driver |
Write example 1)
PORT:0, station:0, ADDRESS:0012, Extra1: M, Extra2 : 0
The setting parameter shown above is current measurement reading example. After reading, the readed value save at 12 WORD, FLOAT, DWORD, STRING memory.
Write example 2)
PORT:0, station:0, ADDRESS:0030, Extra1: SR, Extra2 : 0
The setting parameter shown above is judgement value reading example.
After reading, the readed value(judgement number, HH value, HI value, LO value, LL value, hysteresis value) save at 30 ~ 35 WORD, FLOAT, DWORD, STRING memory.
Write example 3)
PORT:0, station:0, ADDRESS:0000, Extra1: AA4, Extra2 : 0
The setting parameter shown above is filter selection setting example to 256.
Write example 4)
PORT:0, station:0, ADDRESS:0000, Extra1: E0, Extra2 : 0
The setting parameter shown above is display type setting example to 5 digit, decimal point 4.
Write example 5)
PORT:0, station:0, ADDRESS:0000, Extra1: I, Extra2 : 1000, Output value = 2000
The setting parameter shown above is span and shift value setting example. The setting value : span value = 1000, shift value = 2000.
Write example 6)
PORT:0, station:0, ADDRESS:0000, Extra1: SD, Extra2 : 0, Output value = 2500
The setting parameter shown above is HH judgement value setting example. The setting value = 2500.
Write example 7)
PORT:0, station:0, ADDRESS:0000, Extra1: SD, Extra2 : 1, Output value = 500
The setting parameter shown above is HI judgement value setting example. The setting value = 500.
Connection of main power and communication cable are as follows.
Connection of main power
Please connect 24V DC power to 25( + 24 V ), 26 ( 0 V ) connector such as <Figure 4>.
<Figure 4> Connection example of communication cable and main power to KEYENCE RD Series |
Connection of RS-232C communication cable
Please connect direct RS-232C communication cable to 25 pin connector( Tx, Rx, Ground ) of KEYENCE RD Series such as <Figure 5>, <Figure 6>.
Computer (9 Pin connector) KEYENCERD Series (25 Pin connector)
2 Pin ------------------------------ 3 Pin
3 Pin ------------------------------ 2 Pin
5 Pin ------------------------------ 7 Pin
<Figure 5> Diagram of RS-232C communication cable( 9 pin connector of computer )
Computer (25 Pin connector) KEYENCE RD Series (25 Pin connector)
2 Pin ------------------------------ 2 Pin
3 Pin ------------------------------ 3 Pin
7 Pin ------------------------------ 7 Pin
<Figure 6> Diagram of RS-232C communication cable( 25 pin connector of computer )
You can set baud rate by using front panel switch. ( refer to <Table 7> )
1) Open cover of front panel.
2) Press 'MODE' button, 'Left' button 2 times and press 'selection(enter)' button. Then, the setting mode equal 'setting of RS-232C communication mode'.
3) Select Baud rate between 300, 600, 1200, 2400, 4800, 9600 by using 'Up', 'Down' button.
4) Press 'selection(enter)' button. Then, you can set Data bit, Parity bit, Stop bit.
5) Select Data bit, Parity bit, Stop bit between 8E2 ~ 8E1 by using 'Up', 'Down' button.
6) Press 'selection(enter)' button.
7) Select Data Separator Character by using 'Up', 'Down' button.( C or E )
8) Press 'selection(enter)' button.
9) Press 'Right' button and 'selection(enter)' button sequentially.( Then, return to measurement mode )
<Figure 7> Appearance of KEYENCE RD Series |