SIEMENS RK512 Communication Drive

 

SIEMENS RK512 is driver to communicate with PLC of SIEMENS Corp., in Germany as serial ( RS-232C, RS-422/485 ) communication.

 

Note)  For using SIEMENS RK512 drive, communication module such as CP 341 etc should be installed at CPU of S7-300 compatible model.

SIEMENS RK512 protocol can read/write the PLC memory normally, when PLC is RUN status.

 

1. Read settings

 

<Figure 1> is read setting example of SIEMENS RK512 communication driver.

<Figure 1> Read setting example of SIEMENS RK512

Device part of  <Figure 1> input Com Port(COM1), Com Baud(9600), Parity Bit(2), Data Bit(8), Stop Bit(1) respectively, according to device.

Also, input whether to use BCC( 1 : Use, 0 : Not use ) at Option part.

 

Reference) Whether to use Com Baud, Parity Bit, Data Bit, Stop Bit, CRC and etc are set by SIEMENS LADDER Program. ( Refer to 4 paragraph )

 

Read schedule example)

READ STATION Read Command Read Start Address Save Start Address Read Size
READ, 0, DB11.W, 0, 0, 50,
READ, 0, DB11.W, 100, 50, 50,
DWORD, 0, DB12.D, 0, 0, 100,
FLOAT, 0, DB2.F, 0, 0, 30,
FLOAT, 0, DB2.F, 50, 50, 20,
READ, 0, I, 0, 100, 16,

1) STATION : Station number( 0 ~ 15) of SIEMENS RK512 device

RS-232C : Use no.0, no.1, no.2, no.3, no.4 or no.15.

2) Read Command : Command type to read. ( Refer to <Table 1> )

DB, XB, I, Q, F, P, C, T, S, B

3) Read Start Address : Read start address according to read command. ( 0 ~ 255 or 0 ~ 127 : DWORD, FLOAT unit )

DB, XB area : W – Word unit ( Default : In case of omitting unit ), D : DWORD unit, F : FLOAT unit,

I, Q, F, P area : Byte unit,

C, T, S, B area : Word unit.

4) Save Start Address : Buf position to save the read status value.

5) Read Size : Number of data to read. ( 1 ~ 512 )

Read Command

Contents

Command Type

Remarks

DB

Data Block

DBxx, DBxx.W, DBxx.D, DBxx.F

xx = DB number,

W = Word unit,

D = Dword unit,

F = Float unit

XB

Extended Data Block

XBxx, XBxx.W, XBxx.D, XBxx.F

I

Input Bytes

I

Byte unit address and read size

Q

Output Bytes

Q

F

Flag Bytes

F

P

I/O Bytes

P

C

Counters

C

Word unit address and read size

T

Timers

T

S

Absolute Addresses

S

B

System Addressed

B

<Table 1> Default Read/Write command and contents of SIEMENS RK512

Importance) DB number of DB and XB area which can be read at SIEMENS RK512 Communication driver is between 1 and 255.

Also, You have to create memory of DB and XB area by using LADDER program, and set the data size, data type(WORD, DWORD, REAL ( FLOAT ) etc) and etc by using LADDER.

 

If you click the icon  in protocol option part, you can see the dialog box such as <Figure 2>. You can also set read schedule by using this part.

<Figure 2> Example of SIEMENS RK512 driver's Option dialog box
It is possible to set whether to use BCC at 'Using BCC (3964R)' area of <Figure 2>.

You can set read schedule by using , , button and listbox of <Figure 2>.

<Figure 3> Example of SIEMENS RK512 driver's read schedule Add/Edit dialog box

When you click Add button or Edit button in dialog box of <Figure 2>, dialog box of <Figure 3> is shown.

 

2. Writing settings

You can read/write data by using digital/analog writing command.

 

Digital Write

You can read data and control as bit unit by using digital writing.

 

Digital write setting parameters are as follows :

1) PORT           Port number where SIEMENS RK512 communication driver is set.

2) STATION      Station number of SIEMENS RK512 device ( 0 ~ 15).

RS-232C : Use 0, 1, 2, 3, 4 or no.15.

3) Address      Memory address to output

High digit : Word (DB, XB, C, T, S, B ) or Byte ( Q, F, P ) unit address,

Sub 1 digit : 0 ~ F or 0 ~ 7 Bit position

4) Extra1          Read/Write command. ( Refer to <Table 1> )

DB, XB, Q, F, P, C, T, S, B

5) Extra2          Don't care

 

Write example 1)

Station : 0  Address : 0050  Extra1 : DB11.W, EXTRA2 : Blank

If you set as above and write digital value, you can control( ON/OFF ) no.0 Bit of no.5 WORD( 6th ) for no.0 SIEMENS PLC DB11 memory.

 

Write example 2)

