#include "fwlib32.h" or "fwlib64.h"FWLIBAPI short WINAPI eth_rdparam(unsigned short FlibHndl, short type, OUT_ETHPRM *param);
Arguments
FlibHndl
[ in ]
Specify the library handle. See "Library handle" for details.
type
[ in ]
Specify the kind of to be received parameters.
Kind of a parameter to be received is as follows.
Embedded Ethernet[Internal port]
1
:
Common parameter
2
:
FOCAS2/Ethernet parameter
3
:
FTP Transfer parameter
Embedded Ethernet[PCMCIA LAN Card]
21
:
Common parameter
22
:
FOCAS2/Ethernet parameter
23
:
FTP Transfer parameter
Fast Ethernet board or Fast DATA SERVER board
41
:
Common parameter
42
:
FOCAS2/Ethernet parameter
44
:
DATA SERVER parameter
param
[ out ]
Pointer to the OUT_ETHPRMFLAG structure that stored parameters received.
The OUT_ETHPRMFLAG structure is as follows.
typedef struct _out_ethprm {
unsigned short Option;
short Type;
short Dhcp;
short ValidDevice;
short DtsvrChannel;
short Storage;
union {
COMMON_PRM common;
FOCAS2_PRM focas2;
FTPTRANS_PRM ftpTrans;
DTSVR_PRM dataServer;
} prm;
} OUT_ETHPRM;
typedef struct _common_prm {
char OwnMacAddress[13];
char OwnIpAddress[40];
char SubNetmask[16];
char RouterIpAddress[40];
char DnsServer1IpAddress[40];
char DnsServer2IpAddress[40];
char OwnHostName[32];
char OwnDomain[63];
} COMMON_PRM; /* Common parameter */
typedef struct _focas2_prm {
unsigned long TcpPort;
unsigned long UdpPort;
unsigned long TimeInterval;
} FOCAS2_PRM; /* Parameter for FOCAS2/Ethernet */
typedef struct _ftptrans_prm {
FTP_CLIENT_PRM opposite[3];
} FTPTRANS_PRM; /* Parameter for FTP transfer */
typedef struct _dtsvr_prm {
FTP_CLIENT_PRM opposite[3];
FTP_SERVER_PRM own;
} DTSVR_PRM; /* Parameter for DATA SERVER */
typedef struct _ftp_client_prm {
char HostName[64];
unsigned long ControlPort;
unsigned long Dummy;
char UserName[32];
char Password[32];
char LoginDirectory[128];
} FTP_CLIENT_PRM;
typedef struct _ftp_server_prm {
char UserName[32];
char Password[32];
char LoginDirectory[128];
} FTP_SERVER_PRM
Option
Option
bit 0
:
Diplaying function is valid.
bit 1 - bit 15
:
reserve
Type
Kind of parameter received
Dhcp
Valid/Invalid flag for DHCP client
0
:
DHCP client is invalid.
1
:
DHCP client is valid.
ValidDevice
Valid device for Embedded Ethernet
0
:
None
1
:
Internal port
2
:
PCMCIA LAN Card
4
:
Internal port(WinCE)
5
:
PCMCIA LAN Card(WinCE)
DtsvrChannel
Valid channel number for DATA SERVER
Range) 1 - 10
Storage
Storage used by DATA SERVER
0
:
None
2
:
ATA Card
prm.common.OwnMacAddress
MAC Address on CNC
The Ascii string less than 13 characters which included NULL.
Ex) "080019123456"
prm.common.OwnIpAddress
IP Address on CNC
The Ascii string less than 40 characters which included NULL.
Ex) "192.168.0.100"
prm.common.SubNetmask
Subnet mask
The Ascii string less than 16 characters which included NULL.
Ex) "255.255.255.0"
prm.common.RouterIpAddress
Router's IP Address
The Ascii string less than 40 characters which included NULL.
Ex) "192.168.0.253"
prm.common.DnsServer1IpAddress
Dns Server IP Address
The Ascii string less than 40 characters which is included NULL.
Ex) "192.168.0.252"
prm.common.DnsServer2IpAddress
Alternative Dns Server IP Address
The Ascii string less than 40 characters which is included NULL.
Ex) "192.168.0.251"
prm.common.OwnHostName
Host Name on CNC
The Ascii string less than 32 characters which is included NULL.
However, max size is 64 characters which add OwnHostName length to OwnDomain length.
Ex) "cnc"
prm.common.OwnDomain
Domain name
The Ascii string less than 63 characters which included NULL.
However, maximum size is 64 characters which add OwnHostName length to OwnDomain length.
Ex) "factory"
prm.focas2.TcpPort
Port number for TCP
Used by FOCAS2/Ethernet
Range 5001,..,65535 or 0
Ex) 8193
prm.focas2.UdpPort
Port number for UDP
Range 5001,..,65535 or 0
Ex) 8192
prm.focas2.TimeInterval
Time interval which is transfered by broardcast frame (Unit:10ms)
Range 10,..,65535 or 0
Ex) 50
prm.ftpTrans.opposite[n].HostName
Host name or IP address which is assigned to FTP server.
The Ascii string less than 64 characters which is included NULL.
n range(0,..,2)
0
:
Connection one
1
:
Connection two
2
:
Connection three
Ex) "ftp.factory" or "192.168.0.250"
prm.ftpTrans.opposite[n].ControlPort
Control port number which is assigned to FTP server.
n range(0,..,2)
0
:
Connection one
1
:
Connection two
2
:
Connection three
Range 1,..,65535
Ex) 21
prm.ftpTrans.opposite[n].UserName
User name to login the FTP server.
The Ascii string less than 32 characters which is included NULL.
n range(0,..,2)
0
:
Connection one
1
:
Connection two
2
:
Connection three
Ex) "user"
prm.ftpTrans.opposite[n].Password
Password to login the FTP server.
Always string for "***" is always readable.
n range(0,..,2)
0
:
Connection one
1
:
Connection two
2
:
Connection three
prm.ftpTrans.opposite[n].LoginDirectory
Folder name which is able to login the FTP server.
The Ascii string less than 128 characters which is included NULL.
n range 0,..,2
0
:
Connection one
1
:
Connection two
2
:
Connection three
Ex) "/ncdata"
prm.dataServer.opposite[n].HostName
Host name or IP address which is assigned to DATA SERVER.
The Ascii string less than 64 characters which is included NULL.
n range(0,..,2)
0
:
Connection one
1
:
Connection two
2
:
Connection three
Ex) "ftp.factory" or "192.168.0.250"
prm.dataServer.opposite[n].ControlPort
Control port number which is assigned to DATA SERVER.
n range(0,..,2)
0
:
Connection one
1
:
Connection two
2
:
Connection three
Range 1,..,65535
Ex) 21
prm.dataServer.opposite[n].UserName
User name to login the DATA SERVER.
The Ascii string less than 32 characters which is included NULL.
n range(0,..,2)
0
:
Connection one
1
:
Connection two
2
:
Connection three
Ex) "user"
prm.dataServer.opposite[n].Password
Password which is assigned to DATA SERVER.
Always string for "***" is gotten.
n range(0,..,2)
0
:
Connection one
1
:
Connection two
2
:
Connection three
prm.dataServer.opposite[n].LoginDirectory
Folder name which can be able to login the DATA SERVER.
The Ascii string less than 128 characters which is included NULL.
n range(0,..,2)
0
:
Connection one
1
:
Connection two
2
:
Connection three
Ex) "/ncdata"
prm.dataServer.own.UserName
User name which FTP client is able to login.
The Ascii string less than 32 characters which is included NULL.
Ex) "user"
prm.dataServer.own.Password
Password which FTP client is able to login.
Always set "***" symbol.
prm.dataServer.own.LoginDirectory
Folder name which FTP client is able to login.
The Ascii string less than 128 characters which is included NULL.
Ex) "/ncdata"
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.
20
:
Embedded Ethernet is not available.
22
:
The option board is not available.
23
:
Ethernet Function is not available.
24
:
The DATA SERVER function is not available.
EW_FUNC (1)
Function Error
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.
10
:
Reading from File SRAM is failed.
12
:
Reading from DHCP Server is failed.
EW_DATA (5)
Data error
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.
2
:
Out of range.
The following details status will be set onto the member, err_dtno of ODBERR structure.