横河500接口函数

横河500接口函数
横河500接口函数

3.3 Available Functions (1)

int TmcInitialize( int wire, char* adr, int* id ); (1)

int TmcDeviceClear( int id ); (4)

int TmcSend( int id, char* msg ); (5)

int TmcSendByLength( int id, char* msg, int len ); (5)

int TmcSendSetup( int id ); (6)

int TmcSendOnly( int id, char* msg, int len, int end ); (7)

int TmcReceive( int id, char* buff, int blen, int* rlen ); (7)

int TmcReceiveSetup( int id ); (8)

int TmcReceiveOnly( int id, char* buff, int blen, int* rlen ); (9)

int TmcReceiveBlockHeader( int id, int* length ); (10)

int TmcReceiveBlockData( int id, char* buff, int blen, int* rlen, int* end ); (11)

int TmcCheckEnd( int id ); (12)

int TmcSetRen( int id, int flag ); (13)

int TmcGetLastError( int id ); (13)

int TmcSetTerm( int id, int eos, int eot ); (14)

int TmcSetTimeout( int id, int tmo ); (15)

int TmcFinish( int id ); (16)

int TmcSearchDevices( int wire, DEVICELIST* list, int max, int* num, char* option); (16)

int TmcEncodeSerialNumber(char* encode, size_t len, char* src); (17)

int TmcDecodeSerialNumber(char* decode, size_t len, char* src); (18)

int TmcWaitSRQ( int id, char* stsbyte, int tout); (19)

int TmcAbortWaitSRQ( int id); (19)

int TmcSetCallback(int id, Hndlr func, ULONG p1,ULONG p2); (20)

int TmcResetCallback(int id); (21)

typedef void SRQCALLBACK(int id, UCHAR stb, ULONG p1,ULONG p2); (21)

3.3 Available Functions

---------------------------------------------------------------------------------------------------------------

intTmcInitialize( int wire, char* adr, int* id );

Purpose: Initializes and opens a connection to the specified device

Parameters: intwire connection types

char* adr the address of the connection

int* id special device ID used by other functions

Return value: 0 = OK, 1 = ERROR

Details:

Description of Parameters

int wire

Set this parameter to the type of connection through which the device will be

controlled.

The settings for each type of interface are shown below.

GPIB: wire = TM_CTL_GPIB(1)

RS232: wire = TM_CTL_RS232(2)

USB: wire = TM_CTL_USB(3)

Ethernet: wire = TM_CTL_ETHER(4)

USBTMC(DL9000): wire = TM_CTL_USBTMC(5)

EthernetUDP: wire = TM_CTL_ETHERUDP(6)

USBTMC(excluding DL9000): wire = TM_CTL_ETHERUDP(7)

VXI-11: wire = TM_CTL_VXI11(8)

char* adr

Use a character string to set this parameter to the GPIB address or RS-232

settings of the device to be controlled.

The following shows how the settings for each interface.

GPIB: adr = "1"-"30" (the GPIB address value of the device)

RS232: adr = "port number, baud rate number, bit specification, handshaking number"

port number 1 = COM1

2 = COM2

3 = COM3

baud rate number 0 = 1200

1 = 2400

2 = 4800

3 = 9600

4 = 19200

5 = 38400

6 = 57600

bit specifications 0 = 8 bits, no parity, 1 stop bit

1 = 7 bits, even parity, 1 stop bit

2 = 7 bits, odd parity, 1 stop bit

handshaking number 0 = NO-NO

1 = XON-XON

2= CTS-RTS

USB: adr = "1"-"127" (the unique USB ID for the device)

Ethernet: adr = "server name, user name, password"

sever name The server name or IP address of the DL

user name The user name

password The password

When the user name is anonymous,

a password is not required.

(A delimiting comma "," is required.)

USBTMC(DL9000): adr = "serial number"

Serial number The instrument serial number

USBTMC(GS200 and GS820): adr = "serial number"

Serial number The instrument serial number

USBTMC(GS610): adr = "serial number" + "C"

Serial number The instrument serial number

USBTMC (other than the DL9000 and GS series): adr = the number

encoded by TmcEncodeSerialNumber using "serial number"

Serial number The instrument serial number

VXI-11: adr = "IP address"

int* id

Allocates the device ID passed to each function after initialization to the

storagebuffer.

If initialization succeeds and a connection is opened, an integer equal to

orgreaterthan 0 is returned for the ID.

If initialization succeeds, the return value is 0. If a connection could not be

opened,the return value is 1.

Regardless of the type of connection, the settings below take effect if

initializationis successful.

- Terminator: LF (LF or EOI for GPIB)

- Timeout: 30 seconds

Example:

GPIB address 1:

int id;

int ret = TmcInitialize( TM_CTL_GPIB, "1", &id );

RS232 COM1,57600,8-NO-1,CTS-RTS:

int id;

ret = TmcInitialize( TM_CTL_RS232, "1,6,0,2", &id );

USB ID 1:

int id;

int ret = TmcInitialize( TM_CTL_USB, "1", &id );

Ethernet IP = 11.22.33.44, User name = anonymous

int id;

int ret = TmcInitialize( TM_CTL_ETHER, "11.22.33.44,anonymous,", &id );

Ethernet IP = 11.22.33.44, User name = yokogawa, Password = abcdefgh int id;

int ret = TmcInitialize( TM_CTL_ETHE, "11.22.33.44,yokogawa,abcdefgh",

&id );

USBTMC (DL9000) serial number = 27E000001

int id;

int ret = TmcInitialize( TM_CTL_USBTMC, "27E000001", &id );

USBTMC (GS200 and GS820) serial number = 27E000001

int id;

int ret = TmcInitialize( TM_CTL_USBTMC2, "27E000001", &id );

USBTMC (GS610) serial number = 27E000001

int id;

int ret = TmcInitialize( TM_CTL_USBTMC2, "27E000001C", &id );

USBTMC (other than the DL9000 and GS series) serial number = 27E000001

' When using the device list

int id;

int ret;

DEVICELIST list[127];

intnum;

ret = TmcSearchDevices(TM_CTL_USBTMC2,list,127,&num,NULL);

ret = TmcInitialize( TM_CTL_USBTMC2, list[0].adr, &id );

' When specifying the serial number directly

int id;

char encode[256];

int ret;

ret = TmcEncodeSerialNumber(encode,256,"27E000001");

ret = TmcInitialize( TM_CTL_USBTMC2, encode, &id );

VXI-11 IP=11.22.33.44

int id;

int ret = TmcInitialize( TM_CTL_VXI11, "11.22.33.44", &id );

---------------------------------------------------------------------------------------------------------------

intTmcDeviceClear( int id );

Purpose: Executes a selected device clear(SDC). This is a GPIB-specific command.

Parameters: int id device ID

Return value: 0 = OK, 1 = ERROR

Details:

Description of Parameters

int id

Set this parameter to the ID of the device for which the device clear will be executed.

This function is specific to GPIB devices, and doesn't affect devices using other

interfaces.

This function is specific to GPIB and USBTMC (other than the DL9000) devices, and doesn't affect devices using other interfaces.

With USBTMC (other than the DL9000), a USBTMC standard InitiateClear is issued.

If the InitiateClear succeeds, ClearFeature is issued and execution ends.

If the device clear succeeds, the return value is 0. However, if it is executed on non-GPIB or USBTMC (other than the DL9000) devices, the value is always 0.

If device clear succeeds, the return value is 0.

However, if it is executed on non-GPIB devices, the value is always 0.

Example:

int ret = TmcDeviceClear( id );

---------------------------------------------------------------------------------------------------------------

intTmcSend( int id, char* msg );

Purpose: Sends a message to a device.

Parameters: intid device ID

