neoVI API Docs
All DocsProductsLearning CenterSupport
  • The neoVI API - Create your own software applications
  • Basic Operation - neoVI API
    • Using the neoVI API in Visual Studio: 32 bit DLL and 64 bit OS - neoVI API
    • Using the intrepidcs API in Visual Basic - neoVI API
    • Using the neoVI API in Visual C++ - neoVI API
    • Using the neoVI API in C# - neoVI API
    • Using the neoVI API in Borland C++ Builder - neoVI API
    • Using the neoVI API in Delphi - neoVI API
    • Using the API in LabVIEW - neoVI API
    • Using the neoVI API in LabWindows CVI - neoVI API
    • Unity3D Graphic Display API
    • Using the neoVI API in Excel - neoVI API
  • WIN32 API Overview - neoVI API
    • Basic Functions Overview - neoVI API
      • FindDevices Method
      • OpenNeoDevice Method - neoVI API
      • ClosePort Method - neoVI API
      • FreeObject Method - neoVI API
    • Message Functions Overview - neoVI API
      • GetMessages Method - neoVI API
      • TxMessages Method - neoVI API
      • TxMessagesEx Method - neoVI API
      • WaitForRxMessagesWithTimeOut Method - neoVI API
      • GetTimeStampForMsg Method - neoVI API
      • ISO15765 Message Functions Overview - neoVI API
        • ISO15765_EnableNetworks Method - neoVI API
        • ISO15765_TransmitMessage Method - neoVI API
        • ISO15765_ReceiveMessage Method - neoVI API
      • Transmitting Long Messages - neoVI API
    • Device Settings Functions Overview - neoVI API
      • GetConfiguration Method - neoVI API
      • SendConfiguration Method - neoVI API
      • neoVI Fire - neoVI API
        • GetFireSettings Method - neoVI API
        • SetFireSettings Method - neoVI API
      • neoVI FIRE 2 - neoVI API
        • GetFIRE2Settings Method - neoVI API
        • SetFire2Settings Method - neoVI API
      • ValueCAN3 - neoVI API
        • GetVCAN3Settings Method - neoVI API
        • SetVCAN3Settings Method - neoVI API
      • ValueCAN 4-1 and 4-2 - neoVI API
        • GetVCAN412Settings Method - neoVI API
        • SetVCAN412Settings Method - neoVI API
      • ValueCAN 4-4 - neoVI API
        • GetVCAN4Settings Method - neoVI API
        • SetVCAN4Settings Method - neoVI API
      • ValueCAN RF - neoVI API
        • GetVCANRFSettings Method - neoVI API
        • SetVCANRFSettings Method - neoVI API
      • RAD Galaxy - neoVI API
        • GetRADGalaxySettings Method - neoVI API
        • SetRADGalaxySettings Method - neoVI API
      • General Device Settings - neoVI API
        • SetBitRate Method - neoVI API
        • SetFDBitRate Method - neoVI API
        • GetDeviceSettings Method - neoVI API
        • SetDeviceSettings Method - neoVI API
        • GetHWFirmwareInfo Method - neoVI API
        • GetDLLFirmwareInfo Method - neoVI API
        • ForceFirmwareUpdate Method - neoVI API
        • GetDeviceParameters Method - neoVI API
        • SetDeviceParameters Method - neoVI API
        • SetReflashDisplayCallbacks Method - neoVI API
        • ClearReflashDisplayCallbacks Method - neoVI API
        • GetRTC Method - neoVI API
        • SetRTC Method - neoVI API
    • Error Functions Overview - neoVI API
      • GetLastAPIError Method - neoVI API
      • GetErrorMessages Method - neoVI API
      • GetErrorInfo Method - neoVI API
      • Error Messages - neoVI API
    • General Utility Functions Overview - neoVI API
      • ValidateHObject Method - neoVI API
      • GetDLLVersion Method - neoVI API
      • StartSocketServer Method - neoVI API
      • StopSocketServer Method - neoVI API
      • GetPerformanceParameters Method - neoVI API
      • ReadWritePhySettings Method - neoVI API
      • EnableDOIPLine Method - neoVI API
      • GetGPTPStatus Method - neoVI API
    • Deprecated Functions Overview - neoVI API
      • OpenPortEx Method - neoVI API
        • OpenPortEx Hardware Type Information - neoVI API
      • FindAllCOMDevices Method - neoVI API
      • FindAllUSBDevices Method - neoVI API
      • FindNeoDevices Method - neoVI API
      • EnableNetworkCom Method - neoVI API
      • CoreMini Script interface Overview - neoVI API
        • ScriptStart Method - neoVI API
        • ScriptStop Method - neoVI API
        • ScriptLoad Method - neoVI API
        • ScriptClear Method - neoVI API
        • ScriptStartFBlock Method - neoVI API
        • ScriptGetFBlockStatus Method - neoVI API
        • ScriptStopFBlock Method - neoVI API
        • ScriptGetScriptStatus Method - neoVI API
        • ScriptReadAppSignal Method - neoVI API
        • ScriptWriteAppSignal Method - neoVI API
    • Structures, Types, and Defines Overview - neoVI API
      • Setting Structures Overview - neoVI API
        • SFireSettings Structure
        • SFire2Settings Structure
        • SVCAN3Settings Structure
        • SVCANRFSettings Structure
        • SVCAN412Settings Structure
        • SVCAN4Settings Structure
        • SVCAN4IndSettings Structure
        • SRADGalaxySettings Structure
        • SRADStar2Settings Structure
        • SRADPlutoSettings Structure
        • SRADSuperMoonSettings Structure
        • SRADMoon2Settings Structure
        • SDeviceSettings Structure
        • Sub Setting Structures Overview - neoVI API
          • CAN_SETTINGS Structure
          • SWCAN_SETTINGS Structure
          • CANFD_SETTINGS Structure
          • LIN_SETTINGS Structure
          • ISO9141_KEYWORD2000_SETTINGS Structure
          • ISO9141_KEYWORD2000__INIT_STEP Structure
          • ETHERNET_SETTINGS Structure
          • ETHERNET_SETTINGS2 Structure
          • OP_ETH_GENERAL_SETTINGS Structure
          • OP_ETH_SETTINGS Structure
          • SPluto_CustomParams Structure
          • UART_SETTINGS Structure
          • RAD_GPTP_SETTINGS Structure
          • LOGGER_SETTINGS Structure
          • DISK_SETTINGS Structure
          • TIMESYNC_ICSHARDWARE_SETTINGS Structure
          • RAD_REPORTING_SETTINGS Structure
          • STextAPISettings Structure
          • gPTP Structures
            • GPTPStatus Structure
            • timestamp Structure
            • priority_vector Structure
            • port_identity Structure
            • clock_quality Structure
            • system_identity Structure
        • NeoDevice Structure
        • NeoDeviceEx Structure
        • stAPIFirmwareInfo Structure
        • Message Structures - neoVI API
        • Status Bitfields - neoVI API
        • Using an array instead of a message structure - intrepidcs API
        • icsSpyTime Structure
        • stCM_ISO157652_TxMessage Structure
        • stCM_ISO157652_RxMessage Structure
        • Valid parameter names for the SetDeviceParameter and GetDeviceParameter methods
        • neoVI API Data Types
        • PhyRegPktClauseMess_t Structure
        • neoVI Network ID List
  • Development FAQ's
    • How do I detect and handle disconnects?
    • How do I set parameters on a neoVI device?
    • How do I open more than one channel on a single piece of hardware? - neoVI API
    • How do I communicate on LIN - neoVI API
    • How do I send a Extended Frame or a High Voltage Wakeup or ISO9141/KW2K Init? - neoVI API
  • Unix-like Operating Systems - Support
  • J2534 Support - neoVI API
  • Vehicle Spy Text API
    • ECU Object - Vehicle Spy Text API
    • Labview Text API Interface to Vehicle Spy 3
  • Vehicle Spy VSB file Spec
  • Contact Us
    • Contact Information - Intrepid Control Systems, Inc
