Mitsubishi Electronics SW2D5C-GTD2-E ユーザーズマニュアル
7.3 Internal Device Interface Function
7.3.2 GDev_Read (Reading from the internal device)
7 - 5
1
OV
ER
VI
EW
2
SYS
TEM
CONFIGURA
T
ION
3
SPEC
IFI
CA
TIO
NS
4
SC
R
EE
N
CONF
IGURA
TION
5
O
PERA
T
ING
METHO
D
6
FUNC
TIONS
7
IN
TERN
AL DE
VI
CE
INTERF
ACE
FU
NCTI
O
N
8
TR
OU
BL
ES
HO
O
TI
N
G
A
PPENDICES
7.3.2
GDev_Read (Reading from the internal device)
The following shows details of the GDev_Read function.
(1) Function
Reads from the GOT internal device.
(2) Format
(a) For Visual C++
lReturn = GDev_Read(ulMapPointer, sDevNameID, lDevNum, *lpsDataTable, lDataSize)
(b) For Visual Basic
lReturn = GDev_Read(ulMapPointer, sDevNameID, lDevNum, sDataTable(0), lDataSize)
(3) Explanation
The device values in the area starting from the device specified by sDevNameID and lDevNum are
batch read for the number specified by IDataSize to the shared memory address specified by
ulMapPointer.
The read device values are stored to lpsDataTable or sDataTable.
Specify the shared memory address that has been obtained by the GDev_OpenMapping function.
batch read for the number specified by IDataSize to the shared memory address specified by
ulMapPointer.
The read device values are stored to lpsDataTable or sDataTable.
Specify the shared memory address that has been obtained by the GDev_OpenMapping function.
(4) Return value
Normal termination: "0" is returned.
Abnormal termination: A number other than "0" is returned.
Abnormal termination: A number other than "0" is returned.
(5) Precautions for using the GDev_Read function
The maximum number of data points to be read, that is set for IDataSize, must be specified in the
following range.
following range.
• For bit device (GB) specification
Device number + (Number of data points to be read 16)-1 Terminal device number
• For word device (GD/GS) specification
Device number + Number of data points to be read-1 Terminal device number
In the case of bit device (GB) specification, specify a multiple of 16 for the device number.
Secure the area for lpsDataTable with the same size as lDataSize or more.
If the area is insufficient, an error such as application error may occur.
In the case of bit device (GB) specification, specify a multiple of 16 for the device number.
Secure the area for lpsDataTable with the same size as lDataSize or more.
If the area is insufficient, an error such as application error may occur.
Variable name
Variable type
Description
I/O
lReturn
long
Return value
Output
ulMapPointer
unsigned long
Shared memory address
Input
sDevNameID
short
Device name ID (GB:0/GD:1/GS:2)
Input
lDevNum
long
Device number
Input
*lpsDataTable
short
Device value read
Output
lDataSize
long
Number of data points to be read
Input
Variable name
Variable type
Description
I/O
lReturn
long
Return value
Output
ulMapPointer
unsigned long
Shared memory address
Input
sDevNameID
short
Device name ID (GB:0/GD:1/GS:2)
Input
lDevNum
long
Device number
Input
sDataTable(n)
short
Device value read
Output
lDataSize
long
Number of data points to be read
Input