char* msg message character string

Return value: 0 = OK, 1 = ERROR

Details:

Description of Parameters

int id

Set this parameter to the ID of the device to which the message will be sent.

char* msg

For this parameter, enter the character string for the message itself.

Sends an ASCII character string to the device specified by the ID.

When sending binary data, use "TmcSendByLength".

Also, when dividing up a message to be sent, use "TmcSendSetup" and "TmcSendOnly".

Example:

int ret = TmcSend( id, "START" );

---------------------------------------------------------------------------------------------------------------

intTmcSendByLength( int id, char* msg, intlen );

Purpose: Sends a message of the specified number of bytes to a device.

Parameters: int id device ID

char* msg message character string

intlen the length in bytes to be sent

Return value: 0 = OK, 1 = ERROR

Details:

Description of Parameters

int id

Set this parameter to the ID of the device to which the message will be sent.

char* msg

For this parameter, enter the message itself.

intlen

Set this parameter to the number of bytes to be sent in the message.

Sends a message to the device specified by the ID.

You can send a message even if it includes binary data.

When dividing up a message to be sent, use "TmcSendSetup" and "TmcSendOnly".

Example:

int ret = TmcSendByLength( id, "START", 5 );

---------------------------------------------------------------------------------------------------------------

intTmcSendSetup( int id );

Purpose: Prepares the PC to send a message to a device.

Parameters: intid device ID

Return value: 0 = OK, 1 = ERROR

Details:

Description of Parameters

int id

Set this parameter to the ID of the device to which the PC should prepare to send a

message.

Prepares to send a message to the device specified by the ID.

When sending a single message over several transmissions, executes only once prior to the

transmission.

Use "TmcSendOnly" for the actual transmission.

Example:

int ret = TmcSendSetup( id );

---------------------------------------------------------------------------------------------------------------

intTmcSendOnly( int id, char* msg, intlen, int end );

Purpose: Sends a message of the specified number of bytes to a device.

Parameters: int id device ID

char* msg message character string

intlen the length in bytes to be sent

int end end flag

Return value: 0 = OK, 1 = ERROR

Details:

Description of Parameters

int id

Set this parameter to the ID of the device to which the message will be sent.

char* msg

For this parameter, enter the message itself.

intlen

Set this parameter to the number of bytes to be sent in the message.

int end

Set this parameter to indicate whether the current transmission is the final

transmission.

The value is 1 at the end of transmission, or 0 if transmission is to continue.

Sends a message to the device specified by the ID.

You can send a message even if it includes binary data.

If the end flag was set to 1, a terminator is sent at the end of the message.

Therefore while the end flag is 0, the device side considers the message to be in a series.

Examples:

int ret;

ret = TmcSendSetup( id );

ret = TmcSendOnly( id, "STA", 3, 0 );

ret = TmcSendOnly( id, "RT", 2, 1 );

---------------------------------------------------------------------------------------------------------------

intTmcReceive( int id, char* buff, intblen, int* rlen );

Purpose: Receives a message from a device.

Parameters: int id device ID

char* buff buffer for received data

intblen size of the buffer (in bytes)

intrlen the actual number of bytes received

Return value: 0 = OK, 1 = ERROR

Details:

Description of Parameters

int id

Set this parameter to the ID of the device from which the message will be received.

char* buff

Set this parameter to create a buffer that will store the message.

intblen

Set this parameter to the maximum number of bytes in the message that may be

received (normally the number of bytes in the buffer).

int* rlen

Returns the actual number of bytes received.

Receives a message from the device specified by the ID. Receives data up to the terminator

when one is detected, or the number of bytes specified by blen if no terminator is detected.

When using YOKOGAWA digital oscilloscopes, use "TmcReceiveBlockHeader" and

"TmcReceiveBlockData" to receive message data such as "WAVeform:SEND?" and "IMAGe:SEND?".

Examples:

char buff[10000];

int length;

int ret = TmcReceive( id, buff, 10000, &length );

---------------------------------------------------------------------------------------------------------------

intTmcReceiveSetup( int id );

Purpose: Prepares the PC to receive a message from a device.

Parameters: intid device ID

Return value: 0 = OK, 1 = ERROR

Details:

Description of Parameters

int id

Set this parameter to the ID of the device from which the PC will receive the

message.

Executes in order to prepare to receive from the device large amounts of data that has

been divided up into multiple transmissions.

Use "TmcReceiveOnly" for the actual receiving of data.

Example:

int ret = TmcReceiveSetup( id );

---------------------------------------------------------------------------------------------------------------

intTmcReceiveOnly( int id, char* buff, intblen, int* rlen );

Purpose: Receives a message (after preparation) from a device.

Parameters: int id device ID

char* buff buffer for received data

intblen size of the buffer (in bytes)

intrlen the actual number of bytes received

Return value: 0 = OK, 1 = ERROR

Details:

Description of Parameters

int id

Set this parameter to the ID of the device from which the message will be received.

char* buff

Set this parameter to create a buffer that will store the message.

intblen

Set this parameter to the maximum number of bytes in the message that may be

received (normally the number of bytes in the buffer).

int* rlen

Returns the actual number of bytes received.

Used when receiving large amounts of data that has been divided up.

After preparing for reception using "TmcReceiveSetup", receives the message from the

device specified by the ID.

Receives data up to the terminator when one is detected, or the number of bytes

specified

byblen if no terminator is detected.

Examples:

int ret;

char buff [1000];

int length;

ret = TmcReceiveSetup( id );

ret = TmcReceiveOnly( id, buff, 1000, &length );

ret = TmcReceiveOnly( id, buff, 1000, &length );

ret = TmcReceiveOnly( id, buff, 1000, &length );

---------------------------------------------------------------------------------------------------------------

intTmcReceiveBlockHeader( int id, int* length );

Purpose: Receives the header portion of the Block Data sent from the device, and returns

the number of bytes after the header.

Parameters: int id device ID

int* length the number of bytes in the Block Data

Return value: 0 = OK, 1 = ERROR

Details:

Description of Parameters

int id

Set this parameter to the ID of the device from which Block Data will be received.

int* length

Returns the number of bytes in the Block Data.

This is the first command to be used before receiving Block Data.

The number of bytes in the data after the header is returned as the length, so that

number plus 1 (for the terminator) is assigned to "TmcReceiveBlockData" and then the

data is received.

Examples:

int length;

int ret = TmcReceiveBlockHeader( id, &length );

---------------------------------------------------------------------------------------------------------------

intTmcReceiveBlockData( int id, char* buff, intblen, int* rlen, int* end );

Purpose: Receives the data portion of the Block Data sent from a device.

Parameters: int id device ID

char* buff buffer for received data

intblen size of the buffer (in bytes)

intrlen the actual number of bytes received

int* end end flag

Return value: 0 = OK, 1 = ERROR

Details:

Description of Parameters

int id

Set this parameter to the ID of the device from which the message will be received.

char* buff

Set this parameter to create a buffer that will store the message.

intblen

Set this parameter to the maximum number of bytes in the message that may be

received (normally the number of bytes in the buffer).

int* rlen

Returns the actual number of bytes received.

int* end

Returns whether all of the number of bytes of data returned by

"TmcReceiveBlockHeader" are finished being received.

The value is 1 at the end of reception, or 0 if reception is to continue.

