I have looked through the other posts searching for “modbus S7”.
The following variants of the CP 341 communication processor are available:
CP 341-RS 232C 6ES7341-1AH02-0AE0 RS 232C interface
CP 341-20mA-TTY 6ES7341-1BH02-0AE0 20mA-TTY interface
CP 341-RS 422/485 6ES7341-1CH02-0AE0 X27 (RS 422/485) interface
I am using the following items:
1) CP 341-RS 232C 6ES7341-1AH02-0AE0 (slave mode, no dongle)
2) 313C S7 PLC
3) Dell laptop with WinCC and S7
4) Straight through 9 conductor DB9 serial cable with null modem.
I am using the example given in the new examples loaded with the software CD that comes with the com module.
C:\Program Files\Siemens\Step7\EXAMPLES\zXX21_01_PtP_Com_CP3x
I copied these blocks and source code and edited the hardware config to match my PLC and set the com port on the PC to match the com module on the PLC.
9600 8,n,1,even (the parameter setup in the PLC module is all in German for some reason while everything else is in English.)
I found this PDF instruction to be amazing. So clear and well documented.
CP 341 - First Steps in Commissioning
Getting Started, 09/2008, A5E02291899-01 5
At the end of this beautiful setup instruction, I should have some communication.
But I do not.
I loaded the example. I feel I understand the example (even though it could be simplified)
But no go.
What is so bad about this is, I have no idea what question to ask.
Can I use WinCC and my Laptop PC as a simple modbus master? I was thinking of using a simple HMI screen with runtime WinCC to test some data display from the PLC instead of using “terminal”.
I found the pin out in the documentation. It seems like a null modem should work here.
I deleted everything and started over several times.
I must be missing something.
Is it common practice in STL to move parameters into a FC through a DB as in the example? Looks like it would be easier to just put the variable after the equal sign directly.
Original example code:
L 256 //LADDR
T "SEND WORK DB".P_SND_RK_WORK_LADDR
L 42 //DB_NO
T "SEND WORK DB".P_SND_RK_WORK_DB_NO
T "SEND SRC DB".P_SND_RK_DB_NO
L 0 //DBB_NO
T "SEND WORK DB".P_SND_RK_WORK_DBB_NO
T "SEND SRC DB".P_SND_RK_DBB_NO
L 115
T "SEND WORK DB".P_SND_RK_WORK_LEN //LEN
T "SEND SRC DB".P_SND_RK_LEN //LEN
CALL "RECV"
// ------------------------
// SEND with Instance-DB
// ------------------------
CALL "P_SND_RK" , "SEND IDB"
SF :='S'
REQ :="SEND WORK DB".P_SND_RK_REQ
R :="SEND WORK DB".P_SND_RK_R
LADDR :="SEND WORK DB".P_SND_RK_WORK_LADDR
DB_NO :="SEND WORK DB".P_SND_RK_WORK_DB_NO
DBB_NO :="SEND WORK DB".P_SND_RK_WORK_DBB_NO
LEN :="SEND WORK DB".P_SND_RK_WORK_LEN
R_CPU_NO:=
R_TYP :=
R_NO :=
R_OFFSET:=
R_CF_BYT:=
R_CF_BIT:=
DONE :="SEND WORK DB".P_SND_RK_DONE
ERROR :="SEND WORK DB".P_SND_RK_ERROR
STATUS :="SEND WORK DB".P_SND_RK_WORK_STATUS
The following variants of the CP 341 communication processor are available:
CP 341-RS 232C 6ES7341-1AH02-0AE0 RS 232C interface
CP 341-20mA-TTY 6ES7341-1BH02-0AE0 20mA-TTY interface
CP 341-RS 422/485 6ES7341-1CH02-0AE0 X27 (RS 422/485) interface
I am using the following items:
1) CP 341-RS 232C 6ES7341-1AH02-0AE0 (slave mode, no dongle)
2) 313C S7 PLC
3) Dell laptop with WinCC and S7
4) Straight through 9 conductor DB9 serial cable with null modem.
I am using the example given in the new examples loaded with the software CD that comes with the com module.
C:\Program Files\Siemens\Step7\EXAMPLES\zXX21_01_PtP_Com_CP3x
I copied these blocks and source code and edited the hardware config to match my PLC and set the com port on the PC to match the com module on the PLC.
9600 8,n,1,even (the parameter setup in the PLC module is all in German for some reason while everything else is in English.)
I found this PDF instruction to be amazing. So clear and well documented.
CP 341 - First Steps in Commissioning
Getting Started, 09/2008, A5E02291899-01 5
At the end of this beautiful setup instruction, I should have some communication.
But I do not.
I loaded the example. I feel I understand the example (even though it could be simplified)
But no go.
What is so bad about this is, I have no idea what question to ask.
Can I use WinCC and my Laptop PC as a simple modbus master? I was thinking of using a simple HMI screen with runtime WinCC to test some data display from the PLC instead of using “terminal”.
I found the pin out in the documentation. It seems like a null modem should work here.
I deleted everything and started over several times.
I must be missing something.
Is it common practice in STL to move parameters into a FC through a DB as in the example? Looks like it would be easier to just put the variable after the equal sign directly.
Original example code:
L 256 //LADDR
T "SEND WORK DB".P_SND_RK_WORK_LADDR
L 42 //DB_NO
T "SEND WORK DB".P_SND_RK_WORK_DB_NO
T "SEND SRC DB".P_SND_RK_DB_NO
L 0 //DBB_NO
T "SEND WORK DB".P_SND_RK_WORK_DBB_NO
T "SEND SRC DB".P_SND_RK_DBB_NO
L 115
T "SEND WORK DB".P_SND_RK_WORK_LEN //LEN
T "SEND SRC DB".P_SND_RK_LEN //LEN
CALL "RECV"
// ------------------------
// SEND with Instance-DB
// ------------------------
CALL "P_SND_RK" , "SEND IDB"
SF :='S'
REQ :="SEND WORK DB".P_SND_RK_REQ
R :="SEND WORK DB".P_SND_RK_R
LADDR :="SEND WORK DB".P_SND_RK_WORK_LADDR
DB_NO :="SEND WORK DB".P_SND_RK_WORK_DB_NO
DBB_NO :="SEND WORK DB".P_SND_RK_WORK_DBB_NO
LEN :="SEND WORK DB".P_SND_RK_WORK_LEN
R_CPU_NO:=
R_TYP :=
R_NO :=
R_OFFSET:=
R_CF_BYT:=
R_CF_BIT:=
DONE :="SEND WORK DB".P_SND_RK_DONE
ERROR :="SEND WORK DB".P_SND_RK_ERROR
STATUS :="SEND WORK DB".P_SND_RK_WORK_STATUS