Programming
CP1413plus manual
7-82
Rev. 00/07
7.6.3.3.4 Write Passive
#include <S5ACCESS.H>
USHORT WENTRY_C S5WritePassiv(S5_PARAMS W_POINTER s5,
void(WENTRY_C *UserFctCall)(S5_PARAMS W_POINTER s5))
The S5WritePassiv function accepts the data that was sent by an active write from the remote station.
Parameters
s5
pointer to a structure of the type
S5_PARAMS
. The remote station
has supplied the values
Kennung, DB, DW
and
Len
of the
s5
structure.
s5
must contain a valid connection number which was returned by
the function
S5StarteVerbindung
.
In this case the type of connection in
H1_CONNECT_PARAMS
must be set to
NORMAL_LINE|PASSIV_LINE
.
Any data must be entered into a memory allocation located after the
s5 structure. You should allocate the maximum amount of memory
required for the requested data before calling the function. If the
amount of data referenced by
s5
is not available before the
function is initiated you may reallocate memory once the amount
has become available.
The function will either return a 0 or an H1 error.
Tab. 7-9 contains an overview of the H1 errors and their
description.
UserFctCall
pointer to the call-back function. Once the request has been
received from the remote station the requested data is supplied to
this function. The requested data is located in
Kennung, DB,
DW,
and
Len
of the
s5
structure that the initial function call
referred to. If the request from the remote station is not valid the
function will not be initiated and
S5WritePassiv
is terminated
by an error. The remote station can be informed of errors (e.g.
invalid data requested) by means of
Fehler
in the call-back
function. Any errors are returned to the requesting remote station as
S5 error code, otherwise data will be returned. The data must be
located in memory after the
s5
structure. During the transfer the
data bytes will be reversed. The caller must supply the data by
means of references contained in
DB, DW a
nd
Kennung
. The
length of data is calculated from
Kennung
and
Len.
The User-Function is defined as follows:
S5PARAMS W_POINTER WENTRY_C UserCallback(
S5PARAMS W_POINTER s5);
Summary of Contents for CP 1413plus
Page 2: ...jkjlj...
Page 8: ...Contents CP1413plus manual iv Rev 00 07...
Page 10: ......
Page 16: ...Special features CP1413plus manual 1 6 Rev 00 07...
Page 18: ......
Page 38: ...Standards and specifications CP1413plus manual 2 20 Rev 00 07...
Page 40: ......
Page 104: ...Entry into protocol file H1PROT_NIF CP1413plus manual 3 64 Rev 00 07...
Page 106: ......
Page 178: ...PLC Layer 7 program interface CP1413plus manual 4 72 Rev 00 07...
Page 180: ......
Page 194: ......
Page 206: ...ksdjfk...
Page 306: ......
Page 317: ...Appendix A Technical data A 1 B Abbreviations B 1 C List of figures C 1 D Index D 1...
Page 318: ...dfgdfgfdg...
Page 324: ...List of figures CP1413plus manual C 2 Rev 00 07...