Powered by GitBook
LogoLogo

Applications

  • Cybersecurity
  • Data Logging
  • Simulate ECU Functions
  • Diagnostics, Testing and Validation

Products

  • Vehicle Network Adapters
  • Data Loggers
  • Software
  • Automotive Ethernet Tools

Support

  • Support Resources
  • Contact Support
  • Class Schedule & Registration
  • Training Video Library

Company

  • About
  • News
  • Events
  • Contact Us

Copyright © 2025 | All Rights Reserved

On this page
Edit on GitHub
Export as PDF
  1. WIN32 API Overview - neoVI API
  2. Deprecated Functions Overview - neoVI API

OpenPortEx Method - neoVI API

PreviousDeprecated Functions Overview - neoVI APINextOpenPortEx Hardware Type Information - neoVI API

Last updated 2 years ago

This function is deprecated. Use the method instead.

This function opens a connection to a neoVI device.

int _stdcall icsneoOpenPortEx( int lPortNumber, int lPortType, int lDriverType, int lIPAddressMSB, int lIPAddressLSBOrBaudRate, int bConfigRead, unsigned char * bNetworkID, int * hObject);
Public Declare Function icsneoOpenPortEx Lib “icsneo40.dll” (ByVal lPortNumber As Integer, ByVal lPortType As Integer, ByVal lDriverID As Integer, ByVal lIPAddressMSB As Integer, ByVal lIPAddressLSBOrBaudRate As Integer, ByVal lForceConfigRead As Integer, ByRef bNetworkID As Byte, ByRef hObject As Integer) As Integer
[DllImport(“icsneo40.dll”)] public static extern int icsneoOpenPortEx(int lPortNumber, int lPortType, int lDriverID,int lIPAddressMSB, int lIPAddressLSBOrBaudRate, int lForceConfigRead, ref byte bNetworkID,ref int hObject);

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

