6F8C0845
101
5.3 Slave Data Input/Output
5
typeRASDT:STRUCT(*RAS information read data*)
RASDAT
:ARRAY[0..255]OF WORD; (*RAS information read data*)
END_STRUCT:
typeTIMEDT:STRUCT(*Time set value*)
YEAR
:INT; (*Year*)
MONTH
:INT; (*Month*)
DAY
:INT; (*Day*)
HOUR
:INT; (*Hours*)
MIN
:INT; (*Minutes*)
SEC
:INT; (*Seconds*)
END_STRUCT:
END_TYPE
(2) Global variable declaration
VAR_GLOBAL
(*========================================================
User variable (S2-type2).var
Applicable controller: S2-type2
Address range: %MW4.0 - %MW4.5119
Explanation: User free use area
-------------------------------------------------------------------------------------------
1999-05-27:
by TOSHIBA :
Greated
========================================================*)
(*Devicenet structure*)
PARA_LOCAL
:typeP_LOCAL; (*Local node parameter set value*)
PARA_SLAVE
:typeP_SLAVE; (*Slave device parameter set value*)
ASREAD_DT
:typeASREADDAT; (*Slave device input data*)
ASWRITE_DT
:typeASWRITEDAT; (*Slave device output data*)
READ_DT
:typeREASDAT; (*Slave device input data*)
WRITE_DT
:typeWRITEDAT; (*Slave device output data*)
RAS_DT
:typeRASDT; (*RAS information read data*)
TIME_DT
:typeTIMEDT; (*Time set value*)
END_TYPE
(3) Definitions of local Variables
(*========================================================
DeviceNet DN611 Sample Program (Slave Data Input/Output)
========================================================*)
VAR_EXTERNAL
PARA_LOCAL
:typeP_LOCAL; (*Local node parameter set*)
PARA_SLAVE
:typeP_SLAVE; (*Slave device parameter set*)
ASREAD_DT
:typeASREADDAT; (*Slave device input data*)
ASWRITE_DT
:typeASWRITEDAT; (*Slave device output data*)
END_VAR
VAR
CH
:WORD; (*Channel specify*)
UNIT
:WORD; (*Unit specify*)
SLOT
:WORD; (*Slot specify*)
START
:BOOL; (*Start switch*)
DUMMY
:BOOL; (*Dummy*)