Page cover image

OpenNeoDevice Method - neoVI API

This method returns the neoVI hardware devices connected to the PC.

int _stdcall icsneoOpenDevice(NeoDeviceEx* pNeoDeviceEx, void* hObject, unsigned char* bNetworkIDs, int bConfigRead, int iOptions, OptionsOpenNeoEx* stOptionsOpenNeoEx, unsigned long reserved)

Parameters

pNeoDevice

[in] A valid NeoDevice structure filled with information about a specific neoVI device. For C++ a “void*” can be used. For .NET, “IntPtr” is used. This must be obtained by calling FindNeoDevices.

hObject

[out] This parameter needs to be 32 bit in a 32 bit program and 64 bit in a 64 bit program. This will be set to the handle of the neoVI driver object that is created. It is needed as an input parameter to other API function calls. Every time you create a new neoVI object you must call ClosePort and FreeObject to avoid creating a memory and resource leak.

bNetworkIDs

[in] This is an array of number IDs which specify the NetworkID parameter of each network. This allows you to assign a custom network ID to each network. Normally, you will assign consecutive IDs to each of the networks. See NetworkIDList for a list of current network ID’s. _ You may also set this parameter to NULL (zero) and the default network ID’s will be used._

bConfigRead

[in] Specifies whether the DLL should read the neoVI’s device configuration before enabling the device. It is recommended that this value be set to 1.

bSyncToPC

[in] Specifies whether timestamps for messages should be adjusted to the PC’s clock to compensate for time drift. This drift is caused by differences that occur over time between the clocks on the neoVI device and the PC.

Return Values

If the port has been opened successfully, the return value will be 1. Otherwise the return value will be zero.

Remarks

To connect to more than one piece of hardware, multiple calls to OpenNeoDevice can be made. The key is to provide a different NeoDevice for each device you want to open. For other function calls, use the returned hObject to talk to that device.

Each successful call to OpenNeoDevice should be matched with a call to a ClosePort when you are finished accessing the hardware. FreeObject methods.

Examples

void * hObject;  // holds a handle to the neoVI object
int iRetVal;
int iCount;
NeoDevice ndNeoToOpen; //created previously

iRetVal = icsneoOpenDevice(&ndNeoToOpen, &hObject, NULL, 1, 0);

Last updated