User Manual

The easy-NET network
12/06 AWB2724-1584GB
86
From the user program to the protocol task:
Send user data via the easy-NET
Local and extended outputs (byQ/byS)
Local and extended inputs (wI/wR)
Send data to a selected station X (aToID[x].dwSN)
Set local outputs of stations without own program
(aToID[x].byQ/aToID[x].byS ). This operation is only possible
from NET-ID1.
Send data with the PUT command (Broadcast).
The NET_UPDATE function must be called once every user cycle.
This ensures that the current data of the easy-NET stations is
always available and that the easy-NET stations are provided with
the current data of the local station.
NET_GET function
This function enables an easy-NET station to fetch a data value
that other easy-NET stations have sent to the bus with the PUT
command.
A data value can be fetched with each call of the NET_GET
function. The byNET_ID and byModulNumber entries of the
EASY_NET_GET structure select the data value “present in the
network”. When the function is called, the protocol task enters the
current data in the structure. Multiple calling of the NET_GET
function enables any number of data values to be read.
Data transfer options
There are three data transfer options:
Data transfer between a PLC (ID1) and remote I/O device,
a page 86
Transfer of bit data blocks between several PLCs, a page 87
Transfer of D words (32-bit) according to the PUT-GET principle
between several PLCs, a page 88
Data transfer between a PLC (ID1) and remote I/O device
The input and output states of PLCs or remote I/O devices can be
read by all other stations. If an easy800 is used as a remote I/O
device, for example, the PLCs on the easy-NET can scan the inputs
of the easy800. The PLC with ID=1 can also set the outputs of the
easy800. This also applies to the easy800 expansion (Exp.).
To set the outputs and scan the inputs of the easy800 (ID2), call
the NET_UPDATE function in the user program of the EC4-200
(ID1) as shown in the following program example.
Enter a pointer at the “pstruNetMain” input to a structure of type
EASY_NET_MAIN declared in the user program. In this structure
enter the transfer data a figure 101.
The value 5 (1 byte) is entered in the program via the structure
variable:
When the EC4-200 PLC is in RUN, the value is transferred to the
outputs of the easy800 after every change.
The 16 inputs of the easy800 are accepted by the PLC with the
structure variables NET_MAIN.RCV[2].wI.
Figure: 98: NET_UPDATE function
Figure: 99: NET_GET function
NET_UPDATE
BYTE byNetDrvNr Net Update BOOL
POINTER TO EASY_NET_MAIN pstruNetMain
NET_GET
BYTE byNetDrvNr Net_Get BOOL
POINTER TO EASY_NET_GET pstruNetGet
Figure: 100: Data transfer between EC4-200 and Remote I/O
NET_MAIN.SND.aToID[2].byQ:=5;