OpenPortEx Method - neoVI API
Last updated
Last updated
This function is deprecated. Use the method instead.
This function opens a connection to a neoVI device.
Parameters
lPortNumber
[in] Specifies which USB, TCP/IP, or Comm port to use. The USB port is a logic port starting with 1 up to the number of devices. For example, if 3 devices are connected, valid lPortNumber values will be 1,2, and 3. Comm ports also start at 1. For TCP/IP it specifies the TCP/IP port number.
lPortType
[in] Specifies the port type of what the device is connected to. This parameter is used with lPortNumber described above. This parameter can be set to NEOVI_COMMTYPE_RS232 (0) for a RS232 Comm port, NEOVI_COMMTYPE_USB_BULK (1) for a USB, or NEOVI_COMMTYPE_TCPIP (3) for a TCP/IP connection. More information on the different types of hardware and the connection it uses can be found in the help topic.
lDriverType
[in] Specifies which neoVI driver to use. This should always be set to INTREPIDCS_DRIVER_STANDARD (0).
lIPAddressMSB
[in] Specifies upper two bytes of TCP/IP address if the lPortType is set to NEOVI_COMMTYPE_TCPIP (bytes 4 and 3 of this TCP/IP address: 1.2.3.4).
lIPAddressLSBOrBaudRate
[in] Specifies the baud rate if lPortType is NEOVI_COMMTYPE_RS232 and the lower two bytes of the TCP/IP address (bytes 2 and 1 of this TCP/IP address: 1.2.3.4).
bConfigRead
[in] Specifies whether the DLL should read the configuration before enabling the device. It is recommended to set this value to 1. This parameter is ignored when the object is created because the configuration is read by default.
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. The network IDs are specified in the following list: NETID_DEVICE = 0, NETID_HSCAN = 1, NETID_MSCAN = 2, NETID_SWCAN = 3, NETID_LSFTCAN = 4, NETID_FORDSCP = 5, NETID_J1708 = 6, NETID_AUX = 7, NETID_JVPW = 8, NETID_ISO = 9. You may also set this parameter to NULL (zero) and the default network ID’s will be used.
hObject
[in, out] This is the handle of the neoVI driver object. If this handle is 0, the method will create a new neoVI driver object. This handle will be used in other neoVI API calls to read and transmit messages.
Return Values
If the port has been opened successfully and connection to neoVI is attained, the return value will be 1. If the function fails the return value will be zero. The most common reason for failure is when the neoVI is not connected to the port described in the parameters.
Remarks
The neoVI DLL will use this array when it receives a network message. For example, when the DLL receives a message from HSCAN network it will set the NetworkID parameter of the with the value bNetworkID(NETID_HSCAN).
Every time you create a new neoVI driver object you must call (after ). If you do not you will create a memory leak.
Each successful call to OpenPort should be matched with a call to . The OpenPort call will reset the timestamp clock.