Used when receiving block data (messages starting with a #).

After preparing for reception using "TmcReceiveBlockHeader", the message is received

from the device specified by the ID.

Receives data up to the terminator when one is detected, or the number of bytes specified

byblen if no terminator is detected.

Example:

int ret;

int length;

int len;

char buff [1000];

int flag;

ret = TmcReceiveBlockHeader( id, &length );

if( length < 1 ) {

return;

}

length += 1;

flag = 0;

while( flag == 0 ) {

ret = TmcReceiveBlockData( id, buf, 1000, &len, &flag );

}

---------------------------------------------------------------------------------------------------------------

intTmcCheckEnd( int id );

Purpose: Returns whether the message from the device is finished.

Can be used with the GPIB, USB, Ethernet, USBTMC, and VXI-11 interfaces.

Parameters: intid device ID

Return value: 1 = message to continue, 0 = message complete

Details:

Description of Parameters

int id

Set this parameter to the ID of the device from which the message to be checked

for completion will be received.

When receiving a message that has been divided up into a series of messages, all of the

message is received using "TmcReveiveOnly", and the function returns the value indicating

whether reception is complete.

Example:

int ret = TmcCheckEnd( id );

if( ret == 0 ) {

/* end of reception */

}

else {

/* reception continuing */

}

---------------------------------------------------------------------------------------------------------------

intTmcSetRen( int id, int flag );

Purpose: Places a device in remote or local mode. Use with non-GPIB interfaces is limited to

YOKOGAWA instruments.

Parameters: int id device ID

int flag remote (1)/local (0)

Return value: 0 = OK, 1 = ERROR

Details:

Description of Parameters

int id

Set this parameter to the ID of the device that will be placed in remote or

local mode.

int flag

Send 1 for remote, and 0 for local mode.

Depending on the type of interface, there are some differences in the way this command

is used.

For GPIB, the REN line is set to TRUE or FALSE.

Even after the parameter is entered, the device isn't actually placed in the mode until

messages are sent to that device.

With GPIB, the remote/local function cannot be applied separately to different devices.

When using RS232, USB or Ethernet with YOKOGAWA 488.2 compliant devices, only devices

that support COMMunications groups as messages can utilize this function.

In this case, the function can be applied separately to different devices.

In the USBTMC, remote / local switch is realized by control transfer.

Example:

int ret = TmcSetRen( id, 1 );

---------------------------------------------------------------------------------------------------------------

intTmcGetLastError( int id );

Purpose: Returns the number of the last error that occurred.

Parameters: intid device ID

Return value: Error number

Details:

Description of Parameters

int id

Set this parameter to the ID of the device from which an error number will

be acquired.

Returns the number of the last error that occurred on that device.

If the return value from any of the functions is non-zero (including the initialization function), this function can be used to acquire the actual error number. Example:

int ret = TmcSend( id, "START" );

if( ret != 0 ) {

int err = TmcGetLastError( id );

}

--------------------------------------------------------------------------------------------------------------- intTmcSetTerm( int id, inteos, inteot );

Purpose: Sets the terminator for sending or receiving a message.

Parameters: int id device ID

inteos terminator

inteot EOI

Return value: 0 = OK, 1 = ERROR

Details:

Description of Parameters

int id

Set this parameter to the ID of the device for the terminator.

inteos

Set this parameter to the terminator itself. The settings are shown below.

eos = 0 : CR+LF

= 1 : CR

= 2 : LF

= 3 : EOI (GPIB), or not (RS232, USB, Ethernet)

When the interface is GPIB and eos is 3, eot determines whether EOI is used.

inteot

Set this parameter to determine whether EOI can be used for the terminator.

This is a GPIB-specific command.

Sets the terminator. In general, you can use the following settings for any interface when carrying out communications with YOKOGAWA products.

int ret = TmcSetTerm( id, 2, 1 ); /* eos = LF, eot = TRUE */

When sending or receiving binary data with the setting eos = LF, if LF code is

included

in the binary code, the transmission concludes when the LF code is encountered.

However, when receiving block data using a YOKOGAWA product, if you use

"TmcReceiveBlockHeader" and "TmcReceivceBlockData", there's no need to switch the

terminator.

This function not supported with USBTMC on instruments other than the DL9000. It is not necessary to use the function.

Example:

int ret = TmcSetTerm( id, 2, 1 );

---------------------------------------------------------------------------------------------------------------

intTmcSetTimeout( int id, inttmo );

Purpose: Sets the timeout time for communications.

Parameters: int id device ID

inttmo timeout time (100-6553600 ms)

Return value: 0 = OK, 1 = ERROR

Details:

Description of Parameters

int id

Set this parameter to the ID of the device on which timeout will be set.

inttmo

Set this parameter to the timeout time in units of 100 ms.

When tmo = 0

GPIB: Timeout unlimited

Other: No timeout

Sets the timeout time for communications. Generally you should set the timeout time

to 30 seconds when using YOKOGAWA products. (Even if you lengthen the timeout time,

performance will not be affected.

Example:

int ret = TmcSetTimeout( id, 300 ); /* 30s */

---------------------------------------------------------------------------------------------------------------

intTmcFinish( int id );

Purpose: Closes the connection to a device.

Parameters: intid device ID

Return value: 0 = OK, 1 = ERROR

Details:

Description of Parameters

int id

Set this parameter to the ID of the device whose connection will be closed.

Closes connections opened with "TmcInitialize" (initialization function).

You must execute this function when concluding communications.

Example:

int ret = TmcFinish( id );

---------------------------------------------------------------------------------------------------------------

intTmcSearchDevices( int wire, DEVICELIST* list, int max, int* num, char* option);

Purpose: Returns a list of devices connected to the specified wire.

Parameters: int wire Wire type

DEVICELIST* list Pointer to the array containing the strings indicating the found devices

int max Number of arrays of strings indicating the found devices

int* num Number of found devices

char* option Required parameters for each devices

Return value: 0 = OK, 1 = ERROR

Details:

Description of parameters

int wire

Specifies the type of wire to which the device to be controlled is connected.

The settings for each interface are as follows:

GPIB : Not supported

RS232 : Not supported

USB : Not supported

Ethernet : Not supported

USBTMC(DL9000) : Not supported

EthernetUDP : Not supported

USBTMC (other than the DL9000): wire = TM_CTL_USBTMC2(7)

VXI-11 : wire = TM_CTL_VXI11(8)

DEVICELIST* list

typedef struct _Devicelist

{

char adr[ADRMAXLEN];(ADRMAXLEN= 64)

} DEVICELIST;

GPIB, RS232, USB, Ethernet, and USBTMC (DL9000) are undefined.

For USBTMC, the encoded serial number is returned.

For VXI-11, the IP address is returned.

int max

Number of arrays of the above structure prepared by the user.

int* num

Number of devices acquired

char* option

VXI-11: IP address to be masked, in the form of a string

USBTMC: Not required

Other: Undefined

Example:

int ret;

DEVICELIST list[127];

int num;

ret = TmcSearchDevices(7,list,127,&num,NULL); // USBTMC (other than the DL9000)

--------------------------------------------------------------------------------

intTmcEncodeSerialNumber(char* encode, size_tlen, char* src);

Purpose: Converts the name plate serial number to a USB internal serial number.

Parameters: char* encode The converted USB internal serial number

size_tlen Size of the encode buffer (no. of bytes)

char* src Serial number printed on the name plate

Return value: 0 = OK

Details:

Description of parameters

char* encode

Pointer to the buffer in which the converted USB internal serial number is stored

size_tlen

Size of the above buffer

char* src

Pointer to the buffer to which the serial number of the instrument printed on the name plate is written.

Example:

char encode[256];

int ret;

// Converts the name plate serial number to a USB internal serial number.

ret = TmcEncodeSerialNumber(encode,256,"12W929658");

ret = TmcInitialize(TM_CTL_USBTMC2, encode, &id);

--------------------------------------------------------------------------------

intTmcDecodeSerialNumber(char* decode, size_tlen, char* src);

Purpose: Converts the name plate serial number to a USB internal serial number.

Parameters: char* encode Serial number printed on the name plate

size_tlen Size of the encode buffer (no. of bytes)

char* src The converted USB internal serial number

Return value: 0 = OK, 1 = ERROR

Details:

Description of parameters

char* decode

Pointer to the buffer to which the serial number of the instrument printed on the name plate is written.

size_tlen

Size of the above buffer

char* src

Pointer to the buffer in which the converted USB internal serial number is stored

Example:

char encode[256];

// Converts the USB internal serial number to the name plate serial number.

ret = TmcDecodeSerialNumber(decode,256,"313257393239363538");

// decode = "12W929658"

-------------------------------------------------------------------------------- intTmcWaitSRQ( int id, char* stsbyte, int tout);

Purpose: Receives the SRQ of the device of the specified ID

Parameters: int id Device value

char* stsbyte Pointer to the status byte storage buffer

int tout Timeout value (in 100 msec units)

Return value: 0 = OK, 1 = ERROR

Details:

Description of parameters

int id

Sets the ID of the device that receives the SRQ.

char* stsbyte

Sets the SRQ attributes.

int tout

Timeout value set in 100 msec units.

Example:

int ret

int sts;

// Waits for the SRQ with a timeout value of 10 seconds

ret = TmcWaitSRQ(id, &sts, 100);

--------------------------------------------------------------------------------

intTmcAbortWaitSRQ( int id);

Purpose: Clears the wait state of the SRQ wait function of the specified device. Parameters: int id Device value

Return value: 0 = OK, 1 = ERROR

Details:

Description of parameters

Specifies the ID of the device on which to clear the wait state of the SRQ wait function.

Example:

int ret = TmcAbortWaitSRQ(id);

--------------------------------------------------------------------------------

intTmcSetCallback(int id, Hndlrfunc, ULONG p1,ULONG p2);

Purpose: Registers the call back routine when an SRQ occurs.

Parameters: int id Device value

Hndlrfunc Pointer to the call back function

unsigned long p1 long first parameter

unsigned long p2 long second parameter

Return value: 0 = OK, 1 = ERROR

Details:

Description of parameters

int id

Sets the device ID of the device that sets the call back function.

Hndlrfunc

typedef void(*Hndlr)(int, UCHAR, ULONG, ULONG);

Sets the pointer to the call back function called when an SRQ occurs.

Unsigned long p1

First parameter passed to the call back function

Unsigned long p2

Second parameter passed to the call back function

Example:

void func1(intid,UCHARstb,ULONG p1,ULONG p2)

{

printf("SRQ occurred id=%d stb=0x%x p1=%d p2=%d\n",

id,stb,p1,p2);

}

ODBC的接口函数

ODBC的接口函数 1.连接到数据源 下面的函数用于连接到数据源: (1)SQLAllocHandle:分配环境、连接、语句或者描述符句柄。(2)SQLConnect:建立与驱动程序或者数据源的连接。访问数据源的连接句柄包含了包括状态、事务申明和错误信息的所有连接信息。(3)SQLDriverConnect:与SQLConnect相似,用来连接到驱动程序或者数据源。但它比SQLConnect支持数据源更多的连接信息,它提供了一个对话框来提示用户设置所有的连接信息以及系统信息表没有定义的数据源。 (4)SQLBrowseConnect:支持一种交互方法来检索或者列出连接数据源所需要的属性和属性值。每次调用函数可以获取一个连接属性字符串,当检索完所有的属性值,就建立起与数据源的连接,并且返回完整的连接字符串,否则提示缺少的连接属性信息,用户根据此信息重新输入连接属性值再次调用此函数进行连接。 2.获取驱动程序和数据源信息 下面的函数用来获取驱动程序和数据源信息: (1)SQLDataSources:能够被调用多次来获取应用程序使用的所有数据源的名字。 (2)SQLDrivers:返回所有安装过的驱动程序清单,包括对它们的描述以及属性关键字。 (3)SQLGetInfo:返回连接的驱动程序和数据源的元信息。

(4)SQLGetFunctions:返回指定的驱动程序是否支持某个特定函数的信息。 (5)SQLGetTypeInfo:返回指定的数据源支持的数据类型的信息。 3.设置或者获取驱动程序属性 下面的函数用来设置或者获取驱动程序属性: (1)SQLSetConnectAttr:设置连接属性值。 (2)SQLGetConnectAttr:返回连接属性值。 (3)SQLSetEnvAttr:设置环境属性值。 (4)SQLGetEnvAttr:返回环境属性值。 (5)SQLSetStmtAttr:设置语句属性值。 (6)SQLGetStmtAttr:返回语句属性值。 4.设置或者获取描述符字段 下面的函数用来设置或者获取描述符字段: (1)SQLGetDescField:返回单个描述符字段的值。 (2)SQLGetDescRec:返回当前描述符记录的多个字段的值。(3)SQLSetDescField:设置单个描述符字段的值。 (4)SQLSetDescRec:设置描述符记录的多个字段。 5.准备SQL语句 下面的函数用来准备SQL语句: (1)SQLPrepare:准备要执行的SQL语句。 (2)SQLBindParameter:在SQL语句中分配参数的缓冲区。 (3)SQLGetCursorName:返回与语句句柄相关的游标名称。

输入法接口函数说明

输入法编程(转贴)(快看) IME输入法编程 第一章Windows9x系统下汉字输入法的基本原理 Windows系统下汉字输入法实际上是将输入的标准ascii字符串按照一定的编码规则转换为汉字或汉字串,进入到目的地。由于应用程序各不相同,用户不可能自己去设计转换程序,因此,汉字输入自然而然落到WINDOWS系统管理中。 一、输入法与系统的关系 键盘事件应用程序 || Windows的USER.EXE | 输入法管理器 | 输入法 系统的键盘事件有windows的user.exe软件接收后,user.exe在将键盘事件传导输入法管理器(Input Method Manager,简称IMM)中,管理器再将键盘事件传到输入法中,输入法根据用户编码字典,翻译键盘事件为对应的汉字(或汉字串),然后再反传到user.exe 中,user.exe再将翻译后的键盘事件传给当前正运行的应用程序,从而完成汉字的输入。 二、汉字输入法的组成 微软Windows9x系统中汉字输入法的名称是"Input Method Editor " ,简称IME,输入法的程序名称为:*.ime,数据文件名称为*.MB,即通常说的输入法编码表(字典). 实际上IME文件是一个动态连接库程序(DLL),它与dll文件没有区别,只是名称不同而已。 一般汉字输入法都由三个窗口组成: 状态窗口(Status Windows)-显示当前的输入法状态(中文还是英文等站环信息); 编码输入窗口(Composition Windows)-显示当前击键情况; 汉字选择窗口(Candidates Windows)-列出当前编码的全部汉字(串),供用户选择或查询。 上述三个窗口由基本的用户接口(User Interface )函数管理着。 现在我们用Dumpbin.exe打开微软提供的拼音输入法(WINDOWS\SYSTEM\WINPY.IME)看看它有什么组成(这里一WINDOWS98为例,并假定windows系统安装在c:盘下):

通达信函数大全使用说明

软件简介: 通达信全部函数及其用法(2011年最新版) (一)行情函数 1)HIGH(H)最高价返回该周期最高价.2)LOW(L)最低价返回该周期最低价.3)CLOSE(C)收盘价返回该周期收盘价.4)VOL(V)成交量(手)返回该周期成交量.5)OPEN (O)开盘价返回该周期开盘价.6)ADVANCE 上涨家数返回该周期上涨家数. (本函数仅对大盘有效)7)DECLINE 下跌家数返回该周期下跌家数. (本函数仅对大盘有效)8)AMOUNT 成交额(元)返回该周期成交额.9)VOLINSTK 持仓量返回期货该周期持仓量.10)QHJSJ 期货结算价返回期货该周期结算价. 11)BUYVOL 外盘(手)返回外盘,即时行情数据 12)SELVOL 外盘(手)返回外盘 13)ISBUYORDER 主动性买单返回当前成交是否为主动性买单.用法: ISBUYORDER,当本笔成交为主动性买盘时,返回1,否则为0 14)DHIGH 不定周期最高价返回该不定周期最高价.15)DOPEN 不定周期开盘价返回该不定周期开盘价.16) DLOW 不定周期最低价返回该不定周期最低价.17)DCLOSE 不定周期收盘价返回该不定周期收盘价.18) DVOL 不定周期成交量价返回该不定周期成交量价.19)NAMELIKE 模糊股票名称返回股票名称是否以参数开头.

