2. How to Read the API Variable List
– 3 –
lpReadData, lReadType
lpWriteData, lWriteType
Store address Data type
for the data indicating
exchanged lpReadData
with the NC or
2.1 API function arguments
It is necessary to designate six arguments for the API functions melReadData() and melWriteData().
Those arguments are sorted into four categories (a)~(d) below and explained. (melReadModal() can
also be used instead of melReadData(), but the explanation here uses melReadData() as an example.
Refer to the "Custom Application Interface Library instruction manual, function section".)
dwStatus = melReadData ( )
dwStatus = melWriteData ( )
(a) (b) (c) (d)
(a) Designate the window handle in the hWnd argument of the melReadData and melWriteData(). For
Visual Basic, this is accomplished by normally describing Me.hWnd. When using Windows API from
Visual C/C++, etc., the CreateWindow() function return value is the window handle. Refer to the
manual in the relevant language for more details.
(b) For the argument lAddress, designate the NC Card, and then designate the axis No. and system
having the data to be read/written. The system designation and axis designation have necessary
and unnecessary data. Refer to the list (system designation, axis designation) in the next chapter for
more information about the system designation and axis designation in each data. For details on
lAddress, refer to "Chapter 1.2 Address designation" of the "Custom Application Interface Library
Guide (Function Section)".
(c) The argument lSectionNum, lSubsectionNum is a number designating data to be read/written. All
data is given unique numbers. Consult the next chapter for the data to be read/written, and
designate the section No. of that data in the argument lSectionNum, and the sub-section No. of that
data in the argument lSubSectionNum.
(d) In the arguments lpReadData, lpWriteData, designate the storage places (addresses) of the data to
be exchanged with the NC. When reading data (lReadData), this address becomes the designation
of the area where the data received from the NC is stored. When writing data (lWriteData), this
address becomes the designation of the place where the data to be transmitted to the NC was
stored. Although data reading and data writing functions differ, the data structure is the same.
Variables such as 1-byte/2-byte/4-byte/integer-type, 8-byte real number type,
binary/decimal/hexadecimal character string type or real number character string type, etc., can be
used. (Refer to Table 2.1)
For the argument lReadType, lWriteType, designate the data type (required data type) that
argument lpReadData, lpWriteData indicates. For example, designate T_SHORT when 2-byte
integer type data was designated in argument lpReadData. Designate T_LONG when 4-byte integer
type data was designated in argument lpReadData. Designate T_FLOATSTR when real number
character string type data was designated in argument lpReadData. (Refer to Table 2.2)
hWnd,
hWnd,
Window
handle
lAddress,
lAddress,
NC,
system,
axis
designation
lSectionNum, lSubSectionNum,
lSectionNum, lSubSectionNum,
Section No. Sub-section No.