Simatic SFB14 (GET)

marcius

Member
Join Date
Apr 2007
Location
Klaipeda
Posts
137
I need to read some data from remote S7-400 (CPU414-1) PLC.
Local PLC is S7-400H (CPU412-3H). Comms is established theough ethernet CP 443-1.

If i do like this communication is running and I can read data from remote PLC without errors except that sometimes i get status code 25 (Communication has started. The job is being processed)
A M 0.7
S #PLC_COM.GET_REQ

CALL "GET" , "GET_Instance_DB"
REQ :=#PLC_COM.GET_REQ
ID :=#PLC_COM.ID
NDR :=#PLC_COM.GET_NDR
ERROR :=#PLC_COM.GET_ERROR
STATUS:=#PLC_COM.GET_STATUS
ADDR_1:=P#DB41.DBX2.0 BYTE 2
ADDR_2:=P#DB201.DBX0.0 BYTE 26
ADDR_3:=
ADDR_4:=
RD_1 :=P#DB401.DBX0.0 BYTE 2
RD_2 :=P#DB401.DBX6.0 BYTE 26
RD_3 :=
RD_4 :=

ON #PLC_COM.GET_NDR
O #PLC_COM.GET_ERROR
R #PLC_COM.GET_REQ
I tried to do like this:
AN #PLC_COM.GET_REQ
S #PLC_COM.GET_REQ

CALL "GET" , "GET_Instance_DB"
REQ :=#PLC_COM.GET_REQ
ID :=#PLC_COM.ID
NDR :=#PLC_COM.GET_NDR
ERROR :=#PLC_COM.GET_ERROR
STATUS:=#PLC_COM.GET_STATUS
ADDR_1:=P#DB41.DBX2.0 BYTE 2
ADDR_2:=P#DB201.DBX0.0 BYTE 26
ADDR_3:=
ADDR_4:=
RD_1 :=P#DB401.DBX0.0 BYTE 2
RD_2 :=P#DB401.DBX6.0 BYTE 26
RD_3 :=
RD_4 :=

O #PLC_COM.GET_NDR
O #PLC_COM.GET_ERROR
R #PLC_COM.GET_REQ
This way GET request processed only once i don't understand why because error and status outputs of GET block stays 0, so I think GET request processed succesfully and NDR output should be set to 1(NDR: 0 - Job not started or still active, 1 - Job successfully completed.), but it never goes 1 it stays 0.
 
Thanks for reply, but I think you misunderstood me. I fine with status code 25 I know why it's showing up. It's because I start request while the previous job is still running.

My question really is why NDR never goes 1. According to manual NDR=1 when job completed successfully.
In my case NDR always stays 0 even though ERROR and STATUS remain 0.
 
Give this a try...

Code:
CALL  "GET" , "GET_Instance_DB"
       REQ   :=#PLC_COM.GET_REQ
       ID    :=#PLC_COM.ID
       NDR   :=#PLC_COM.GET_NDR
       ERROR :=#PLC_COM.GET_ERROR
       STATUS:=#PLC_COM.GET_STATUS
       ADDR_1:=P#DB41.DBX2.0 BYTE 2
       ADDR_2:=P#DB201.DBX0.0 BYTE 26
       ADDR_3:=
       ADDR_4:=
       RD_1  :=P#DB401.DBX0.0 BYTE 2
       RD_2  :=P#DB401.DBX6.0 BYTE 26
       RD_3  :=
       RD_4  :=

      A     M      0.7
      S     #PLC_COM.GET_REQ

      O    #PLC_COM.GET_NDR
      O     #PLC_COM.GET_ERROR
      R     #PLC_COM.GET_REQ
Make sure that M0.7 is a one-shot signal.
 
M0.7 is Clock memory bit

Make a rising or falling edge of it.


I use the 500mS clock memory bit for this and it works fine.

Also, don't forget to clear any outstanding GET request on PLC start up (reset #PLC_COM.GET_REQ on first scan).
 
Thank you, krk I modified program as you pointed out.
Now my GET block works good I still sometimes get status code 25, but that's not really a program.

Now I have problem with PUT block I get ERROR and STATUS 4 - "Errors in the send area pointers SD_i involving the data length or the data type."

//CALL "PUT" , "PUT_Instance_DB"
REQ :=#PLC_COM.PUT_REQ
ID :=#PLC_COM.ID
DONE :=#PLC_COM.PUT_DONE
ERROR :=#PLC_COM.PUT_ERROR
STATUS:=#PLC_COM.PUT_STATUS
ADDR_1:=P#DB201.DBX22.0 BYTE 4
ADDR_2:=
ADDR_3:=
ADDR_4:=
SD_1 :="PUT_DB".IU_SetPoint
SD_2 :=
SD_3 :=
SD_4 :=
"PUT_DB".IU_SetPoint (REAL) -> P#DB402.DBX0.0 BYTE 4
I am 100% sure address (P#DB201.DBX22.0 BYTE 4) in remote PLC is correct.
 
I'll take it as given that you have loaded the DB "PUT_DB" to your PLC?

For SD_1, have you tried substituting P#DB402.DBX0.0 BYTE 4 for the symbolic "PUT_DB".IU_SetPoint?
 
Can you post the relevant section of your code (without the hardware config)?
 

Similar Topics

We are facing intermittent issue with emergency stop and line stop. Line stop triggering with alarm of line stop push button activated at one...
Replies
10
Views
190
HI i would like to know how to get a variable that will store the amount of times a program has been executed. The issue is I have 3 DBs for 1 FB...
Replies
2
Views
107
Dear sir, I am using SIMATIC 300, CPU 315-2DP , (6ES7 315-2AF03-0AB0) VIPA 603-1CC21 A1.0 RAM 32KB, Firmware=V4.0.8 The problem Im using MPI...
Replies
2
Views
185
Hi, I received this SIMATIC S7-300 training kit for maintenance. When I power it up, the PLC doesn't go to RUN mode and the STOP mode led is...
Replies
7
Views
320
I'm trying to build my Classic Step 7 programming skills this weekend. I get stuck on little things that are not covered in YouTube tutorials. I'm...
Replies
7
Views
333
Back
Top Bottom