tcio
Functions
Initialization

Functions

DLL_RESULT DllAbortDeviceSearch (void)
 aborts the function DllSearchDevice so that it returns before all COM ports are searched
DLL_RESULT DllGetCommTimeouts (unsigned int *pReadTimeoutMultiplier, unsigned int *pWriteTimeoutMultiplier)
 This function returns the currently used read and write timeout multiplier.
DLL_RESULT DllGetDeviceSearchProgress (int *pComPort)
 shows the progress on search port range
DLL_RESULT DllGetDeviceType (unsigned int *pDeviceType)
DLL_RESULT DllGetStatus (int *pState, int *pErrorNo)
 Reads actual state of communication and DLL.
This function reports the status of the low level interface (communication or communication commands).
If an error occur the communication might be interrupted or the actual command could not be executed. The internal dll communication state is resetted. A new initialisation is recommended. This function does not report device faults or warnings!
DLL_RESULT DllInit ()
 Initialises Driver/Objects used by the API. Allocates Memory.
DLL_RESULT DllReadVersion (unsigned int *pVersion, unsigned int *pBuild, char *pString)
 Reads version of API.
DLL_RESULT DllSearchDevice (int fromPort, int toPort, int *pPortNrFound)
 Searches for TopCon device on available serial ports between the given port numbers.
If a device is found communication will be established automatically.
To connect on a specific port number set fromPort equal to toPort.
Usually the two serial ports on a PC have the numbers 1 and 2.
DLL_RESULT DllSetCommTimeouts (unsigned int ReadTimeoutMultiplier, unsigned int WriteTimeoutMultiplier)
 This function allows to set the timeout multiplier of the RS232 interface.
DLL_RESULT DllSetDefaultCommTimeouts (void)
 Calling this function resets the communication parameters
of the RS232 interface to default values.
Read: 10, Write: 10.

Detailed Description

These functions are used for internally initalisiations of the API.
Physical Values:
will calculate internally used factors which other TC4-API-functions will use. That's why this one must always be called after DLL-initialisation.
Every value which is not given back as a physical value can be multiplicated with the compatible factor. So you get from the standardised value the physical value. (standardised belong to 4000).

Attention:
Every time you connect to a (different) device this function must be called again. Otherwise the physical values could be incorrect!

Function Documentation

DLL_RESULT DllAbortDeviceSearch ( void  )

aborts the function DllSearchDevice so that it returns before all COM ports are searched

Returns:
DLL_SUCCESS for success or DLL_FAIL or other value if an error occurs
DLL_RESULT DllGetCommTimeouts ( unsigned int *  pReadTimeoutMultiplier,
unsigned int *  pWriteTimeoutMultiplier 
)

This function returns the currently used read and write timeout multiplier.

Parameters:
[out]pReadTimeoutMultipliertimeout multiplier for READ operation
[out]pWriteTimeoutMultipliertimeout multiplier for WRITE operation
Returns:
DLL_SUCCESS for success or DLL_FAIL or other value if an error occurs
DLL_RESULT DllGetDeviceSearchProgress ( int *  pComPort)

shows the progress on search port range

Parameters:
[out]pComPortactual searched on port
Returns:
DLL_SUCCESS for success or DLL_FAIL or other value if an error occurs
DLL_RESULT DllGetDeviceType ( unsigned int *  pDeviceType)
Parameters:
[out]pDeviceTypedevice type identifier
Note:
DllSearchDevice must be called before
see enum T_DeviceType
Returns:
DLL_SUCCESS for success or DLL_FAIL or other value if an error occurs
DLL_RESULT DllGetStatus ( int *  pState,
int *  pErrorNo 
)

Reads actual state of communication and DLL.
This function reports the status of the low level interface (communication or communication commands).
If an error occur the communication might be interrupted or the actual command could not be executed. The internal dll communication state is resetted. A new initialisation is recommended. This function does not report device faults or warnings!

Parameters:
[out]pStatevariable receiving actual state
0: ok
-10: communication error
-100: device reported command execution error
[out]pErrorNoreserved
Returns:
DLL_SUCCESS for success or DLL_FAIL or other value if an error occurs
DLL_RESULT DllInit ( )

Initialises Driver/Objects used by the API. Allocates Memory.

Returns:
DLL_SUCCESS for success or DLL_FAIL or other value if an error occurs
DLL_RESULT DllReadVersion ( unsigned int *  pVersion,
unsigned int *  pBuild,
char *  pString 
)

Reads version of API.

Parameters:
[out]pVersionversion of API
upper 16 Bit: Major Version number (xx.68.00)
lower 16 Bit: Minor Version number (03.xx.00)
[out]pBuildbuild counter (03.68.xx)
[out]pStringversion string see DLL_VERSIONSTRING_COPY_LENGTH
Returns:
DLL_SUCCESS for success or DLL_FAIL or other value if an error occurs
DLL_RESULT DllSearchDevice ( int  fromPort,
int  toPort,
int *  pPortNrFound 
)

Searches for TopCon device on available serial ports between the given port numbers.
If a device is found communication will be established automatically.
To connect on a specific port number set fromPort equal to toPort.
Usually the two serial ports on a PC have the numbers 1 and 2.

Parameters:
[in]fromPortport number from which the search starts [1...255]
[in]toPortport number where the search stops [1...255]
[out]pPortNrFoundreceiving the port number if device found otherwise unchanged
Note:
fromPort <= toPort
After this function call succeds, call the mandatory functions before calling others.
Returns:
DLL_SUCCESS for success or DLL_FAIL or other value if an error occurs
DLL_RESULT DllSetCommTimeouts ( unsigned int  ReadTimeoutMultiplier,
unsigned int  WriteTimeoutMultiplier 
)

This function allows to set the timeout multiplier of the RS232 interface.

Parameters:
[in]ReadTimeoutMultipliertimeout multiplier for READ operation
range: [1...5000]
[in]WriteTimeoutMultipliertimeout multiplier for WRITE operation
range: [1...5000]
Returns:
DLL_SUCCESS for success or DLL_FAIL or other value if an error occurs
DLL_RESULT DllSetDefaultCommTimeouts ( void  )

Calling this function resets the communication parameters
of the RS232 interface to default values.
Read: 10, Write: 10.

Returns:
DLL_SUCCESS for success or DLL_FAIL or other value if an error occurs