用法: if(NAMELIKE('ST'),x,y); 20)CODELIKE 模糊股票代码返回股票代码是否以参数开头. 用法: if(CODELIKE('600'),x,y); 21)INBLOCK 属于某板块返回股票是否属于某板块. 用法: if(INBLOCK('沪深300'),x,y); (二)时间函数 1)PERIOD 周期取得周期类型. 结果从0到11,依次分别是1/5/15/30/60分钟,日/周/月,多分钟,多日,季,年. 2)DATE 日期取得该周期从1900以来的的年月日. 用法: DATE 例如函数返回1000101,表示2000年1月1 日,DATE+19000000后才是真正的日期值 3)TIME 时间取得该周期的时分秒.用法: TIME 函数返回有效值范围为(000000-235959) 4)YEAR 年份取得该周期的年份.5)MONTH 月份取得该周期的月份.用法: 函数返回有效值范围为(1-12) 6)WEEKDAY 星期取得该周期的星期数.用法: WEEKDAY 函数返回有效值范围为(1-7) 7)DAY 日取得该周期的日期.用法: DAY 函数返回有效值范围为(1-31) 8)HOUR 小时取得该周期的小时数.用法: HOUR 函数返回有效值范围为(0-23),对于日线及更长的分析周期值为0

DLL函数接口说明