Examples

unsigned char bNetworkID[16];     // array of network ids
int hObject = 0;         // holds a handle to the neoVI object
unsigned long lCount;            // counter variable
int iIPLSB;
int iIPMSB;

// initialize the networkid array
for (lCount=0;lCount<16;lCount++)
    bNetworkID[lCount] = lCount;


if (!m_bPortOpen) // only if not already opened
{
    iIPLSB = 57600;
    iIPMSB = 0;

    lResult = icsneoOpenPortEx(1 ,NEOVI_COMMTYPE_RS232,INTREPIDCS_DRIVER_STANDARD,iIPMSB,iIPLSB,1,bNetworkID,&hObject);
    if (lResult == 0)
        MessageBox(hWnd,TEXT("Problem Opening Port"),TEXT("neoVI Example"),0);
    else
    {
        m_bPortOpen =true;
        MessageBox(hWnd,TEXT("Port Opened Successfully"),TEXT("neoVI Example"),0);
    }
}
Dim lResult As Long
Dim iIPMSB As Integer
Dim iIPLSB As Integer

iIPMSB = 0
iIPLSB = 0
lResult = 0

''command To Open up the port
If optUsbDevice.Checked = False Then
    iIPLSB = 57600  ''Set Baud Rate for Serial Communication
    lResult = icsneoOpenPortEx(Val(txtCommPortNum.Text), NEOVI_COMMTYPE_RS232, _
        INTREPIDCS_DRIVER_STANDARD, iIPMSB, iIPLSB, 1, NETID_HSCAN, m_hObject)
Else
    lResult = icsneoOpenPortEx(Val(txtCommPortNum.Text), NEOVI_COMMTYPE_USB_BULK, _
            INTREPIDCS_DRIVER_STANDARD, iIPMSB, iIPLSB, 1, NETID_HSCAN, m_hObject)
End If

''Check the status of the opened port
If CBool(lResult) Then
    MsgBox("Port Opened OK!")
Else
    MsgBox("Problem Opening Port")
End If
m_bPortOpen = True
byte bNetworkIDs = 1;
int iPortNumber = 0;
int iReturnVal = 0; //iReturn value tells status of the function call
int iIPMSB = 0;
int iIPLSB = 0;

iPortNumber = Convert.ToInt32( txtCommPortNum.Text); //Convert type of Textbox Value
//Open the Device on the Port indicated in the Text box
if(optUsbDevice.Checked == false)
{
    iIPLSB = 57600;
    iReturnVal = icsNeoDll.icsneoOpenPortEx(iPortNumber, Convert.ToInt32(ePORT_TYPE.NEOVI_COMMTYPE_RS232),
        Convert.ToInt32(eDRIVER_TYPE.INTREPIDCS_DRIVER_STANDARD),iIPMSB ,iIPLSB,1, ref bNetworkIDs,     ref m_hObject);
}
else
{
    iReturnVal = icsNeoDll.icsneoOpenPortEx(iPortNumber, Convert.ToInt32(ePORT_TYPE.NEOVI_COMMTYPE_USB_BULK ),
        Convert.ToInt32(eDRIVER_TYPE.INTREPIDCS_DRIVER_STANDARD),iIPMSB , iIPLSB, 1, ref    bNetworkIDs,ref m_hObject);
}

if (iReturnVal == 0) // test the returned result
{
    MessageBox.Show("Problem Opening Port"); //Error, Show message
}
else
{
    MessageBox.Show("Port opened OK!");
    m_bPortOpen = true; //Set Port Opened Flag
}

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.

OpenNeoDevice
OpenPortEx Hardware Type
message structure
icsneoFreeObject
ClosePort
ClosePort