#include "fwlib32.h" or "fwlib64.h"FWLIBAPI short WINAPI cnc_rddsfile(unsigned short FlibHndl, char *dev_name, IN_DSFILE *ds_file_in, OUT_DSINFO *ds_info_out, OUT_DSFILE *ds_file_out);
Arguments
FlibHndl
[ in ]
Specify the library handle. See "Library handle" for details.
dev_name
[ in ]
The pointer of the variable area where the device name to specify is stored is specified.
Specify the device name is as follows:
DATA SERVER
:
"DATA_SV"
DATA SERVER Host
:
"DTSVR_HOST"
Embedded Ethernet
:
"EMB_ETHER"
ds_file_in
[ in ]
The pointer to IN_DSFILE structure which passes the setting value of file information taken out of a connection host.
IN_DSFILE structure is as follows:
typedef struct in_dsfile {
char path[256]; /* Standard File Name */
long fnum; /* Standard File Number */
long offset; /* Offset */
short req_num; /* Request File Number */
short size_type; /* Size Type */
short detail; /* File Detail */
short dummy;
} IN_DSFILE;
DATA SERVER
path
The file name in the ATA card of DATA SERVER used as a standard is set up.
In the ASCII character string ,a ternimus serves as NULL
It sets up NULL, in setting up fnum.
fnum
The file consective numbers in the ATA card of DATA SERVER used as a standard are set up.
It sets up 0, in setting up path.
offset
The difference of the file used as the standard specfied by the head file, path, and fnum of file information which are actury taken out is set up.
req_num
The numder of files of file information to takeout is set up.
req_num can set up to a maximum of 32.
size_type
The data unit of the size of the file information to takeout is set up.
0
:
Page
1
:
Byte
2
:
KByte (1KByte = 1024Byte)
3
:
MByte (1MByte = 1024KByte)
detail
It set up whether comment information is read together for the file information to take out.
0
:
Comment information is not read.
1
:
Comment information is read.
DATA SERVER Host,Embedded Ethernet
offset
The offset value from a head file of the file information to take out is set up.
req_num
The numder of files of file information to takeout is set up.
req_num can set up to a maximum of 32.
detail
Read only the file name or read inclusive the file information is set up for the file information to take out.
0
:
Read only the file name.
1
:
Read inclusive the file information.
ds_info_out
[ out ]
It is a pointer to OUT_DSINFO structure which stores the information on the whole ATA card.
It is a pointer to OUT_DSINFO structure which stores a connection host's file information.
OUT_DSINFO structure is as follows:
typedef struct out_dsinfo {
short type; /* Type */
short dummy;
long fnum; /* Serial Number */
long total; /* Total File Number */
unsigned long remain_h; /* Remains Capacity(Upper) */
unsigned long remain_l; /* Remains Capacity(Lower) */
char dir[256]; /* Current Folder */
} OUT_DSINFO
DATA SERVER
type
The file management format of the ATA card of DATA SERVER is returned.
0
:
CNC file management format
fnum
The serial numbers from the head file of the file stored in the ds_file_out are returned.
In the case of a head file, 1 is returned.
total
The total of folders and files registred into the present current folder are returned.
remain_h
remain_l
The remaining capacity of the ATA card of DATA SERVER is returned per byte.
In the vase of 4Gbyte or less, remain_h is set to 0.
dir
The present folder in the ATA card of DATA SERVER is returned with a full path.
In the ASCII character string ,a ternimus serves as NULL
DATA SERVER Host,Embedded Ethernet
fnum
The serial numbers from the head file of the file stored in the ds_file_out are returned.
In the case of a head file, 1 is returned.
total
The total of folders and files registered into a connection host's current folder are returned.
ds_file_out
[ out ]
The pointer to OUT_DSFILE structure which stores the taken-out file information.
The area which can store the data for the number specified by the variable req_num of Argument ds_file_in is needed.
OUT_DSFILE structure is as follows:
typedef struct out_dsfile {
short year; /* Last Edit Time */
short mon; /* Last Edit Time */
short day; /* Last Edit Time */
short hour; /* Last Edit Time */
short min; /* Last Edit Time */
short sec; /* Last Edit Time */
long size; /* Size */
unsigned long attr; /* Attribute */
char file[36]; /* File Name */
char info[128]; /* Information */
} OUT_DSFILE
DATA SERVER Host,Embedded Ethernet
year
Last Edit Year
In the case of the folder, it is invalid.
mon
Last Edit Month
In the case of the folder, it is invalid.
day
Last Edit Day
In the case of the folder, it is invalid.
hour
Last Edit Hour
In the case of the folder, it is invalid.
min
Last Edit Minutes
In the case of the folder, it is invalid.
sec
Last Edit Seconds
In the case of the folder, it is invalid.
size
Not uned.
File Size
Only in the case of a file it is effective.
The value of the data unit specified by size_type returns.
attr
The attribute which shows a File or Folder.
The 31th bit
:
Always "1"
The 30th bit
:
File or folder
0:folder
,1:File
The 3rd bit
:
Binary
0:Textry
,1:Binary
The 0th bit
:
Prohibition of edit
0:Possible
,1:Prohibition
Bits other than the above-mentioned are irregular.
file
File/Folder Name.
Maximum of 33 characters of ASCII character string including NULL, a terminus serves as NULL.
info
The contents of the comment sentence immediately after a program number are stored.
Maximum of 78 characters of ASCII character string, a terminus serves as NULL.
When a comment sentence does not exist, the craracter string for 78 characters is returned from the head of the main part of data.
detail is 1 and, only in the case of a file, it is effective.
However, this information does not return about the file which has been selected as the main program.
DATA SERVER Host,Embedded Ethernet
file
The file name for operation is returned.
Maximum of 33 characters of ASCII character string including NULL, and place the NULL at the end.
It becomes effective only when 1 is specified to be detail variable of argument ds_file_in.
info
The file name for a display or the string of file information is returned.
Maximum of 128 characters of ASCII character string including NULL, and place the NULL at the end.
When 0 is specified to be a detail variable of argument ds_file_in,only the file name returns.
When 1 is specified to be a detail variable of argument ds_file_in,the file information returns.
Return
EW_OK is returned on successful completion, otherwise any value except EW_OK is returned.
The major error codes are as follows.
Return code
Meaning/Error handling
EW_NOOPT (6)
No option
In order to get more information for this err_no return value, execute cnc_getdtailerr() function.
The following details status will be set onto the member, err_no of ODBERR structure.
22
:
The option board is nothing
24
:
The DATA SERVER function is nothing.
26
:
The ATA Card is nothing.
EW_BUSY (-1)
Busy
DATA SERVER or embedded Ethernet is processing.
EW_LENGTH (2)
Data block length error
The Specification of req_num is wrong.
EW_NUMBER (3)
Data number error
The Specification of size_type, detail is wrong.
EW_DTSRVR (14)
DATA SERVER error
In order to get more information for this err_no return value,In order to get more information for this err_no return value,cnc_getdtailerr() function.
The following details status will be set onto the member, err_no of ODBERR structure.
DATA SERVER
464
:
The ATA card is not formated.
DATA SERVER Host,Embedded Ethernet
468
:
Connection host is not found.
501
:
Acquision of file information went wrong from the host computer.