Station : 0  Address : 018F  Extra1 : DB100.W, EXTRA2 : Blank

If you set as above and write digital value, you can control( ON/OFF ) no.F( 16th ) Bit of no.18 WORD( 19th ) for no.0 SIEMENS PLC DB100 memory.

 

Analog Write

You can memory value of DB and etc as WORD, DWORD and FLOAT unit by using analog writing.

 

Analog write setting parameters are as follows :

1) PORT           Port number where SIEMENS RK512 communication driver is set. ( 0 ~ 255 )

2) STATION      Station number of SIEMENS RK512 device ( 0 ~ 15).

RS-232C : Use 0, 1, 2, 3, 4 or no.15.

3) Address      Memory address to output. (0 ~ 255 or 0 ~ 127 : In case of DWORD and FLOAT unit )

Byte unit address : Q, F, P memory type,

Word unit address : DBxx, DBxx.W, XBxx, XBxx.W, C, T, S, B memory type,

Dword unit address : DBxx.D, XBxx.D memory type,

Float unit address : DBxx.F, XBxx.F memory type.

4) Extra1          Read/Write command. ( Refer to <Table 1> )

DB, XB, Q, F, P, C, T, S, B

5) Extra2          Don't care

 

Write example 1)

Station : 0  Address : 0007  Extra1 : DB11.W, EXTRA2 : Blank

If you set as above and write analog value, you can change no.7 WORD( 8th ) value of no.0 SIEMENS PLC DB11 memory as set value.

 

Write example 2)

Station : 0  Address : 0125  Extra1 : DB11.W, EXTRA2 : Blank

If you set as above and write analog value, you can change no.125 WORD( 126th ) value of no.0 SIEMENS PLC DB11 memory as set value.

 

Write example 3)

Station : 0  Address : 0072  Extra1 : DB12.D, EXTRA2 : Blank

If you set as above and write analog value, you can change no.72 DWORD ( 73th ) of no.0 SIEMENS PLC DB12 memory as set value.

 

Write example 4)

Station : 0  Address : 0021  Extra1 : DB13.F, EXTRA2 : Blank

If you set as above and write analog value, you can change no.21 FLOAT ( 22th ) of no.0 SIEMENS PLC DB13 memory as set value. ( Possible to set as decimal point )

 

3. Connection for power and communication cable of SIEMENS PLC

 

Power connection

Connect AC power ( 220 V etc ) to L and N terminal of <Figure 4>.

<Figure 4> Appearance of installed CP341 communication module and etc to SIEMENS PLC
RS-232C communication cable connection

Connect general RS-232C communication cable( CROSS cable ) to RS-232C terminal of CP-341, etc and RS-232C terminal of computer. ( It is possible to use Full wiring and informal wiring)

 

4. Settings for SIEMENS RK512 communication

To communicate RK512 communication by using SIEMENS PLC, you have to set as following items.

1) Edit Hardware installation status at LADDER program. ( Set Power module, CPU, DI, DO, AI, AO, Communication module and etc, at HW Config program )

2) Communication block LADDER program ( Set the RK512 communication as block of OB1, DB and etc )

3) Download the LADDER of written communication block, and etc to PLC and convert PLC switch into RUN status.

 

Reference) Example of RK512 communication block and Hardware Config LADDER program : SIEMENS_RK512.files\cp341sam.zip

 

Setting for communication speed and protocol type

Settings for communication speed and protocol type of communication module are as following order.

1) If you select( double click, etc ) Hardware at LADDER of <Figure 5>, HW Config screen is opened such as <Figure 6>.

2) If you select( double click, etc ) communication module of CP341, etc at <Figure 6>, Properties dialog box is shown such as <Figure 7>.

3) If you press  button at <Figure 7>, protocol setting screen is opened such as <Figure 8>.

4) Set the protocol type as RK512, at <Figure 8>. ( Among 3964R, RK512 and ASCII )

5) If you double click the  figure of <Figure 8>, protocol setting dialog box is shown such as <Figure 9>.

6) Set the Communication speed, Data Bits ( fixed to 8 ), Stop Bits, Parity and etc.

7) 'Whether to use BCC' is decided according to whether to check 'With Block Check' part of <Figure 9>.

<Figure 5> SIEMENS PLC LADDER program
<Figure 6> Example of SIEMENS PLC LADDER program's HW Config part
<Figure 7> Properties dialog box of CP-341-RS-232C communication module
<Figure 8> Protocol setting screen of communication module
<Figure 9> RK512 communication protocol setting dialog box
5. Device which uses SIEMENS RK512 communication protocol

Device which uses RK512 communication protocol of SIEMENS Corp., as follows. For more detailed communication settings about device, refer to detailed description by model.

RC4 detailed communication method of Brabender Technologie Corp.