F153_RMWT

Write data into the slave station

This instruction writes data into the specified intelligent unit of the MEWNET-F slave station.

Parameters

Input

s1_Control (DWORD)

Stores control data for master/slave configuration

s2_Start (WORD, INT, UINT)

Starting 16-bit area in CPU where words are read

n_Number (INT)

Number of words to be read and then written to the slave unit (max. 32 words)

d_Start (WORD, INT, UINT)

Starting memory address number in the intelligent unit where words are written

The variables s2_Start and d_Start have to be of the same data type.

Remarks

Please refer to F152_RMRD

s1_Control stores the control data for the configuration of the master and slave units in the network. n words, beginning at the address in the CPU specified by s2_Start, are written to the intelligent unit of the slave unit beginning at the shared memory address number specified by d_Start.

Specifications of s1_Control:

  1.  (1) s1 higher word
  2.  (2) Bit
  3.  (3) s1 higher word
  4.  (4) Bank No. (16#00–16#FF if there is a bank to specify, otherwise 16#00)
  5.  (5) Slot No. (16#00–16#1F, FP3: 16#00–16#17)
  6.  (6) s1 lower word
  7.  (7) s1 lower word
  8.  (8) Master station No.(16#01–16#04)
  9.  (9) Slave station No. (16#01–16#20)
Tip

Intelligent unit with bank: FP3 expansion data memory unit

Order number: AFP32091 AFP32092

Error flags

sys_bIsOperationErrorHold (turns to TRUE and remains TRUE)
  • if the control data s1_Control exceeds the limit of specified range

  • if no MEWNET-F master unit is found

  • if the data read exceeds the area of s2_Start

sys_bIsOperationErrorNonHold (turns to TRUE for one scan)
  • if the control data s1_Control exceeds the limit of specified range

  • if no MEWNET-F master unit is found

  • if the data read exceeds the area of s2_Start

Example

POU header

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.

  1.  (1) Master station 1
  2.  (2) Intelligent unit (shared memory)
  3.  (3) Control data = 16#A0105
	VAR
		Start: BOOL:=FALSE;
		ControlData: DWORD:=16#2020A;
			(*No bank, 
slot no. 2, 
Master station 2, 
Slave station 10*)
		StartingAddress: WORD:=30;
		NoWordsWrite: INT:=10;
		WordsWritten: ARRAY [0..14] OF WORD:=[15(0)];
	END_VAR

LD body

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_F,F153_RMWT,,10,0,19,7,,?DEN?D@'s1'?Ds2?Dn?Dd?AENO);
B(B_CONTACT,,Start,4,1,6,3,);
B(B_VARIN,,ControlData,8,2,10,4,);
B(B_VARIN,,StartingAddress,8,3,10,5,);
B(B_VARIN,,NoWordsWrite,8,4,10,6,);
B(B_VARIN,,WordsWritten[0],8,5,10,7,);
L(1,0,1,7);
L(1,2,4,2);
L(6,2,10,2);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

Modified on: 2024-03-06Feedback on this pagePanasonic hotline