Справочник Пользователя для Mitsubishi Electronics SW2D5C-GTD2-E

Скачать
Страница из 234
7.3   Internal Device Interface Function
7.3.3   GDev_Write (Writing to the internal device)
7 - 7
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.3
GDev_Write (Writing to the internal device)
The following shows details of the GDev_Write function.
(1) Function
Writes to the GOT internal device.
(2) Format
(a) For Visual C++
lReturn = GDev_Write(ulMapPointer, sDevNameID, lDevNum, *lpsDataTable, lDataSize)
(b) For Visual Basic
lReturn = GDev_Read(ulMapPointer, sDevNameID, lDevNum, sDataTable(0), lDataSize)
(3) Explanation
The device values are batch written to the devices specified by sDevNameID and lDevNum for the 
shared memory address specified by ulMapPointer for the number specified by lDataSize.
The device values to be written 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.
(5) Precautions for using the GDev_Write function
The maximum number of data points to be written, that is set for lDataSize, must be specified in the 
following range.
• For bit device (GB) specification
Device number + (Number of data points to be written 16)-1 Terminal device number
• For word device (GD/GS) specification
Device number + Number of data points to be written-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.
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 to be written
Input
lDataSize
long
Number of data points to be written
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 to be written
Input
lDataSize
long
Number of data points to be written
Input