Send data (MEWNET link)
This instruction sends data to another station through link modules in the network.
Input
32-bit area for storing control data
Starting 16-bit area for storing source data (data area at the source station)
Type of destination operands for storing data in the target station. Be sure to select the area by setting the address 0 (e.g. DT0 or WR0, ...) (data area at the target station)
Starting 16-bit area address for the destination operand specified in d_AdrType (data area at the target station), must be a constant
The variables s2_Start, d_AdrType and d_AdrOffs have to be of the same data type.
Specifications of s1_Control:
s1 higher byte |
s1 lower byte |
|
---|---|---|
1. Link No. selection (LK: 1–3, the station itself) |
1. Word unit send selection |
|
Up to 3 link units can be connected to 1 CPU. |
F = 0 |
Word unit selection |
n2 = 0 |
Set "0" when the word unit is selected |
|
This (LK) selects the source link unit of the three. |
n1 = 11–16 |
Specify the number of words to be sent |
2. Link station No. selection (UN: 1–63, another station) |
2. Bit unit send selection |
|
Up to 63 stations can be connected to 1 link unit. |
F = 1 |
Bit unit selection |
This (UN) then selects the target station No. |
n2 = 0–15 |
Destination bit No. |
n1 = 0–15 |
Source bit No. |
For detailed information, please refer to the relevant technical manual of the intelligent unit.
All input and output variables used for programming this function have been declared in the POU header. The same POU header is used for all programming languages.
VAR
start: BOOL:=FALSE;
(*activates the function*)
specify_value: DWORD:=0;
(*stores the control data*)
send_address: WORD:=0;
(*Starting 16-bit area for
storing source data*)
dest_address: WORD:=0;
(*Type of destination
operands for storing data
in the destination station*)
n: INT:=0;
END_VAR
When the variable start is set to TRUE, the function is carried out.
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 7 ;
NETWORK_BODY
B(B_CONTACT,,start,3,1,5,3,);
B(B_F,F145_SEND!,Instance,9,0,17,7,,?DEN?Ds1_Control?Ds2_Start?Dd_AdrType?Dd_AdrOffs?AENO);
B(B_VARIN,,specify_value,7,2,9,4,);
B(B_VARIN,,send_address,7,3,9,5,);
B(B_VARIN,,dest_address,7,4,9,6,);
B(B_VARIN,,5,7,5,9,7,);
L(1,2,3,2);
L(5,2,9,2);
L(1,0,1,7);
END_NETWORK_BODY
END_NET_WORK
END_BODY
IF start then
F145_SEND( specify_value, send_address, dest_address, 5);
END_IF;