typedef void __stdcall (*fun_AddResult)(char pDataStr[10][255],double pDataDouble[100]); extern "C" void __declspec(dllimport) __stdcall SetBackColor(TColor pBkColor); extern "C" void __declspec(dllimport) __stdcall FanSelect( void *pSeriesNames,//系列名称YLDStr * (typedef struct{char Data[255];} YLDStr;) const int pSeriesNameCount,//系列名称个数,-1时表示全部选择 void *pSubSeriesNames,//系列名称YLDStr * (typedef struct{char Data[255];} YLDStr;) const int pSubSeriesNameCount,//子系列名称个数,-1时表示全部选择 const double &pFlow, //风量 const int &pFlowUnitType, //风量单位类型0-m^3/h 1-m^3/s 2-l/s 3-cfm const double &pPres, //风压 const int &pPresUnitType, //风压单位类型0-Pa 1-mmH2O 2-kgf/cm^2 3-inH2O const int &pPresType, //风压类型0-全压1-静压 const int &pOutFanType,//出风方式0-管道出风1-自由出风 const double &pAirDensity,//空气密度 const double &pMotorSafeCoff,//电机容量安全系数(%) const bool &pUserSetMotorSafeCoff,//用户设定了电机容量安全系数 double &rFlow_STDUnit,//标准单位下的风量 fun_AddResult pAddResult//函数指针,用于回传数据 ); extern "C" void __declspec(dllimport) __stdcall Belt_Selection( const char *pSeriesName, const char *pSubTypeName, const char *pModelName, const int &pSped_DataType,//电机转速类型0-标准数据1-用户数据默认为0(界面选择) const int &pHz_DataType,//频率选择0-50HZ 1-60HZ(界面选择) const int &pRotation,//出风旋转角度R0,R90,R180,R270(参考常量定义) const double &pFanSped,//风机转速(第一步计算得到) const double &pMotorPow,//电机功率(第一步计算得到) const double &pFlow_STDUnit,//标准单位下的风量 const double &pTPres,//全压(第一步计算得到) const double &pSPres,//静压(第一步计算得到) const double &pFTEff,//全压内效率(第一步计算得到) const double &pSdbA,//噪声(第一步计算得到) const int &pV olt,//用户选择的电压(参考电压常量声明V380 V400) , bool pPole[4],//用户选择的极数2,4,6,8 bool pBeltType[4],//用户选择的皮带类型SPZ SPA SPB SPC const bool &pBeSetFanSped,//用户设定了风机转速 const double &pFanSpedRt_User,//用户设定的风机转速差 const bool &pBeSetBeltMoveSped,//用户设定最大皮带运动速度 const double &pBeltMoveSped_User,//用户设定的最大皮带运动速度

LWIP接口函数的文档

Lwip 协议栈的设计与实现 (中文版) Swedish Institute of Computer Science February 20, 2001 作者:Adam Dunkels adam@sics.se 翻译:果农(QQ:10205001) 核桃(QQ:329147) 佳旭(QQ:3232253) 整理:佳旭(QQ:3232253) 本文为QQ群ARM TCPIP LCD(群号:10988210)版权所有未经作者许可不得用于商业用途 摘要

LWIP是TCP/IP协议栈的一种实现。LWIP的主要目的是减少存储器利用量和代码尺寸,使LWIP适合应用于小的、资源有限的处理器如嵌入式系统。为了减少处理器和存储器要求,lwIP 可以通过不需任何数据拷贝的API进行裁减。 本文叙述了lwIP的设计与实现。叙述了协议实现及子系统中所使用的算法和数据结构如存储和缓冲管理系统。还包括LWIP API的参考手册和使用LWIP 的一些代码例子。 目录 1 Introduction (1) 2 Protocol layering (1) 3 Overview (2) 4 Process model (2) 5 The operating system emulation layer (3) 6 Buffer and memory management...................................................................... (3) 6.1 Packet buffers -pbufs (3) 6.2 Memory management (5) 7 Network interfaces........................................................................................ .. (5) 8 IP processing (7) 8.1 Receiving packets (7) 8.2 Sending packets (7) 8.3 Forwarding packets (8) 8.4 ICMP processing (8) 9 UDP processing............................................................................................ (8) 10 TCP processing.......................................................................................... (9) 10.1 Overview (9) 10.2 Data structures (10)

Excel表格中的一些基本函数使用方法

Excel表格中的一些基本函数使用方法 一、输入三个“=”,回车,得到一条双直线; 二、输入三个“~”,回车,得到一条波浪线; 三、输入三个“*”或“-”或“#”,回车,惊喜多多; 在单元格内输入=now()显示日期 在单元格内输入=CHOOSE(WEEKDAY(I3,2),"星期一","星期二","星期三","星期四","星期五","星期六","星期日") 显示星期几 Excel常用函数大全 1、ABS函数 函数名称:ABS 主要功能:求出相应数字的绝对值。 使用格式:ABS(number) 参数说明:number代表需要求绝对值的数值或引用的单元格。 应用举例:如果在B2单元格中输入公式:=ABS(A2),则在A2单元格中无论输入正数(如100)还是负数(如-100),B2中均显示出正数(如100)。 特别提醒:如果number参数不是数值,而是一些字符(如A等),则B2中返回错误值“#VALUE!”。 2、AND函数 函数名称:AND 主要功能:返回逻辑值:如果所有参数值均为逻辑“真(TRUE)”,则返回逻辑“真(TRUE)”,反之返回逻辑“假(FALSE)”。

使用格式:AND(logical1,logical2, ...) 参数说明:Logical1,Logical2,Logical3……:表示待测试的条件值或表达式,最多这30个。 应用举例:在C5单元格输入公式:=AND(A5>=60,B5>=60),确认。如果C5中返回TRUE,说明A5和B5中的数值均大于等于60,如果返回FALSE,说明A5和B5中的数值至少有一个小于60。 特别提醒:如果指定的逻辑条件参数中包含非逻辑值时,则函数返回错误值“#VALUE!”或“#NAME”。 3、AVERAGE函数 函数名称:AVERAGE 主要功能:求出所有参数的算术平均值。 使用格式:AVERAGE(number1,number2,……) 参数说明:number1,number2,……:需要求平均值的数值或引用单元格(区域),参数不超过30个。 应用举例:在B8单元格中输入公式: =AVERAGE(B7:D7,F7:H7,7,8),确认后,即可求出B7至D7区域、F7至H7区域中的数值和7、8的平均值。 特别提醒:如果引用区域中包含“0”值单元格,则计算在内;如果引用区域中包含空白或字符单元格,则不计算在内。 4、COLUMN 函数 函数名称:COLUMN 主要功能:显示所引用单元格的列标号值。

CAN应用接口函数

CAN应用接口函数库使用手册V1.0

目录 1.接口卡设备类型定义 (3) 2.错误码定义 (4) 3.函数库中的数据结构定义 (5) 3.1.VCI_BOARD_INFO (5) 3.2.VCI_CAN_OBJ (6) 3.3.VCI_CAN_STATUS (7) 3.4.VCI_ERR_INFO (8) 3.5.VCI_INIT_CONFIG (9) 3.6.VCI_RxAcptMask (10) 3.7.VCI_RxAcptFilter (11) 4.接口库函数说明 (12) 4.1.FD_OpenDevice (12) 4.2.FD_CloseDevice (13) 4.3.FD_InitCan (14) 4.4.FD_ReadBoardInfo (15) 4.5.FD_GetReceiveNum (16) 4.6.FD_ClearBuffer (17) 4.7.FD_StartCAN (18) 4.8.FD_ResetCAN (19) 4.9.FD_Transmit (20) 4.10.FD_Receive (21) 4.11.FD_RxAcptMaskInit (22) 4.12.FD_DisableRxAcptFilter (23) 4.13.FD_RxAcptFilterInit (24) 4.13.FD_SetOperationMode (25) 5.接口库函数使用方法 (26) 5.1.VC调用动态库的方法 (26) 5.2.VB调用动态库的方法 (26)

1.接口卡设备类型定义 各个接口卡的类型定义如下: 设备名称设备类型号备注 USBCAN11第一代USBCAN USBCAN22第二代USBCAN CAN2323待开发PCICAN4待开发

常用函数使用说明

可以给一列数后面标注大小 可以在一列数前面标记人民币符号 可以在一句话中提起字符 提取年 提取月

在身份证中提取年月日 可以比对,对比两个单元格里的内容是否一样 给数字固定四舍五入

显示系统当前的日期

向下舍入 1、向上四舍五入数字函数ROUND ⑴功能 按指定的位数对数值进行四舍五入。 ⑵格式 ROUND(数值或数值单元格,指定的位数) ⑶示例 A列 B列 12.351 325.525

…… B1中输入公式 ①保留2位小数——从千分位向百分位四舍五入。 =ROUND(A1,2)=12.35 向下复制公式到B2 =ROUND(A2,2)=325.53 ②四舍五入取整数——从十分位向个位四舍五入保留整数。 B1中输入公式 =ROUND(A1,0)=12 向下复制公式到B2 =ROUND(A2,0)=326 ③四舍五入到十位——从个位向十位四舍五入保留到十位数字。 B1中输入公式 =ROUND(A1,-1)=10 向下复制公式到B2 =ROUND(A2,-1)=330 说明: 函数ROUND的第1个参数可以是具体的数值也可以是数值单元格引用。 函数ROUND的第2个参数——指定保留的位数,保留小数位用正整数表示,即1,2,3,4……(对应十分位、百分位、千分位、万分位……);保留整数位用非正整数表示,即0,-1,-2,-3,……(对应个位、十位、百位……)。 2、向下舍数字函数ROUNDDOWN ⑴功能 按指定的位数对数值进行舍入。 ⑵格式 ROUNDDOWN(数值或数值单元格,指定的位数) ⑶示例 A列 B列 12.351 325.525 …… B1中输入公式 ①保留2位小数——舍去千分位及以后的小数位保留到百分位。 =ROUNDDOWN (A1,2)=12.35 向下复制公式到B2 =ROUNDDOWN (A2,2)=325.52 ②舍去小数位保留整数——舍去十分位及以后的小数位保留整数部分。 B1中输入公式 =ROUNDDOWN (A1,0)=12 向下复制公式到B2 =ROUNDDOWN (A2,0)=325 ③整数保留到十位——整数部分舍去个位上大于0的数字(用0代替),保留十位及以前的高位数字。

C语言中常用的库函数

字符处理函数 本类别函数用于对单个字符进行处理,包括字符的类别测试和字符的大小写转换 头文件ctype.h 函数列表<> 函数类别函数用途详细说明 字符测试是否字母和数字isalnum 是否字母isalpha 是否控制字符iscntrl 是否数字isdigit 是否可显示字符(除空格外)isgraph 是否可显示字符(包括空格)isprint 是否既不是空格,又不是字母和数字的可显示字符ispunct 是否空格isspace 是否大写字母isupper 是否16进制数字(0-9,A-F)字符isxdigit 字符大小写转换函数转换为大写字母toupper 转换为小写字母tolower 地区化 本类别的函数用于处理不同国家的语言差异。 头文件local.h 函数列表 函数类别函数用途详细说明 地区控制地区设置setlocale 数字格式约定查询国家的货币、日期、时间等的格式转换localeconv 数学函数 本分类给出了各种数学计算函数,必须提醒的是ANSI C标准中的数据格式并不符合IEEE754标准,一些C语言编译器却遵循IEEE754(例如frinklin C51) 头文件math.h 函数列表 函数类别函数用途详细说明 错误条件处理定义域错误(函数的输入参数值不在规定的范围内) 值域错误(函数的返回值不在规定的范围内) 三角函数反余弦acos 反正弦asin

反正切atan 反正切2 atan2 余弦cos 正弦sin 正切tan 双曲函数双曲余弦cosh 双曲正弦sinh 双曲正切tanh 指数和对数指数函数exp 指数分解函数frexp 乘积指数函数fdexp 自然对数log 以10为底的对数log10 浮点数分解函数modf 幂函数幂函数pow 平方根函数sqrt 整数截断,绝对值和求余数函数求下限接近整数ceil 绝对值fabs 求上限接近整数floor 求余数fmod 本分类函数用于实现在不同底函数之间直接跳转代码。头文件setjmp.h io.h 函数列表 函数类别函数用途详细说明 保存调用环境setjmp 恢复调用环境longjmp 信号处理 该分类函数用于处理那些在程序执行过程中发生例外的情况。 头文件signal.h 函数列表 函数类别函数用途详细说明 指定信号处理函数signal 发送信号raise 可变参数处理 本类函数用于实现诸如printf,scanf等参数数量可变底函数。

OCX接口说明V4

1.概述 精伦电子股份有限公司开发的二代身份证读卡系列机具适用于相关行业的联机型应用。产品提供了完善的二次软件开发接口(API)。本手册针对提供的ActiveX控件,对开发接口的文件组成、方法定义格式、调用方法及返回值等进行了详细的说明。 2.接口文件说明 接口文件包括: IdrControl.ocx Dewlt.dll Savephoto.dll Wltrs.dll 适用开发语言: 网络脚本开发 第一次使用时,需要以管理员身份运行SetupOCX.exe对控件进行安装注册。 更新说明: V4.0.1.0增加对编码设备支持,可设置日志文件。 V4.0.0.6增加RepeatRead 方法,可设置后进行连续读身份证。 V4.0.0.0增加对210-P的支持。 V3.4.1.4解决和13002相关在20130726的读卡体管理号问题。 V3.4.1.3解决一个潜在导致内存泄漏的问题。 V3.4.1.2增加GetCardPhotobuf方法,用于获取身份证正反面图片JPG格式Base64编码信息。 V3.4.1.0增加ExportPhoto方法,可在读卡结束后生成指定照片和卡图片文件名。

3.接口方法说明 3.1. 身份证方法 3.1.1.读身份证方法 原型:short ReadCard(long iPort,BSTR PhotoPath) 说明:本方法将打开端口、找卡、读卡等功能进行了集成,可用于打开串口或USB口并读取二代证卡内信息。 参数: 1、iPort:设置串口、USB或iDR210免驱动USB-HID。 普通串口 1 – 16(十进制) 例如: 1:串口1(COM1) 2:串口2(COM2) USB USB-HID (iDR210) 1001 例如: 1001:USB 2、PhotoPath:生成图片文件的绝对路径,包括生成的照片文件photo.bmp,photo.jpg和指定文件名的照片文件,和身份证正反面图片card.jpg。该参数为""时,默认将照片文件保存到Windows系统临时文件目录(GetTempPath())。也可自行设置保存的路径,比如:"d:\\photos\\photo.bmp",注意文件参数必须设置正确,才能正确地将相片文件放在指定位置(相片文件夹若不存在,将会自动生成新文件夹)。 返回值: 值说明 1 正确 -1 端口初始化失败 -2 卡认证失败(请重新将 卡放到读卡器) -3 读取数据失败 -4 生成照片文件失败(请 检查设定路径和磁盘空

API应用程序编程接口详解

API应用程序编程接口 API(Application Programming Interface,应用程序编程接口)是一些预先定义的函数,目的是提供应用程序与开发人员基于某软件或硬件的以访问一组例程的能力,而又无需访问源码,或理解内部工作机制的细节。API除了有应用“应用程序接口”的意思外,还特指API的说明文档,也称为帮助文档。另外,也是美国石油协会、空气污染指数、医药、空中位置指示器的英文简称。 Windows API是一套用来控制Windows的各个部件(从桌面的外观到为一个新进程分配的内存)的外观和行为的一套预先定义的Windows函数.用户的每个动作都会引发一个或几个函数的运行以告 诉Windows发生了什么.

这在某种程度上很象Windows的天然代码.其他的语言只是提供一种能自动而且更容易的访问API的方法.VB在这方面作了很多工作.它完全隐藏了API并且提供了在Windows环境下编程的一种完全不同的方法. 这也就是说,你用VB写出的每行代码都会被VB转换为API函数传递给Windows.例如,Form1.Print...VB 将会以一定的参数(你的代码中提供的,或是默认参数)调用TextOut 这个API函数。同样,当你点击窗体上的一个按钮时,Windows会发送一个消息给窗体(这对于你来说是隐藏的),VB获取这个调用并经过分析后生成一个 特定事件(Button_Click). API函数包含在Windows系统目录下的动态连接库文件中(如User32.dll,GDI32.dll,Shell32.dll...). 更易理解地说:Windows 这个多作业系统除了协调应用程式的执行、分配内存、管理系统资源…之外,她同时也是一个很大的服务中心,调用这个服务中心的各种服务(每一种服务就是一个函数),可以帮应用程式达到开启视窗、描绘图形、使用周边设备…等目的,由於这些函数服务的对象是应用程式(Application),所以便称之为Application Programming Interface,简称API 函数。WIN32 API也就是MicrosoftWindows 32位平台的应用程序编程接口。 凡是在Windows 工作环境底下执行的应用程式,都可以 调用Windows API。 API的历史与现状

VLOOKUP函数的使用方法(图解说明_很详细)

VLOOKUP函数调用方法如下:(本次以提取RRU挂高数据为例) 一、本次涉及的相关文档。 1.《某地区TD宏站现场勘测数据汇总表》如表1-1,共1000多站,本次共列出104个站点的信息: 查看原文档请双击图标:某地区TD宏站现场 查勘数据汇总表,表1-1抓图如下: 2.某工程报价单,共30个宏站,如表1-2(本报价单其他信息均删除,只保留了站点名) 查看原文档请双击图标:某工程报价单.xlsx ,表1-2抓图如下: 二、本次我们以从表1-1中提取表1-2中30个站点的RRU挂高为例,具体步骤如下: 1.先在表1-2中增加“RRU挂高”这一列,然后先提取“某城关水泵厂南”的RRU挂高。操作方法为双击下图所示灰色表格,然后鼠标左键单击列表上面的fx插入函 数。 2.点fx后弹出如下图标,在下拉列表中选择“VLOOKUP”,点确定。

3.点确定后,弹出VLOOKUP函数调用表,包含4个部分(lookup_value、Table_array、C ol_index_num、Range_lookup)。 lookup_value:需要在数据表首列进行搜索的值,本次值为表1-1中的位置B2,用 鼠标单击表1-1中的“某城关水泵厂南”,即可自动输入。。 Table_array:需要在其中搜索数据的信息表,即在表1-2中选择一个搜索区域, 注意所选区域第一列必须是与Lookup_value中查找数值相匹配的 列(本次表1-1中的B列),最后一列必须大于等于RRU挂高那一列 (大于等于C列),至于下拉行数肯定要大于等于106行。如下图: 选择相关区域后,VLOOKUP表中的Table_array会自动输入表1-1中所选区域,如 下图:

数据库常用函数

数据库常用函数

一、基础 1、说明:创建数据库 CREATE DATABASE database-name 2、说明:删除数据库 drop database dbname 3、说明:备份和还原 备份:exp dsscount/sa@dsscount owner=dsscount file=C:\dsscount_data_backup\dsscount.dmp log=C:\dsscount_data_backup\outputa.log 还原:imp dsscount/sa@dsscount file=C:\dsscount_data_backup\dsscount.dmp full=y ignore=y log=C:\dsscount_data_backup\dsscount.log statistics=none 4、说明:创建新表 create table tabname(col1 type1 [not null] [primary key],col2 type2 [not null],..) CREATE TABLE ceshi(id INT not null identity(1,1) PRIMARY KEY,NAME VARCHAR(50),age INT) id为主键,不为空,自增长 根据已有的表创建新表: A:create table tab_new like tab_old (使用旧表创建新表) B:create table tab_new as select col1,col2… from tab_old definition only 5、说明:删除新表 drop table tabname 6、说明:增加一个列 Alter table tabname add column col type 注:列增加后将不能删除。DB2中列加上后数据类型也不能改变,唯一能改变的是增加varchar类型的长度。 7、说明:添加主键: Alter table tabname add primary key(col) 说明:删除主键: Alter table tabname drop primary key(col) 8、说明:创建索引:create [unique] index idxname on tabname(col….) 删除索引:drop index idxname 注:索引是不可更改的,想更改必须删除重新建。 9、说明:创建视图:create view viewname as select statement 删除视图:drop view viewname 10、说明:几个简单的基本的sql语句 选择:select * from table1 where 范围 插入:insert into table1(field1,field2) values(value1,value2) 删除:delete from table1 where 范围 更新:update table1 set field1=value1 where 范围

ORACLE数据库API接口函数设计说明

ORACLE数据库API接口函数设计说明 API接口函数使用示例: 参见程序OCIDEMO.DSW //工程中不用在连接ociw32.lib只用xjoci.lib就行了。 假定: 工程文件为newocidemo,所在目录为c:\newocidemo,newocidemo.exe 位于c:\newocidemo\debug下面 使用步骤: 1、将MyConnection.h;oratypes.h;ocidem.h;ocidfn.h;xioci.lib复制到c:\newocidemo下面 2、将xioci.dll复制到c:\newocidemo\debug下面 3、设置project 下的settings 下面的link 中的object/library modules: 为xjoci.lib 4、在file中添加MyConnection.h,从而在class中会出现connection,cursor两个新类 API接口函数类设计: CONNECTION类 class connection { friend class cursor; public: BOOL IsConnected(); connection();

~connection(); BOOL connect(char *username, char *password,char *sername); BOOL disconnect(); void display_error() const; private: Lda_Def lda; ub1 hda[HDA_SIZE]; enum conn_state { not_connected, connected }; conn_state state; }; BOOL connect(char *username, char *password,char *sername); 函数用途:connect函数建立OCI程序与ORACLE数据库的连接参数说明:char *username,--用户名 char *password,--口令 char *sername—主机字符串(数据库别名)。 返回值:连接成功返回TRUE,不成功返回FALSE BOOL disconnect(); 函数用途:disconnect函数断开与数据库的连接 参数说明:

文华函数使用说明

文华函数使用说明 求绝对值。 用法: ABS(X)返回X的绝对值。 例:ABS(-10)返回10,ABS(CLOISE-10) 返回收盘价和10的价差。 求反余弦值。 用法: ACOS(X)返回X的反余弦值。 求反正弦值。 用法: ASIN(X)返回X的反正弦值。 求反正切值。 用法: ATAN(X)返回X的反正切值。

求平均绝对偏差。 用法: AVEDEV(X,N)返回X在N周期内的平均绝对偏差。 取得均价。 用法: AVPRICE返回均价。 取K线的位置。 用法: BARPOS 取某K线的位置。 设置背景的样式。 用法: BACKGROUNDSTYLE(i)设置背景的样式。 i = 0 或 1。

将当前位置到若干周期前的数据设为1。 用法: BACKSET(X,N),若X非0,则将当前位置到N周期前的数值设为1。例:BACKSET(CLOSE>OPEN,3);表示当K线收阳时,自当前位置到3周期前的数值设为1 该函数参数支持变量计算如BACKSET(CLOSE>OPEN,VAR1);//VAR1是变量 本函数运算量很大,将占用很多的CPU资源,导致行情刷新速度变慢,请谨慎使用! 求上一次条件成立到当前的周期数。 用法: BARSLAST(X):上一次X不为0到现在的天数 本函数运算量很大,将占用很多的CPU资源,导致行情刷新速度变慢,请谨慎使用! 介于两个数之间。 用法: BETWEEN(A,B,C)表示A处于B和C之间时返回1(Yes),否则返回0(No) 例:BETWEEN(CLOSE,MA5,MA10); 表示收盘价介于5日均线与10日均

c++常用函数大全

数学函数,所在函数库为math.h、stdlib.h、string.h、float.h int abs(int i) 返回整型参数i的绝对值 double cabs(struct complex znum) 返回复数znum的绝对值 double fabs(double x) 返回双精度参数x的绝对值 long labs(long n) 返回长整型参数n的绝对值 double exp(double x) 返回指数函数ex的值 double frexp(double value,int *eptr) 返回value=x*2n中x的值,n存贮在eptr中double ldexp(double value,int exp); 返回value*2exp的值 double log(double x) 返回logex的值 double log10(double x) 返回log10x的值 double pow(double x,double y) 返回xy的值 double pow10(int p) 返回10p的值 double sqrt(double x) 返回+√x的值 double acos(double x) 返回x的反余弦cos-1(x)值,x为弧度 double asin(double x) 返回x的反正弦sin-1(x)值,x为弧度 double atan(double x) 返回x的反正切tan-1(x)值,x为弧度 double atan2(double y,double x) 返回y/x的反正切tan-1(x)值,y的x为弧度double cos(double x) 返回x的余弦cos(x)值,x为弧度 double sin(double x) 返回x的正弦sin(x)值,x为弧度 double tan(double x) 返回x的正切tan(x)值,x为弧度 double cosh(double x) 返回x的双曲余弦cosh(x)值,x为弧度 double sinh(double x) 返回x的双曲正弦sinh(x)值,x为弧度 double tanh(double x) 返回x的双曲正切tanh(x)值,x为弧度 double hypot(double x,double y) 返回直角三角形斜边的长度(z), x和y为直角边的长度,z2=x2+y2 double ceil(double x) 返回不小于x的最小整数 double floor(double x) 返回不大于x的最大整数 void srand(unsigned seed) 初始化随机数发生器 int rand() 产生一个随机数并返回这个数 double poly(double x,int n,double c[])从参数产生一个多项式 double modf(double value,double *iptr)将双精度数value分解成尾数和阶 double fmod(double x,double y) 返回x/y的余数 double frexp(double value,int *eptr) 将双精度数value分成尾数和阶 double atof(char *nptr) 将字符串nptr转换成浮点数并返回这个浮点数 double atoi(char *nptr) 将字符串nptr转换成整数并返回这个整数 double atol(char *nptr) 将字符串nptr转换成长整数并返回这个整数 char *ecvt(double value,int ndigit,int *decpt,int *sign) 将浮点数value转换成字符串并返回该字符串

C++接口使用说明

NetCDF C++接口使用说明 作者:杜鸿飞 完成时间:2004年4月

目录 一、NetCDF文件介绍 (2) 二、NetCDF C++类函数详解 (3) 1. NcFile类公有成员函数 (3) 文件操作 (3) 维数操作 (4) 变量操作 (4) 属性操作 (6) 2. NcDim类公有成员函数 (7) 3. NcVar类公有成员函数 (7) 4. NcAtt类公有成员函数 (9) 三、NetCDF C++使用举例 (10)

//***************** function about dimension ****************************** int num_dims(); 返回文件所含dim数目 int unlimdimid(); 返回unlimited dimension的ID void def_dim(NcDim &dim); 将参数dim定义到文件中 NcDim inq_dim(int dimid); 返回文件中ID号为dimid的dim维数 NcDim inq_dim(const string dimname); 返回文件中名字为dimname的dim维数 void rename_dim(int dimid, string name); 将文件中ID号为dimid的维数重命名为name //***************** function about variable ****************************** int num_vars(); 返回文件所含var数目 void def_var(NcVar &var); 将参数var定义到文件中 NcVar inq_var(int varid); 返回文件中ID号为varid的var变量 NcVar inq_var(const string varname); 返回文件中名字为varname的var变量 void rename_var(int varid, string name); 将文件中ID号为varid的变量重命名为name template void put_var_single(int varid, int index[], Type value); 给文件中ID号为 varid的var变量写入一个值 varid:欲写入值的变量的ID号 index: 欲写入值在变量中位置的索引,用数组存储,如对于一个3维变量,对其任一元素写值,index为一含3个元素的数组(0,0,0)到(2,2,2); value: 将要写入的值,为摸板参数类型,其类型由函数自动解析。 template void put_var_entire(int varid, Type block[]); 给文件中ID号为 varid的var变量整体写入值 varid:欲写入值的变量的ID号 block: 存储将要写入值的数组地址,该数组大小应不小于变量实际元素个数。block为摸板参数类型,其类型由函数自动解析。 template void put_var_array(int varid, int start[], int count[], Type *block); 给文件中ID号为 varid的var变量部分写入值 varid:欲写入值的变量的ID号 start:欲写入值的其始位置索引,格式同put_var_single函数中的index参数

相关文档
最新文档