Step 7 functions FC1(DP_SEND) and FC2(DP_RECV)

D

Thread Starter

Danrfull

I have a s7-318-dp system with a cp342-5 also being used because my profibus drops went over 126.I want to know how to call the data from the cp342-5 network(approx. 400 input bytes and 350 output bites) into the main program using FC2 (DP_RECV).

Do I call all the data combined or do I call only the 400 input bytes.
 
D

Daniel Chartier

Hello, Dan;
You call all the data from the Profibus network linked to your CP342-5 at once, by calling FC2 in a netweork. You must set up the calls for
FC2 correctly.
The inputs for FC2 are CPLADDR (CP local address: hexadecimal reprentation of the start input address of the CP342-5 (see the HWConfig
editor of your project); if for example this address is 256, the the corresponding hex value is written W#16#100 in Siemens parlance) and
RCVD (recive data: an ANY pointer to a DB that you set-up to retrieve the input data, for example P#DB10.DBX0.0 BYTE 100: a zone of 100
bytes in DB10 starting at byte 0). Outputs of FC2 are bits and words used for comm control.
Now. you need to organize your recieve DB (buffer) so that it is simple for you to recognize the data you are collecting from the network.
All input data will be polled from the network at every FC2 call, no problem. Recognizing the source and effective values of the collected
data is very important; easier to do with symbolic names in the recieve DB. Mix and match the bits, bytes and words of your reiceve DB so as
to establish a correspondence with the I/Os you will find in the HWConfig of your project. Use the different address display tools in the
hardware editor to see what you need to setup.
Hope this helps.
Daniel Chartier
 
T

T.N. Natarajan

FC1 for sending output bytes
This has to be configured through a Datablock. One
Datablock (say DB 50) has to be assigned for this.
You will have create 350 output byte address for
holding that data.
Inthe same way, FC2 has to be called with another data block( say DB 51 where 400 Byte addresses are
to be created)

You will have to handle your data through these datablocks.
 
Top