To use the neoVI API in C# add the icsNeoClass.cs Class into the C# project (figure 1). Right click on the solution and select “Add Existing Item” from the “Add” menu. Then, call the methods as defined in the WIN32 API Functions and Types Section of this document.
Figure 1 - Add Existing Item From the Add menu C#.NET Menu.
Example
A C# Dot Net 2010 example (Figure 1) is included to show how the API all works together. The main project files are as follows: 1) the project file: IcsApiDotNetCSharp.sln 2) the form file : Form1.cs, and 3) the neoVI module : icsNeoClass.cs. All project files are included in the following file CSnet2010.zip. This project will open in Visual Studio 2010, 2012, 2013, 2015 and 2017.
The example shows how to open and close communication to the driver, send messages and read messages on the networks.
Using the neoVI API in LabWindows CVI - neoVI API
Do the following steps to use neoVI in LabWindows CVI:
Copy the import library , header file , and data structure file to your project directory.
Basic Operation - neoVI API
Working with the neoVI API, the folloing steps and functions will be used.
Start the application.
Open the driver and find a neoVI or ValueCAN device.
Create the neoVI object using the method.
The neoVI API - Create your own software applications
Overview
The neoVI API provides a simple way to access the neoVI hardware with WIN32 development tools. This documentation describes how to use the API for custom applications. Each API has an example targeted for both C/C++, C#, and Visual Basic (VB). Operational examples are included for Visual C++, LabVIEW, LabWindows CVI, C++ Builder, Delphi, and Visual Basic.
Included with neoVI is the "icsneo40.dll" DLL. This DLL is a high performance multi-threaded DLL, capable of supporting many neoVI devices simultaneously. The DLL is through dynamic linkage.
For applications using neoVI and ValueCAN devices which do not use Windows, a is available. Intrepid Control Systems also has a with APIs and projects for a verity of different system configurations. Code here can be built to fit the needed system.
Unity3D Graphic Display API
Do the following steps to use Unity3D Graphic Display:
First set the scene for running an .exe file, then an explanation of how the scripts work.
Using the neoVI API in Visual Studio: 32 bit DLL and 64 bit OS - neoVI API
Visual Studio 2005 and newer contain different options to compile an application. By default, new programs or programs upgraded from earlier versions of Visual Studio will be configured as "ANY CPU". This option will run as a 32 bit program (x86) on a 32 bit version of Windows and as a 64 bit program (x64) in a 64 bit version of Windows. Projects can also be directly specified as 32 bit (x86) or 64 bit (x64).
Starting with icsneo40.dll version 3.7.1.73 and newer, a 64 bit dll was introduced. Using software installs from Intrepid Control Systems, the two dlls are installed to their proper locations on the system. The compiler settings will dictate which of the two dlls is used. Windows will map to the proper one.
The folder location for the icsneo40.dll depends on the Windows install. On a 32 bit (x86) PC, just the 32 bit version is installed to the System32 folder. On a 64 bit system (x64) the 32 bit version is stored in the SysWoW64 folder and the 64 bit version is in the System32 folder. Again the operating system will take care of this based on your settings in the compiler. In either case, the application would need to reference System32, or not specify the location at all. Windows will search the application folder followed by the proper system folder locations to access the correct dll based on your compile options
The configuration manager is used to set which compile type needed. The following are steps for changing the compile options Visual Studio 2010. For help with your version and level of Visual Studio, consult Visual Studio help or .
It is possible to change the compile options. The first step is to open the "Configuration Manager". This can be found by right clicking on your Solution and choosing "Configuration Manager" (figure 1).
Link to icsnLW40.lib import library by selecting Add Files To Project from the Edit pull down menu. In the “Add Files To Project” dialog select the icsnLW40.lib file (figure 1). You can also the headers from step 1 if you wish. Your project should now list the files you added (figure 2).
Figure 1 - Link to the “icsnLW40.lib”
Figure 2 - The project window with the library added.
3. Include the header icsnLW40.h in your C module (Figure 3).
Figure 3 - The #include statement in the C module.
4. Finally, call the methods as defined in the Basic Operation document.
Example
A National Instruments LabWindows example (Figure 1) is included to show how the API all works together. The example files are included in the following file: LWneoVI.zip (10kB)
The example shows how to open and close communication to the driver, send messages and read messages on the networks.
This is the Unity3D Demo in its entirety included to show how the API all works together; The example files are included in the following file: Unity3d Graphics Panel Demo (1537kB)
Figure 1 - Opening the Unity 3D Graphics Panel Demo
Open Unity3D. Locate and open the project folder called “Unity Graphic display API”. (Figure 1)
Figure 2 - Checking to see if the correct scene is open
In the project panel open the Unity scene called Unity_API_Demo. Once opened, in the game view is a place holder for the graphical display. This is where all the data will be visually displayed upon execution of the application. (Figure 2)
Next, locate the icsNeoClass.cs and make sure it is in the correct folder, this imports the .DLL into the project panel (cannot be in any other folder, other then the main “project asset folder”).
Figure 3 - Placing scripts in the correct window
Locate IcsNeoClassUnity.cs, located in the Scripts folder. This example script handles the functions of the Intrepid Hardware; open, close, transmit, receive, ect… Then attach the IcsNeoClassUnity.cs on the Main Camera. (refer to figure 3)
The demo should be all set up and ready to play out at this point. Press the play button near the top of the Unity3D windows to enter play mode and begin the demo. (Figure 4)
Figure 4 - The play button in Unity 3D when in play mode
Figure 5 - This is how your Graphics Panel should look in play mode
Figure 1 - Configuration Manager can be found in the Solution Explorer.
Once in Configuration Manager, the Active solution platform can be selected. If you do not have the required option, select "<New...>" (figure 2).
Figure 2 - Configuration Manager
After a new Platform has be created, it can be selected from the Standard tool bar (figure 4)
2) Add a #include "icsneo40DLLAPI.h" to your project
Figure 1 - include for “icsneo40DLLAPI.h”
Figure 2 - “icsneo40DLLAPI.cpp” added to project
3) Use the Functions "LoadDLLAPI" to load the functions and "UnloadDLLAPI" to unload the functions. Examples are below.
//-----Load the DLL
if(!LoadDLLAPI(hDLL))
{
//problem, close the application
printf("Problem loading Library\r\nMake sure icsneo40.dll is installed and accessable\r\nPress any key to Exit");
}
//-----Unload the DLL
UnloadDLLAPI(hDLL);
4) Finally, call the methods as defined in the he Basic Operation document.
Example
A Borland C++ Builder example (Figure 1) is included to show how the API all works together. The example files are included in the following file:
The example shows how to open and close communication to the driver, send messages and read messages on the networks.
3. Use the Functions “LoadDLLAPI” to load the functions and “UnloadDLLAPI” to unload the functions. Examples are below.
4. Finally, call the methods as defined in the document.
A Visual C++ example (Figure 1) is included to show how the API all works together. The example files are included in the following file:
The example shows how to open and close communication to the driver, send messages and read messages on the networks.
Using the neoVI API in Excel - neoVI API
To use the intrepidcs API in Excel or other VBA supported application add the bas_neoVI.vb module into your project (figure 1) by right clicking on the Project in the VBA Editor and selecting Insert and then Module. Open the bas_neoVI.vb. Then, call the methods as defined in the Basic Operation document. The function calls for use in VBA are the same as the calls in Visual Basic 6.
Figure 1 - Add Module Command From the VB.NET Menu.
Example
A VBA Excel example (Figure 1) is included to show how the API all works together. This project only has 1 file, NeoVIExample.XlS. Make sure macros are enabled to run this example. All the needed project files are included in the following file:
The example shows how to open and close communication to the driver, send messages and read messages on the networks.
neoVI FIRE 2 - neoVI API
Name
Description
Gets device and network parameters for a neoVI FIRE 2 device
Sets device and network parameters for a neoVI FIRE 2 device
HINSTANCE hDLL;
//-----Load the DLL
if(!LoadDLLAPI(hDLL))
{
//problem, close the application
printf("Problem loading Library\r\nMake sure icsneo40.dll is installed and accessable\r\nPress any key to Exit");
}
//-----Unload the DLL
UnloadDLLAPI(hDLL);
FreeObject Method - neoVI API
This method releases system resources used by the neoVI device.
void _stdcall icsneoFreeObject(void * hObject);
Public Declare Function icsneoFreeObject Lib “icsneo40.dll” (ByVal hObject As IntPtr)
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
**** [in] Specifies the driver object created by OpenNeoDevice.
Return Values
None.
Remarks
This method is used to release any resources that were allocated by . Applications that create neoVI handles should release them using this method, however, the intrepidCS API will release any resources that it created for the client application when the client application ends and the API is unloaded. The LabVIEW neoClosePort.vi will call the FreeObject API.
Examples
Message Functions Overview - neoVI API
Name
Description
Reads messages from the neoVI device.
Transmits messages to vehicle networks using a neoVI device.
Transmits messages to vehicle networks using a neoVI device. Used with CAN FD and Ethernet
Waits a specified amount of time in milliseconds for a received message
Basic Functions Overview - neoVI API
Name
Description
Used to locate connected neoVI devices.
Used to open a communication link with a specific neoVI device.
Closes the communication link with the neoVI device.
Releases system resources used by the neoVI device.
ISO15765 Message Functions Overview - neoVI API
Name
Description
Enables ISO15765 functions. Must be called before Tx and RX functions.
Sends a ISO15765 message on CAN.
Looks for specified frames and responds with specified flow control on CAN.
ValueCAN3 - neoVI API
Name
Description
Gets device and network parameters for a ValueCAN3 device
Sets device and network parameters for a ValueCAN3 device
ForceFirmwareUpdate Method - neoVI API
This method forces the firmware on neoVI device to be updated.
Public Declare Function icsneoForceFirmwareUpdate Lib “icsneo40.dll” (ByVal hObject As IntPtr)
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice.
Return Values
int.
Remarks
This method is used to force the firmware on a neoVI device to be updated to the version stored in the DLL API.
Examples
GetLastAPIError Method - neoVI API
This method returns the error generated by the last API call.
int _stdcall icsneoGetLastAPIError(void* hObject,int*piErrorNumber
Public Declare Function icsneoGetLastAPIError Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef piErrorNumber As Integer) As Integer
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice.
piErrorNumber
[out] The value of the error generated by the previous API call will be returned. The text description of the error can then be obtained by calling .
Return Values
If an error was generated and stored during the last API call then 1 will be returned. 0 will be returned if no error was generated since the port was opened or the last time that was called. The stored error will be cleared after this call. API errors are generated and stored on a ‘per-thread’ basis. The calling thread will only receive errors generated within it’s own context. If a new API error is generated before the previous error has been retrieved, the previous error will be lost. All errors generated can still be retrieved using . However, will return errors generated in all threads, not just the current thread.
Remarks
Examples
Using the intrepidcs API in Visual Basic - neoVI API
To use the neoVI API in Visual Basic add the Download the file bas_neoVI.vb module into the VB project (figure 1) by right clicking on the Solution and selecting Add Existing Item from the Add menu. Open the bas_neoVI.vb. Then, call the methods as defined in the WIN32 API Functions and Types Section of this document.
Figure 1 - Add Module Command From the VB.NET Menu.
Example
A Visual Basic Dot Net 2010 example (Figure 1) is included to show how the API all works together. The main project files are as follows: 1) the project file: IcsNeoDotNet.sln 2) the form file : Form1.vb, and 3) the neoVI module : bas_neoVI.vb. All project files are included in the following file . This project will open in Visual Studio 2010, 2012, 2013, 2015, and 2017.
The example shows how to open and close communication to the driver, send messages and read messages on the networks.
ValueCAN 4-4 - neoVI API
Name
Description
Gets device and network parameters for a ValueCAN 4-4 device
Sets device and network parameters for a ValueCAN 4-4 device
GetMessages Method - neoVI API
Parameters
hObject
[in] Specifies the driver object created by .
pMsg
GetTimeStampForMsg Method - neoVI API
This method calculates the timestamp for a message, based on the connected hardware type, and converts it to a usable variable.
Parameters
hObject
[in] Specifies the driver object created by .
Transmitting Long Messages - neoVI API
Overview
For ISO9141 and Keyword 2000 Networks, a long message transmission option is allowed. Long message transmission is necessary when the message length exceeds twelve bytes (including checksum if used).
You can transmit a long message by calling the method with modified arguments. First, you will pass an array of icsSpyMessage structures which contain the long message data. This data in the array must be set properly. Finally, you must set the lNumMessages argument to the number of structures.
You must setup the long message data properly. For the first message, both the 3 byte Header and the 8 byte data section are filled in. For consecutive messages only the 8 byte data section is filled in.
VB Example to Send a 16 byte message
Error Functions Overview - neoVI API
Name
Description
Using the neoVI API in Delphi - neoVI API
Do the following steps to use neoVI in Borland Delphi:
Copy the import library , and data structure file to your project directory.
Link to icsn40.pas import library via the “Add to Project…” option (Figure 1). This dialog is accessible via the “Project” pull down menu in Delphi. When the file dialog appears, select the icsn40.pas.
ClearReflashDisplayCallbacks Method - neoVI API
This method is used to clear callback functions that were set using the SetReflashDisplayCallback method.
'// Declared at form level
Private m_hObject As intptr '// Holds the object for the state of the application
Dim stMsgJ1850(0 To 3) As icsSpyMessageJ1850
Dim lResult As Long
'//Fill in first header
stMsgJ1850(0).Header1 = &H1
stMsgJ1850(0).Header2 = &H2
stMsgJ1850(0).Header3 = &H0
stMsgJ1850(0).NumberBytesHeader = 3
'//Fill in data
stMsgJ1850(0).Data1 = &H4
stMsgJ1850(0).Data2 = &H5
stMsgJ1850(0).Data3 = &H6
stMsgJ1850(0).Data4 = &H7
stMsgJ1850(0).Data5 = &H8
stMsgJ1850(0).Data6 = &H9
stMsgJ1850(0).Data7 = &H10
stMsgJ1850(0).Data8 = &H11
stMsgJ1850(0).NumberBytesData = 8
'//Fill in data
stMsgJ1850(1).NumberBytesHeader = 0
stMsgJ1850(1).Data1 = &H12
stMsgJ1850(1).Data2 = &H13
stMsgJ1850(1).Data3 = &H14
stMsgJ1850(1).Data4 = &H15
stMsgJ1850(1).Data5 = &H16
stMsgJ1850(1).NumberBytesData = 5
'// Transmit the assembled message
lResult = icsneoTxMessages(m_hObject, stMsgJ1850(0), NETID_ISO, 2)
'// Test the returned result
If Not CBool(lResult) Then
MsgBox("Problem Transmitting Message")
End If
[out] This is the address of the first element of an array of
structures. This array will be loaded with messages received by the hardware. This array must be sized to fit 20,000
structures.
pNumberOfMessages
[out] Specifies the number of messages the driver has loaded in the pMsg array. This number can be up to 20,000 messages.
pNumberOfErrors
[out] Specifies the number of errors in the neoVI DLL error queue. Errors are obtained using GetErrorMessages.
Return Values
Returns 1 if successful, 0 if an error occurred. GetLastAPIError must be called to obtain the specific error. This function will return 1 even if no messages were received, provided there are no errors. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
Remarks
The driver object will hold 20,000 received messages before it will generate an rx buffer overflow error (indicated by a NEOVI_ERROR_DLL_RX_MSG_BUFFER_OVERFLOW error message in the error queue). It is the job of the application software to read this buffer at regular intervals. The rate that the application needs to read these messages is dependant on the rate messages are received on the bus. For example, a high bandwidth CAN bus can generate 5000 messages per second. In this case you must read out the messages at least every four seconds or overflow errors will result.
Examples
void* hObject =0;// holds a handle to the neoVI object
Dim lResult As Long ''Storage for Result of Call
Dim iNumberOfErrors As Long ''Storage for number of errors
Dim lNumberOfMessages As Long ''Storage for number of messages
Dim stMessages(20000) As icsSpyMessage '// Array of message structures to hold the received data
lResult = icsneoGetMessages(m_hObject, stMessages(0), lNumberOfMessages, iNumberOfErrors) ''Call get message function
If Not CBool(lResult) Then ''See if Call was successful
MsgBox("Problem Getting Messages")
Exit Sub
End If
Public Declare Function icsneoGetMessages Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pMsg As icsSpyMessage, ByRef pNumberOfMessages As Int32, ByRef pNumberOfErrors As Int32) As Int32
[in] The message to be used for calculating timestamp.
pTimeStamp
[out] The calculated timestamp.
Return Values
Returns 1 if successful, 0 if an error occurred. GetLastAPIError must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
Remarks
Different models of neoVI devices have different time resolutions. This function uses the proper formula to calculate a timestamp based on the connected device type.
Examples
int hObject;int iResult;double dTimeStamp;
Dim iResult As Integer
Dim dTimeStamp As Double
icsSpyMessage Msg;
iResult = icsneoGetTimeStampForMsg(m_hObject, Msg, dTimeStamp)
intiResult;longlTimeStamp;icsSpyMessage
Public Declare Function icsneoGetTimeStampForMsg Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pMsg As icsSpyMessage, ByRef pTimeStamp As Double) As Int32
3. Your project manager will now show the import library icsn40.pas (Figure 2).
Figure 2 - The import library “icsn40.pas” is loaded.
4. Include icsn40 and icsSpyData in your interface Uses (Figure 3).
Figure 3 - Adding to Interface Uses
5. Finally, call the methods as defined in the Basic Operation document.
Example
A Borland Delphi example (Figure 1) is included to show how the API all works together. The example files are included in the following file: icsnDelphiSample.zip (14kB)
The example shows how to open and close communication to the driver, send messages, and read messages on the networks.
This method returns the neoVI hardware devices connected to the PC.
int _stdcall icsneoOpenDevice(NeoDeviceEx* pNeoDeviceEx,void* hObject,
Public Declare Function icsneoOpenDevice Lib "icsneo40.dll" (ByRef pNeoDeviceEx As NeoDeviceEx, ByRef hObject As IntPtr, ByRef bNetworkIDs As Byte, ByVal bConfigRead As Int32, ByVal iOptions As Int32, ByRef stOptionsOpenNeoEx As OptionsOpenNeoEx, ByVal Reserved As UInt32) As Int32
[DllImport(“icsneo40.dll”)]publicstatic
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 and 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 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 can be made. The key is to provide a different for each device you want to open. For other function calls, use the returned hObject to talk to that device.
Each successful call to should be matched with a call to a when you are finished accessing the hardware. methods.
Examples
GetConfiguration Method - neoVI API
This method reads the configuration from the hardware device.
Note: This function is only to be used for neoVI Blue and ValueCAN. For neoVI Fire and neoVI Red use theGetFireSettingsmethod. For ValueCAN3 use theGetVCAN3Settingsmethod.
int _stdcall icsneoGetConfiguration(int hObject,unsignedchar*
Public Declare Function icsneoGetConfiguration Lib "icsneo40.dll" (ByVal hObject As Int32, ByRef pData As Byte, ByRef lNumBytes As Int32) As Int32
[DllImport("icsneo40.dll")]publicstatic
Parameters
hObject
[in] Specifies the driver object created with the method.
pData
[out] Pointer to an array of 1024 bytes. Each index of the array corresponds to a configuration value. For a list of configuration values to change, please see the Configuration Array topic.
plNumBytes
[out] This will return the number of bytes written to the array. For the current version of the API this will be 1024 bytes.
Return Values
Returns 1 if successful, 0 if an error occurred. must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
Remarks
None.
Examples
Displays the Value of CNF1 of ValueCAN/neoVI HSCAN
ISO15765_EnableNetworks Method - neoVI API
This method enables the use of ISO15765-2 on a CAN network. icsneoISO15765_EnableNetwroks must be called before using icsneoISO15765_TransmitMessage or icsneoISO15765_ReceiveMessage.
Public Declare Function icsneoISO15765_EnableNetworks Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByVal Network As UInt32) As Int32
[DllImport(“icsneo40.dll”)]public
Parameters
hObject
[in] Handle which specifies the driver object created with the OpenPort method.
lNetwork
[in] Specifies which CAN network the status is requested for. Can be one of the following values:
Network
Value
Return Values
None.
Remarks
None.
Examples
Deprecated Functions Overview - neoVI API
Name
Description
Use OpenNeoDevice
OpenPort
Use OpenNeoDevice
It is no longer necessary to call this before and after calling SendConfiguration
No longer supported. It is present in the API but will always return 0
EnableDOIPLine Method - neoVI API
This method enables or disables the Ethernet activation line on supported hardware devices.
int _stdcall icsneoEnableDOIPLine(void* hObject,bool bActivate);
Public Declare Function icsneoEnableDOIPLine Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByVal bActivate As Boolean) As Int32
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice
bActivate
[in] Specifies the state of the Activation line. True enables the activation and False disabled it.
Return Values
1 if the function succeeded. 0 if it failed for any reason. r must be called to obtain the specific error.
Remarks
The specified hardware must support a DoIP activation line
Examples
OpenPortEx Hardware Type Information - neoVI API
This topic discusses which port type can be used with what type of hardware.
A required parameter for the OpenPortEx command is the Port type. Each type is and the hardware it supports is listed below.
Port type type
Applicable hardware
Notes
RS232
neoVI Blue (USB or RS232 connection)
neoVI Pro (USB or RS232 connection)
neoVI Green (RS232)
Devices that use a USB connection listed here have a virtual COM port connection to the PC even though it is connected to the USB port on the PC.
StopSocketServer Method - neoVI API
This method starts the TCP/IP socket server at a specified port.
int _stdcall icsneoStopSockServer(int hObject);
Public Declare Function icsneoStopSockServer Lib “icsneo40.dll” (ByVal hObject As Integer) As Integer
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Handle to the driver object created by OpenNeoDevice
Return Values
If the server has been stopped successfully the return value will be 1. If the function fails the return value will be zero.
Remarks
This method should be called when the server created with .
Examples
SetRTC Method - neoVI API
This method sets the value of the real-time clock on a connected neoVI device.
int _stdcall icsneoSetRTC(void* hObject, icsSpyTime *pTime);
Public Declare Function icsneoSetRTC Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pTime As icsSpyTime) As Int32
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice.
pTime
[in] The address of a icsSpyTime structure. This structure is defined in the file icsSpyDataCommon.h
Return Values
1 if the function succeeded. 0 if it failed for any reason. must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
Remarks
Examples
ValueCAN RF - neoVI API
Name
Description
Gets device and network parameters for a ValueCAN RF device
Sets device and network parameters for a ValueCAN RF device
GetRTC Method - neoVI API
This method returns the value of the real-time clock on a connected neoVI device.
int _stdcall icsneoGetRTC(void* hObject, icsSpyTime *pTime);
Public Declare Function icsneoGetRTC Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pTime As icsSpyTime) As Int32
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice.
pTime
[in] The address of a icsSpyTime structure. This structure is defined in the file icsSpyDataCommon.h
Return Values
1 if the function succeeded. 0 if it failed for any reason. must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
Remarks
Examples
General Device Settings - neoVI API
These functions are designed to work for both 2G and 3G devices
Name
Description
Set the baud or bit rate for a specific neoVI network
Gets the firmware version of a neoVI device
Gets the firmware version stored in the DLL API
GetDeviceParameters Method - neoVI API
This method forces the firmware on neoVI device to be updated.
int _stdcall icsneoGetDeviceParameters(void* hObject,char*pParameters
Public Declare Function icsneoGetDeviceParameters Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pParameters As Byte, ByRef pValues As Byte, ByVal ValuesLength As short) As Integer
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice.
pParameters
[in] This is an array containing parameter names. Each parameter is separated by a comma. The parameter names are matched without regard to case. All spaces are ignored. The size of this array must be 1024 bytes or less. The format of the array is:
ParameterName,ParameterName, , …
See for a list of parameter names for each device and supported network.
See examples below on how to build a parameter string.
pValues
[out] This array will contain the values requested in the pParameters array. The values will be separated by comma’s and in the order of the parameter names specified in the pParameters array. If a parameter name is not recognized the word “Error” will be placed in that value’s location. If the pValues array length (specified by the ValuesLength parameter) is not long enough to store all of the values, the retrieval of parameter values will end and only a portion of the values will have be read and stored. The return value of the function, if greater than 0, will indicate the number of values read.
Return Values
-1 if there was an error while reading parameter values from the device. A return value greater than 0 indicates the total number of parameters read. A return value of 0 indicates that ValueLength was greater than 1024. must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
Remarks
It is ineffecient to use this function to read one parameter value at a time. If multiple parameters need to be read, combine them into a long string and call this function once.
Examples
GetDLLFirmwareInfo Method - neoVI API
int _stdcall icsneoGetDLLFirmwareInfo(void* hObject, stAPIFirmwareInfo *pInfo);
Public Declare Function icsneoGetDLLFirmwareInfo Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pInfo As stAPIFirmwareInfo) As Integer
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice.
pInfo
[out] Pointer to an structure.
Return Values
Returns 1 if successful, 0 if an error occurred.
Remarks
This method returns the version information for the neoVI firmware stored within the neoVI DLL API. This is the version that will be written to the neoVI device by the method.
Examples
GetPerformanceParameters Method - neoVI API
int _stdcall icsneoGetPerformanceParameters(void* hObject,int* iBufferCount
Public Declare Function icsneoGetPerformanceParameters Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef iBufferCount As Integer, ByRef iBufferMax As Integer, ByRef iOverFlowCount As Integer, ByRef iReserved1 As Integer, ByRef iReserved2 As Integer, ByRef iReserved3 As Integer, ByRef iReserved4 As Integer, ByRef iReserved5 As Integer) As Integer
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Specifies the driver object created with the OpenPort method.
iBufferCount
[out] Specifies the driver object created with the OpenPort method.
IBufferMax
[out] Specifies the size of the buffer.
iOverFlowCount
[out] Indicates the the number of overflows that have occurred since the last successful OpenPort method was called.
iReserved1
[out] Reserved. Set to 0.
iReserved2
[out] Reserved. Set to 0.
iReserved3
[out] Reserved. Set to 0.
iReserved4
[out] Reserved. Set to 0.
iReserved5
[out] Reserved. Set to 0.
Return Values
This function returns the 1 when successful. 0 if otherwise.
Remarks
XX.
Examples
SetDeviceParameters Method - neoVI API
This method changes neoVI device parameters.
int _stdcall icsneoSetDeviceParameters(void* hObject,char*pParmValue
[DllImport(“icsneo40.dll”)]publicstatic
Public Declare Function icsneoSetDeviceParameters Lib “icsneo40.dll”(ByVal hObject As IntPtr, ByVal pParmValue As String, ByRef pErrorIndex As Int32, ByVal bSaveToEEPROM As Int32) As Int32
Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice.
pParmValue
[in] This is an array containing parameter names and values. Each parameter and value is separated by a equal sign, and each parameter/value pairing is separated by a comma. The parameter names are matched without regard to case. All spaces are ignored. The size of this array must be 1024 bytes or less. The format of the array is:
ParameterName=Value,ParameterName=Value, …
See for a list of parameter names for each device and supported network.
See examples below on how to build a parameter/value string.
pErrorIndex
[out] If there are any errors detected within the pParmValue parameter, this value will indicate index of the parameter where the first error was found. The index is zero-based.
bSaveToEEPROM
[in] This value determines if the parameter changes are permanent or will be lost when the device is power-cycled. Set the value to 1 to write the changes to EEPROM, 0 to keep the changes restricted to RAM.
Return Values
1 if the changes are successful. -1 if there was an error while writing the changes to the device. 0 if there is an error detected within the pParmValue array. If the return value is 0, indicating an error, check the pErrorIndex to get the index of the first error detected within the pParmValue array. must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
Remarks
It is ineffecient to use this function to write one parameter change at a time. If multiple parameters need to be changed, combine them into a long string and call this function once.
Examples
GetHWFirmwareInfo Method - neoVI API
This method returns the firmware version of the open neoVI device.
int _stdcall icsneoGetHWFirmwareInfo(void* hObject, stAPIFirmwareInfo *pInfo);
Public Declare Function icsneoGetHWFirmwareInfo Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pInfo As stAPIFirmwareInfo) As Integer
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice.
pInfo
[out] Pointer to an structure.
Return Values
Returns 1 if successful, 0 if an error occurred.
Remarks
This method returns the firmware version stored in the open neoVI device.
Examples
GetDLLVersion Method - neoVI API
This method returns the software version of the DLL.
int _stdcall icsneoGetDLLVersion();
Public Declare Function icsneoGetDLLVersion Lib “icsneo40.dll” () As Integer
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
None.
Return Values
This function returns the version number of the API.
Remarks
None.
Examples
StartSocketServer Method - neoVI API
This method starts the TCP/IP socket server at a specified port.
int _stdcall icsneoStartSockServer(int hObject,int iPort);
Public Declare Function icsneoStartSockServer Lib “icsneo40.dll” (ByVal hObject As Integer, ByVal iPort As Integer) As Integer
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Handle which specifies the driver object created by OpenNeoDevice
iPort
[in] specifies the TCP/IP Port where the server will be established.
Return Values
If the server was started successfully the return value will be non-zero.
Remarks
This method creates a TCP/IP server in the DLL. This server can be attached to by any TCP/IP clients using the RAW API or using the DLL by specifying TCP/IP with . Only one server is allowed at a time.
Examples
ISO15765_ReceiveMessage Method - neoVI API
This method configures a receive message using ISO15765-2 on a CAN network. icsneoISO15765_EnableNetwroks must be called before using icsneoISO15765_ReceiveMessage. PCI bytes and Flow control decoding is taken care of by the dll for the transaction.
Parameters
hObject
[in] Handle which specifies the driver object created with the OpenPort method.
ClosePort Method - neoVI API
This method closes the communication link with the neoVI hardware.
Parameters
hObject
[in] Specifies the driver object created by .
Device Settings Functions Overview - neoVI API
Name
Description
GetFireSettings Method - neoVI API
This method reads the configuration settings from a neoVI Fire device.
Parameters
hObject
[in] Specifies the driver object created by .
SetFireSettings Method - neoVI API
This method writes configuration settings to a neoVI Fire device.
Parameters
hObject
[in] Specifies the driver object created by .
GetFIRE2Settings Method - neoVI API
This method reads the configuration settings from a neoVI FIRE 2 device.
Parameters
hObject
[in] Specifies the driver object created by .
SetVCAN412Settings Method - neoVI API
This method writes configuration settings to a ValueCAN4-1 and ValueCAN4-2 device.
Parameters
hObject
[in] Specifies the driver object created by .
SetVCAN4Settings Method - neoVI API
This method writes configuration settings to a ValueCAN4-4 device.
Parameters
hObject
[in] Specifies the driver object created by .
GetVCANRFSettings Method - neoVI API
This method reads the configuration settings from a ValueCAN RF device.
Parameters
hObject
[in] Specifies the driver object created by .
GetRADGalaxySettings Method - neoVI API
This method reads the configuration settings from a RAD Galaxy device.
Parameters
hObject
[in] Specifies the driver object created by .
SetRADGalaxySettings Method - neoVI API
This method reads the configuration settings from a RAD Galaxy device.
Parameters
hObject
[in] Specifies the driver object created by .
ValidateHObject Method - neoVI API
This method is used to determine if a driver object is valid.
Parameters
hObject
[in] Specifies the driver object created by .
GetGPTPStatus Method - neoVI API
This method sets bit rates for networks on neoVI devices
Parameters
hObject
__ [in] Specifies the driver object created by OpenNeoDevice.
gptpStatus
[out] The address of a GPTPStatus structure.
Return Values
SetReflashDisplayCallbacks Method - neoVI API
This method is used to set ‘call back’ functions that will be called by the neoVI API when flashing a neoVI device with thefunction. This overrides the Windows dialog box that normally displays the progress of a neoVI flash update. The use of call back functions allows the client application to receive the status messages and display them as desired.
Parameters
void (*OnPrompt)(unsigned long)
ScriptStop Method - neoVI API
This method stops the execution of a script that is running on a neoVI device.
Parameters
hObject
[in] Specifies the driver object created by .
Structures, Types, and Defines Overview - neoVI API
Item
Description
EnableNetworkCom Method - neoVI API
This function is deprecated. Use the EnableNetworkRXQueue method instead.
This method enables or disables all vehicle network rx data.
Parameters
lEnable
long lResult; //Storage the Result for the function call
int lNumberOfErrors = 0; //Storage for the number of Errors
int lNumberOfMessages = 0; //Storage for the number of messages
//Call Get messages
lResult = icsNeoDll.icsneoGetMessages(m_hObject, ref stMessages[0],ref lNumberOfMessages,ref lNumberOfErrors);
if(lResult == 0) //Check the Results to see if there is a problem
{
MessageBox.Show ("Problem Getting Messages");
return;
}
icsSpyMessage stMessages[20000];// holds the received messages
long lResult;icsSpyTime icsTime;//Call for RTClResult =icsneoGetRTC(m_hObject,&icsTime);
longlResult;icsSpyTimeicsTime;//Call for RTClResult=icsNeoDll.icsneoGetRTC(m_hObject,reficsTime);
extern
int
icsneoGetDLLFirmwareInfo
(
IntPtr
hObject
,
ref
stAPIFirmwareInfo
pInfo
);
Dim FirmwareInfo As stAPIFirmwareInfo
Dim iResult As Integer
iResult = icsneoGetDLLFirmwareInfo(m_hObject, FirmwareInfo)
If iResult = 0 Then
MsgBox("Problem getting the version of the firmware stored within the DLL API")
Exit Sub
End If
stAPIFirmwareInfo FirmwareInfo;int iResult;iResult =icsneoGetDLLFirmwareInfo(m_hObject,&FirmwareInfo);if(iResult ==0){MessageBox::Show("Problem getting the version of the firmware stored within the DLL API");return;}
stAPIFirmwareInfoFirmwareInfo=newstAPIFirmwareInfo();intiResult;iResult=icsNeoDll.icsneoGetDLLFirmwareInfo(m_hObject,refFirmwareInfo);if(iResult==0){MessageBox.Show("Problem getting the version of the firmware stored within the DLL API");return;}
extern
int
icsneoGetHWFirmwareInfo
(
intPtr
hObject
,
ref
stAPIFirmwareInfo
pInfo
);
Dim FirmwareInfo As stAPIFirmwareInfo
Dim iResult As Integer
iResult = icsneoGetHWFirmwareInfo(m_hObject, FirmwareInfo)
If iResult = 0 Then
MsgBox("Problem getting the neoVI's firmware information")
Exit Sub
End If
stAPIFirmwareInfo FirmwareInfo;int iResult;iResult =icsneoGetHWFirmwareInfo(m_hObject,&FirmwareInfo);if(iResult ==0){MessageBox::Show("Problem getting the neoVI's firmware information");return;}
stAPIFirmwareInfoFirmwareInfo=newstAPIFirmwareInfo();intiResult;iResult=icsNeoDll.icsneoGetHWFirmwareInfo(m_hObject,refFirmwareInfo);if(iResult==0){MessageBox.Show("Problem getting the neoVI's firmware information");return;}
extern
int
icsneoGetDLLVersion
();
'// get the DLL version information and place in Button text
Button1.Text = "Version " + Convert.ToString(icsneoGetDLLVersion)
charszOut[200];// get the DLL version and report itwsprintf(szOut,TEXT("intrepidcs API DLL Version %d\n"),icsneoGetDLLVersion());MessageBox(hWnd,szOut,TEXT("Message"),MB_ICONINFORMATION);
'// get the DLL version information and place in Button textButton1.Text="Version "+Convert.ToString(icsNeoDll.icsneoGetDLLVersion());
extern
int
icsneoStartSockServer
(
int
hObject
,
int
iPort
);
bStatus = icsneoStartSockServer(m_hObject, iPort)) '// start the socket server
[in] Specifies a function pointer that will be called when a message must be displayed instructing the user to disconnect and then re-connect the neoVI from the USZB port. The function receives an unsigned long that will contain the serial number of the neoVI device being flash updated. Before returning from this function call the user of the client application must be prompted to unplug the neoVI from the USB port and then re-connect it before continuing. This is to put the USB chip in the neoVI into bootloader mode so that flashing can begin. This function will not be called when flashing a ValueCAN3 device.
[in] Specifies a function pointer that will be called when a flashing status message is ready to be displayed. The function recieves a pointer to a wide character string that contains the status message to display. It also receives an unsigned long that contains the percentage complete for the current chip being flashed. The percentage value will reset to 0 for each new chip. For example, the neoVI Fire has four chips to flash while the ValueCAN3 has only two.
Return Values
1 if successful, 0 if either function pointer is NULL.
Remarks
After calling this function you must call the ForceFirmwareUpdate function to cause the neoVI device firmware to be updated. Once the callbacks have been set they are valid and active until the the DLL is unloaded or until the ClearReflashDisplayCallbacks function is called.
int _stdcall icsneoSetReflashDisplayCallbacks(void(*OnPrompt)(unsignedlong),void(*OnReflashUpdate)(constwchar_t*,unsignedlong));
[in] When 1 it will enable network receive. When 0 it will disable network receive.
Return Values
This function returns the 1 when successful. 0 if otherwise.
Remarks
This function will enable and disable network traffic for all client applications connected to the neoVI. The icsneoEnableNetworkRXQueue function can be used to enable and disable the receive message queue for individual applications.
Examples
icsneoEnableNetworkCom(m_hObject,0);
Call icsneoEnableNetworkCom(m_hObject, 0)
icsNeoDll.icsneoEnableNetworkCom(m_hObject,0);
Public Declare Function icsneoEnableNetworkCom Lib “icsneo40.dll” (ByVal hObject As Integer, ByVal lEnable As Integer) As Integer
int _stdcall icsneoEnableNetworkCom(int hObject,int lEnable);
[in] This value is always the size, in bytes, of the SFireSettings structure.
bSaveToEEPROM
[in] If set to 0, the settings changes will revert to the values stored in EEPROM when the neoVI is power-cycled. If set to 1, the values will overwrite the EEPROM settings and become persistent across power-cycles of the neoVI.
Return Values
Returns 1 if successful, 0 if an error occurred. GetLastAPIError must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
Remarks
Before using this function, the SFireSettings structure must be initialized with the current neoVI settings using GetFireSettings.
Examples
Public Declare Function icsneoSetFireSettings Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pSettings As SFireSettings , ByVal iNumBytes As Int32, ByVal bSaveToEEPROM As Int32) As Int32
[in] This value is always the size, in bytes, of the SVCAN412Settings structure.
bSaveToEEPROM
[in] If set to 0, the settings changes will revert to the values stored in EEPROM when the ValueCAN3 is power-cycled. If set to 1, the values will overwrite the EEPROM settings and become persistent across power-cycles of the ValueCAN4-1 and ValueCAN4-2.
Return Values
Returns 1 if successful, 0 if an error occurred. GetLastAPIError must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
Remarks
Before using this function, the SVCAN412Settings structure must be initialized with the current neoVI settings using GetVCAN412Settings.
Examples
Public Declare Function icsneoSetVCAN412Settings Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pSettings As SVCAN412Settings, ByVal iNumBytes As Int32, ByVal bSaveToEEPROM As Int32) As Int32
[in] The address of an allocated SVCAN4Settings structure.
iNumBytes
[in] This value is always the size, in bytes, of the SVCAN4Settings structure.
bSaveToEEPROM
[in] If set to 0, the settings changes will revert to the values stored in EEPROM when the ValueCAN3 is power-cycled. If set to 1, the values will overwrite the EEPROM settings and become persistent across power-cycles of the ValueCAN4-4.
Return Values
Returns 1 if successful, 0 if an error occurred. GetLastAPIError must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
Remarks
Before using this function, the SVCAN4Settings structure must be initialized with the current neoVI settings using GetVCAN4Settings.
Examples
Public Declare Function icsneoSetVCAN4Settings Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pSettings As SVCAN4Settings, ByVal iNumBytes As Int32, ByVal bSaveToEEPROM As Int32) As Int32
[in] This value is always the size, in bytes, of the SRADGalaxySettings structure.
bSaveToEEPROM
[in] If set to 0, the settings changes will revert to the values stored in EEPROM when the ValueCAN3 is power-cycled. If set to 1, the values will overwrite the EEPROM settings and become persistent across power-cycles of the ValueCAN3.
Return Values
Returns 1 if successful, 0 if an error occurred. GetLastAPIError must be called to obtain the specific error. The errors that can be generated by this function are:
Public Declare Function icsneoSetRADGalaxySettings Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pSettings As SRADGalaxySettings, ByVal iNumBytes As Int32, ByVal bSaveToEEPROM As Int32) As Int32
int iRetVal;bool bState;bState =true;iRetVal =icsneoEnableDOIPLine(hObject,bState);if(iRetVal ==0){printf("\nFailed to set DoIP Act");}else{printf("\nSuccessfully set DoIP Act");}
SFireSettings FireReadSettings;
int iNumberOfBytes;
int iResult;
//################################
//FireReadSettings struct is read
//and changed as needed before
//Setting the new values
//################################
iNumberOfBytes=sizeof(SFireSettings);
iResult = icsneoSetFireSettings(m_hObject, &FireReadSettings, iNumberOfBytes, 1);
if(iResult == 0)
{
MessageBox::Show("Problem Sending FIRE configuration");
return;
}
SFireSettings FireReadSettings = new SFireSettings();
int iNumberOfBytes;
int iResult;
//################################
//FireReadSettings struct is read
//and changed as needed before
//Setting the new values
//################################
iNumberOfBytes = System.Runtime.InteropServices.Marshal.SizeOf(VcanReadSettings);
iResult = icsNeoDll.icsneoSetFireSettings(m_hObject, ref FireReadSettings, iNumberOfBytes, 1);
if(iResult == 0)
{
MessageBox.Show("Problem Sending FIRE configuration");
return;
}
Dim FireReadSettings As SFireSettings
Dim iNumberOfBytes As Integer
Dim iResult As Integer
'//################################
'//FireReadSettings struct is read
'//and changed as needed before
'//Setting the new values
'//################################
iNumberOfBytes = System.Runtime.InteropServices.Marshal.SizeOf(VcanReadSettings)
iResult = icsneoSetFireSettings(m_hObject, FireReadSettings, iNumberOfBytes, 1)
If iResult = 0 Then
MsgBox("Problem Sending FIRE configuration")
Exit Sub
End If
SVCAN412Settings VCANReadSettings;
int iNumberOfBytes;
int iResult;
//################################
//VCANReadSettings struct is read
//and changed as needed before
//Setting the new values
//################################
iNumberOfBytes=sizeof(VCANReadSettings );
iResult = icsneoSetVCAN412Settings(m_hObject, &VCANReadSettings , iNumberOfBytes, 1);
if(iResult == 0)
{
MessageBox::Show("Problem Sending VCAN configuration");
return;
}
SVCAN412Settings VCANReadSettings = new VCANReadSettings();
int iNumberOfBytes;
int iResult;
//################################
//VCANReadSettings struct is read
//and changed as needed before
//Setting the new values
//################################
iNumberOfBytes = System.Runtime.InteropServices.Marshal.SizeOf(VCANReadSettings);
iResult = icsNeoDll.icsneoSetVCAN412Settings(m_hObject, ref VCANReadSettings , iNumberOfBytes, 1);
if(iResult == 0)
{
MessageBox.Show("Problem Sending VCAN configuration");
return;
}
Dim VCANReadSettings As SVCAN412Settings
Dim iNumberOfBytes As Integer
Dim iResult As IntPtr
'//################################
'//VCANReadSettings struct is read
'//and changed as needed before
'//Setting the new values
'//################################
iNumberOfBytes = System.Runtime.InteropServices.Marshal.SizeOf(VCANReadSettings)
iResult = icsneoSetVCAN412Settings(m_hObject, VCANReadSettings , iNumberOfBytes, 1)
If iResult = 0 Then
MsgBox("Problem Sending VCAN configuration")
Exit Sub
End If
SVCAN4Settings VCANReadSettings;
int iNumberOfBytes;
int iResult;
//################################
//VCANReadSettings struct is read
//and changed as needed before
//Setting the new values
//################################
iNumberOfBytes=sizeof(VCANReadSettings );
iResult = icsneoSetVCAN4Settings(m_hObject, &VCANReadSettings , iNumberOfBytes, 1);
if(iResult == 0)
{
MessageBox::Show("Problem Sending VCAN configuration");
return;
}
SVCAN4Settings VCANReadSettings = new SVCAN4Settings();
int iNumberOfBytes;
int iResult;
//################################
//VCANReadSettings struct is read
//and changed as needed before
//Setting the new values
//################################
iNumberOfBytes = System.Runtime.InteropServices.Marshal.SizeOf(VCANReadSettings);
iResult = icsNeoDll.icsneoSetVCAN4Settings(m_hObject, ref VCANReadSettings , iNumberOfBytes, 1);
if(iResult == 0)
{
MessageBox.Show("Problem Sending VCAN configuration");
return;
}
Dim VCANReadSettings As SVCAN4Settings
Dim iNumberOfBytes As Integer
Dim iResult As Integer
'//################################
'//VCANReadSettings struct is read
'//and changed as needed before
'//Setting the new values
'//################################
iNumberOfBytes = System.Runtime.InteropServices.Marshal.SizeOf(VCANReadSettings)
iResult = icsneoSetVCAN4Settings(m_hObject, VCANReadSettings , iNumberOfBytes, 1)
If iResult = 0 Then
MsgBox("Problem Sending VCAN configuration")
Exit Sub
End If
SRADGalaxySettings RADGalaxyReadSettings = new RADGalaxyReadSettings();
int iNumberOfBytes;
int iResult;
iNumberOfBytes = System.Runtime.InteropServices.Marshal.SizeOf(RADGalaxyReadSettings);
iResult = icsNeoDll.icsneoSetRADGalaxySettings(m_hObject, ref RADGalaxyReadSettings , iNumberOfBytes, 1);
if(iResult == 0)
{
MessageBox.Show("Problem Sending configuration");
return;
}
Dim RADGalaxyReadSettings As SRADGalaxySettings
Dim iNumberOfBytes As Integer
Dim iResult As Integer
iNumberOfBytes = System.Runtime.InteropServices.Marshal.SizeOf(RADGalaxyReadSettings)
iResult = icsneoSetRADGalaxySettings(m_hObject, RADGalaxyReadSettings , iNumberOfBytes, 1)
If iResult = 0 Then
MsgBox("Problem Sending configuration")
Exit Sub
End If
void * hObject; // holds a handle to the neoVI object
int iRetVal;
int iCount;
NeoDevice ndNeoToOpen; //created previously
iRetVal = icsneoOpenDevice(&ndNeoToOpen, &hObject, NULL, 1, 0);
Dim m_hObject As IntPtr '//handle for device
Dim iResult As Integer '//Holds the results from function call
Dim ndNeoToOpen As NeoDevice '//Struct holding detected hardware information
Dim bNetwork(255) As Byte '//List of hardware IDs
Dim iCount As Integer '//counter
'//File NetworkID array
For iCount = 0 To 255
bNetwork(iCount) = CByte(iCount)
Next iCount
'//Open the first found device, ndNeoToOpen acquired from FindNeoDevices
iResult = icsneoOpenDevice(ndNeoToOpen(0), m_hObject, bNetwork(0), 1, 0)
If CBool(iResult) Then
MsgBox("Port Opened OK!")
Else
MsgBox("Problem Opening Port")
Exit Sub
End If
IntPtr m_hObject; //handle for device
int iResult; //Holds the results from function call
NeoDevice ndNeoToOpen = new NeoDevice(); //Struct holding detected hardware information
byte[] bNetwork = new byte[255]; //List of hardware IDs
int iCount; //counter
//File NetworkID array
for (iCount = 0; iCount < 255; iCount++)
{
bNetwork[iCount] = Convert.ToByte(iCount);
}
//Open the first found device, ndNeoToOpen acquired from FindNeoDevices
iResult = icsNeoDll.icsneoOpenDevice(ref ndNeoToOpen, ref m_hObject, ref bNetwork[0], 1, 0);
if (iResult == 1)
{
MessageBox.Show("Port Opened OK!");
}
else
{
MessageBox.Show("Problem Opening Port");
return;
}
Dim iResult As Integer
Dim bState As Boolean
'//Set the bit rate
iResult = icsneoEnableDOIPLine(m_hObject,bState)
If (iResult = 0) Then MsgBox("Problem setting DoIP Act")
char SetFireParms[100];
char Values[500];
int iRetVal;
int iErrorIndex;
unsigned short NetworkEnables = 0xFFFF;
sprintf(SetFireParms, "network_enables=%d,can1/Baudrate=9,can1/Mode=0", NetworkEnables);
iRetVal = icsneoSetDeviceParameters(hObject, SetFireParms, &iErrorIndex, 1);
Dim ReturnVal As Int32
Dim Errors As Int32
Dim sCommand As String
sCommand = "network_enables=0"
ReturnVal = icsneoSetDeviceParameters(m_hObject, sCommand, Errors, 0)
byte[]bConfigBytes=newbyte[1024];//Storage for Data Bytes from DeviceintiNumBytes=1204;//Storage for Number of BytesintlResult;//Storage for Result of Called FunctionintCounter;//Clear listboxlstConfigInformation.Items.Clear();//Call Get ConfigurationlResult=icsNeoDll.icsneoGetConfiguration(m_hObject,refbConfigBytes[0],refiNumBytes);//Fill ListBox with Data From function Callfor(Counter=0;Counter<1024;Counter++){lstConfigInformation.Items.Add("Byte Number-"+Counter+" Byte Data-"+}
ulIndex
[in] Specifies the Index to configure, 10 elements 0-9.
stCM_ISO157652_RxMessage
[in] This is the address of the stCM_ISO15765_RxMessage structure. The structure contains the properties for the multi frame message transaction.
Return Values
None.
Remarks
None.
Examples
int lResult;stCM_ISO157652_RxMessage flow_cntrl_msg;memset(
Public Declare Function icsneoISO15765_ReceiveMessage Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByVal ulNetworkID As Integer, ByRef pMsg As stCM_ISO157652_RxMessage) As Int32
[out] Specifies the number of errors in the neoVI DLL error queue. You can read out the errors by calling the GetErrorMessages method.
Return Values
If the port has been closed successfully the return value will be 1. Otherwise, it will return zero. It will also return zero if the port is already closed.
Remarks
Must be called once for each successful call to OpenNeoDevice or memory and resource leaks will occur.
Examples
int lNumberOfErrors;// used to get the number of errorsint iResult;
//Declared at form level and previously open with a call to OpenNeoDeviceIntPtrm_hObject;//handle for device,
Public Declare Function icsneoClosePort Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pNumberOfErrors As Int32) As Int32
[in] This value is always the size, in bytes, of the SFireSettings structure.
Return Values
Returns 1 if successful, 0 if an error occurred. GetLastAPIError must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
Remarks
After getting the current settings, you may change the parameters defined in the SFireSettings structure and write the settings back to the neoVI Fire using SetFireSettings.
//Declared at form level and previously open with a call to OpenNeoDeviceIntPtrm_hObject;//handle for device,
Public Declare Function icsneoGetFireSettings Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pSettings As SFireSettings , ByVal iNumBytes As Int32) As Int32
[in] This value is always the size, in bytes, of the SFIRE2Settings structure.
Return Values
Returns 1 if successful, 0 if an error occurred. GetLastAPIError must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
Remarks
After getting the current settings, you may change the parameters defined in the SFIRE2Settings structure and write the settings back to the neoVI FIRE 2 using SetFIRE2Settings.
//Declared at form level and previously open with a call to OpenNeoDeviceIntPtrm_hObject;//handle for device,
Public Declare Function icsneoGetFIRE2Settings Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pSettings As SFIRE2Settings , ByVal iNumBytes As Int32) As Int32
[in] This value is always the size, in bytes, of the SVCANRFSettings structure.
Return Values
Returns 1 if successful, 0 if an error occurred. GetLastAPIError must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
Remarks
After getting the current settings, you may change the parameters defined in the SVCANRFSettings structure and write the settings back to the ValueCAN RF using SetVCANRFSettings.
//Declared at form level and previously open with a call to OpenNeoDeviceIntPtrm_hObject;//handle for device,
Public Declare Function icsneoGetVCANRFSettings Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pSettings As SVCANRFSettings, ByVal iNumBytes As Int32) As Int32e
[in] This value is always the size, in bytes, of the SRADGalaxySettings structure.
Return Values
Returns 1 if successful, 0 if an error occurred. GetLastAPIError must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
Remarks
After getting the current settings, you may change the parameters defined in the SRADGalaxySettings structure and write the settings back to the RAD Galaxy using SetRADGalaxySettings.
Examples
SRADGalaxySettings RadGalaxyReadSettings;
int iNumberOfBytes;
int iResult;
//Get the settings
iNumberOfBytes=sizeof(RadGalaxyReadSettings );
iResult = icsneoGetRADGalaxySettings(m_hObject, &RadGalaxyReadSettings , iNumberOfBytes);
if(iResult == 0)
{
MessageBox::Show("Problem reading configuration");
return;
}
//Declared at form level and previously open with a call to OpenNeoDeviceIntPtrm_hObject;//handle for device,
Public Declare Function icsneoGetRADGalaxySettings Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pSettings As SRADGalaxySettings, ByVal iNumBytes As Int32) As Int32
1 if the hObject is valid. 0 if the object is invalid.
Remarks
A driver object will be invalid if it was never initialized by OpenNeoDevice. Calling ClosePort will not invalidate a driver object; only FreeObject will do so.
1 if the function succeeded. 0 if it failed for any reason. GetLastAPIError must be called to obtain the specific error. Failure could include the device not supporting gPTP, or
the device supports gPTP but not support icsneoGetGPTPStatus API.
Remarks
Rad Galaxy, Rad SuperMoon, Rad Star2, and Rad GigaStar supports icsneoGetGPTPStatus API
nEAT, Rad Pluto, Rad Jupiter support gPTP but, does not support this API
Examples
GPTPStatus gptp_status ={};int iResult;iResult =
GPTPStatusgptp_status=newGPTPStatus();int
Dim gptp_status As New GPTPStatus
Dim iResult As Int32
iResult = icsneoGetGPTPStatus(m_hObject, gptp_status)
Public Declare Function icsneoGetGPTPStatus Lib "icsneo40.dll" (ByVal hObject As IntPtr, ByRef StatusGPTP As GPTPStatus) As Int32
int _stdcall icsneoGetGPTPStatus(void* hObject, GPTPStatus * StatusGPTP);
1 if the function succeeded. 0 if it failed for any reason. GetLastAPIError must be called to obtain the specific error.
Remarks
If a script is executing on the neoVI calling this method will stop it. The script will still be present on the device and can be started again by ScriptStart The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
NEOVI_ERROR_DLL_SCRIPT_NO_SCRIPT_RUNNING = 226
Examples
int iRetVal;unsignedlong lLastErrNum;
Int32iResult;//Stop CoreMiniiResult
Public Declare Function icsneoScriptStop Lib “icsneo40.dll” (ByVal hObject As IntPtr) As Int32
Structure that contains information about neoVI device firmware versions
WaitForRxMessagesWithTimeOut Method - neoVI API
This method is used to wait a specified amount of time for received messages from the neoVI hardware.
int _stdcall icsneoWaitForRxMessagesWithTimeOut(void* hObject,unsignedint
Public Declare Function icsneoWaitForRxMessagesWithTimeOut Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByVal iTimeOut As UInt32) As Int32
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice.
iTimeOut
[in] Specifies the amount of time in milliseconds that the function will wait for a received message before returning.
Return Values
0 if no message was received during the wait period. 1 if a message was received. -1 will be returned if there is an error condition. must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
Remarks
This function allows an application to avoid ‘polling’ for received messages. It will return as soon as a message is received or when the timeout specified has been reached.
Examples
SetFire2Settings Method - neoVI API
int _stdcall icsneoSetFire2Settings(void* hObject, SFIRE2Settings *pSettings,
Public Declare Function icsneoSetFire2SettingsLib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pSettings As SFIRE2Settings, ByVal iNumBytes As Int32, ByVal bSaveToEEPROM As Int32) As Int32
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice.
pSettings
[in] The address of an allocated structure.
iNumBytes
[in] This value is always the size, in bytes, of the structure.
bSaveToEEPROM
[in] If set to 0, the settings changes will revert to the values stored in EEPROM when the neoVI FIRE 2 is power-cycled. If set to 1, the values will overwrite the EEPROM settings and become persistent across power-cycles of the neoVI FIRE 2.
Return Values
Returns 1 if successful, 0 if an error occurred. must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
Remarks
Before using this function, the structure must be initialized with the current neoVI settings using .
Examples
GetVCAN3Settings Method - neoVI API
This method reads the configuration settings from a ValueCAN3 device.
int _stdcall icsneoGetVCAN3Settings(void* hObject, SVCAN3Settings *pSettings,
Public Declare Function icsneoGetVCAN3Settings Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pSettings As SVCAN3Settings, ByVal iNumBytes As Int32) As Int32
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice.
pSettings
[out] Pointer to a structure.
iNumBytes
[in] This value is always the size, in bytes, of the structure.
Return Values
Returns 1 if successful, 0 if an error occurred. must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
Remarks
After getting the current settings, you may change the parameters defined in the structure and write the settings back to the ValueCAN3 using .
Examples
SetVCAN3Settings Method - neoVI API
This method reads the configuration settings from a ValueCAN3 device.
int _stdcall icsneoSetVCAN3Settings(void* hObject, SVCAN3Settings *pSettings,
Public Declare Function icsneoSetVCAN3Settings Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pSettings As SVCAN3Settings, ByVal iNumBytes As Int32, ByVal bSaveToEEPROM As Int32) As Int32
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice.
pSettings
[in] The address of an allocated structure.
iNumBytes
[in] This value is always the size, in bytes, of the structure.
bSaveToEEPROM
[in] If set to 0, the settings changes will revert to the values stored in EEPROM when the ValueCAN3 is power-cycled. If set to 1, the values will overwrite the EEPROM settings and become persistent across power-cycles of the ValueCAN3.
Return Values
Returns 1 if successful, 0 if an error occurred. must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
Remarks
Before using this function, the structure must be initialized with the current neoVI settings using .
Examples
SetVCANRFSettings Method - neoVI API
int _stdcall icsneoSetVCANRFSettings(void* hObject, SVCANRFSettings *pSettings,
Public Declare Function icsneoSetVCANRFSettings Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pSettings As SVCANRFSettings, ByVal iNumBytes As Int32, ByVal bSaveToEEPROM As Int32) As Int32
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice.
pSettings
[in] The address of an allocated structure.
iNumBytes
[in] This value is always the size, in bytes, of the structure.
bSaveToEEPROM
[in] If set to 0, the settings changes will revert to the values stored in EEPROM when the ValueCAN RF is power-cycled. If set to 1, the values will overwrite the EEPROM settings and become persistent across power-cycles of the ValueCAN RF.
Return Values
Returns 1 if successful, 0 if an error occurred. must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
Remarks
Before using this function, the structure must be initialized with the current neoVI settings using .
Examples
SetDeviceSettings Method - neoVI API
This method writes configuration settings to various devices.
int _stdcall icsneoSetDeviceSettings(void* hObject, SDeviceSettings *pSettings,
Public Declare Function icsneoSetDeviceSettings”icsneo40.dll” (ByVal hObject As IntPtr, ByRef pSettings As SDeviceSettings , ByVal iNumBytes As Int32, ByVal bSaveToEEPROM As Int32, ByVal VnetChan As Int32) As Int32
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice.
pSettings
[in] The address of an allocated structure.
iNumBytes
[in] This value is always the size, in bytes, of the structure.
bSaveToEEPROM
[in] If set to 0, the settings changes will revert to the values stored in EEPROM when the neoVI FIRE 2 is power-cycled. If set to 1, the values will overwrite the EEPROM settings and become persistent across power-cycles of the neoVI FIRE 2.
VnetChan
[in] This value is indicates which Vnet to set the settings to. This parameter is intended for neoVI ION and neoVI Plasma which have more than one Vnet Slot. For all other devices set this to 0.
Return Values
Returns 1 if successful, 0 if an error occurred. must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
Remarks
Before using this function, the structure must be initialized with the current neoVI settings using .
Examples
ReadWritePhySettings Method - neoVI API
This method allows reading and writing the PHY settings from/to the hardware.
int _stdcall icsneoReadWritePHYSettings(void* hObject, PhyRegPkt_T *PHYSettings,
Public Declare Function icsneoReadWritePHYSettings Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef PHYSettings As PhyRegPkt_T, ByVal iSize As IntPtr, ByVal NumEntries As IntPtr) As Int32
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice.
PHYSettings
[out] This is the address of the first element of an array of structures. This array will be loaded by the application software with entries to be read or written from/to the hardware.
iSize
[in] Specifies the size of the structure used by the application. This is to make sure the structure used in the application and the DLL is same to avoid any buffer overrun.
iNumEntries
[in] Specifies the number of PHY Entries to be read or written.
Return Values
Returns 1 if successful, 0 if an error occurred. must be called to obtain the specific error.
Remarks
This function call sends the PHY Entries to be read or written from/to the hardware.
Examples
ScriptStart Method - neoVI API
This method starts the execution of a script that has been downloaded to a neoVI device.
int _stdcall icsneoScriptStart(void* hObject,int iLocation);
Public Declare Function icsneoScriptStart Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByVal iLocation As Int32) As Int32
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice.
iLocation
[in] Specifies the physical location of the script to be executed on the neoVI device. Valid values are:
SCRIPT_LOCATION_FLASH_MEM = 0 (Valid only on a neoVI Fire or neoVI Red)SCRIPT_LOCATION_SDCARD = 1 (Valid only on a neoVI Fire or neoVI Red)SCRIPT_LOCATION_VCAN3_MEM = 2 (Valid only on a ValueCAN 3 device)
These values are defined in the icsnVC40.h file
Return Values
1 if the function succeeded. 0 if it failed for any reason. must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
NEOVI_ERROR_DLL_INVALID_SCRIPT_LOCATION = 213
NEOVI_ERROR_DLL_SDCARD_NOT_INSERTED = 214
NEOVI_ERROR_DLL_SCRIPT_START_ERROR = 218
Remarks
The script must have been successfully downloaded to the neoVI using . Use to suspend execution of the script. If the connected device is a ValueCAN 3 and a location other than SCRIPT_LOCATION_VCAN3_MEM will generate an error.
Examples
GetDeviceSettings Method - neoVI API
This method reads the configuration settings from various devices.
int _stdcall icsneoGetDeviceSettings(void* hObject, SDeviceSettings *pSettings,
Public Declare Function icsneoGetDeviceSettingsLib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pSettings As SDeviceSettings , ByVal iNumBytes As Int32, ByVal VnetChan As Int32) As Int32
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice.
pSettings
[out] Pointer to a structure.
iNumBytes
[in] This value is always the size, in bytes, of the structure.
VnetChan
[in] This value is indicates which Vnet to set the settings to. This parameter is intended for neoVI ION and neoVI Plasma which have more than one Vnet Slot. For all other devices set this to 0.
Return Values
Returns 1 if successful, 0 if an error occurred. must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
Remarks
After getting the current settings, you may change the parameters defined in the structure and write the settings back to the neoVI FIRE 2 using .
Examples
GetVCAN412Settings Method - neoVI API
This method reads the configuration settings from a ValueCAN4-1 and ValueCAN4-2 device.
int _stdcall icsneoGetVCAN412Settings(void* hObject, SVCAN412Settings *pSettings,
Public Declare Function icsneoGetVCAN412Settings Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pSettings As SVCAN412Settings, ByVal iNumBytes As Int32) As Int32
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice.
pSettings
[out] Pointer to a structure.
iNumBytes
[in] This value is always the size, in bytes, of the structure.
Return Values
Returns 1 if successful, 0 if an error occurred. must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
Remarks
After getting the current settings, you may change the parameters defined in the structure and write the settings back to the ValueCAN 4-1 and ValueCAN 4-2 using .
Examples
CoreMini Script interface Overview - neoVI API
The CoreMini Script Interface is a way to use functionality from Vehicle Spy in your own application. When a CoreMini file is created in Vehicle Spy 3 it creates header files for the functions in the file and giving access to basic parameters in the script.
This section includes commands to load and interact with CoreMini scripts for Intrepid Control Systems 3G hardware. CoreMini scripts are created using Vehicle Spy 3. For information on creating CoreMini scripts see the help documents for Vehicle Spy 3. The table below lists the different script interface commands and gives a short description of the command.
Function
Description
Starts execution of a script that has been downloaded to a neoVI device
SetFDBitRate Method - neoVI API
This method sets bit rates for networks on neoVI devices
int _stdcall icsneoSetFDBitRate(void* hObject,int iBitRate,
Public Declare Function icsneoSetFDBitRate Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByVal BitRate As Int32, ByVal NetworkID As Int32) As Int32
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice.
iBitRate
[in] Specifies bit rate setting. Valid values depend on the network specified.
For the networks HSCAN, MSCAN, HSCAN2, HSCAN3, HSCAN4, HSCAN5, HSCAN6, and HSCAN7 valid bit rates are 1000000, 2000000, 4000000, 5000000, 8000000,and 10000000
iNetworkID
[in] Specifies the network. The valid values are:
NETID_HSCAN, NETID_MSCAN, NETID_HSCAN2, NETID_HSCAN3, NETID_HSCAN4, NETID_HSCAN5, NETID_HSCAN6, and NETID_HSCAN7
These values are defined in the icsnVC40.h file
Return Values
1 if the function succeeded. 0 if it failed for any reason. must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_INVALID_NETID = 8
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
NEOVI_ERROR_DLL_RED_INVALID_BAUD_SPECIFIED = 122
NEOVI_ERROR_DLL_SEND_DEVICE_CONFIG_ERROR = 229
NEOVI_ERROR_DLL_GET_DEVICE_CONFIG_ERROR = 230
NEOVI_ERROR_DLL_UNKNOWN_NEOVI_TYPE = 231
Remarks
The specified network must exist on the connected neoVI device.
Examples
GetVCAN4Settings Method - neoVI API
This method reads the configuration settings from a ValueCAN4-4 device.
Parameters
hObject
__ [in] Specifies the driver object created by .
pSettings
[out] Pointer to a structure.
ScriptGetFBlockStatus Method - neoVI API
This method returns the run status of a specified function block within a script on a neoVI device.
Parameters
hObject
[in] Specifies the driver object created by .
SetBitRate Method - neoVI API
This method sets bit rates for networks on neoVI devices
Parameters
hObject
[in] Specifies the driver object created by .
GetErrorMessages Method - neoVI API
This method reads the neoVI DLL error message queue.
Parameters
hObject
[in] Specifies the driver object created with .
ScriptWriteAppSignal Method - neoVI API
This method is used to set the value of an application signal in a script running on a neoVI device.
Parameters
hObject
[in] Specifies the driver object created by .
ScriptStartFBlock Method - neoVI API
This method starts the specified function block within a script on a neoVI device.
Parameters
hObject
[in] Specifies the driver object created by .
ScriptClear Method - neoVI API
This method clears a script from a specific location on a neoVI device.
Parameters
hObject
[in] Specifies the driver object created by .
ScriptReadAppSignal Method - neoVI API
This method is used to read an application signal from a script running on a neoVI device.
Parameters
hObject
[in] Specifies the driver object created by .
ScriptStopFBlock Method - neoVI API
This method stops the execution of a specified function block within a script on a neoVI device.
Parameters
hObject
[in] Specifies the driver object created by .
byte[] bConfigBytes = new byte[1024]; //Storage for Data Bytes from Device
int iNumBytes = 1204; //Storage for Number of Bytes
int lResult; //Storage for Result of Called Function
int Counter;
//Clear listbox
lstConfigInformation.Items.Clear();
//Call Get Configuration
lResult = icsNeoDll.icsneoGetConfiguration(m_hObject, ref bConfigBytes[0],ref iNumBytes);
//Fill ListBox with Data From function Call
for(Counter=0;Counter<1024;Counter++)
{
lstConfigInformation.Items.Add("Byte Number-" + Counter + " Byte Data-" + bConfigBytes[Counter]);
}
int lResult;
String sTempNetwork;
stCM_ISO157652_RxMessage flow_cntrl_msg = new stCM_ISO157652_RxMessage();
lResult = icsNeoDll.icsneoISO15765_EnableNetworks(m_hObject, Convert.ToInt32(eNETWORK_ID.NETID_HSCAN));
//Build structure for message
flow_cntrl_msg.vs_netid = Convert.ToInt16(eNETWORK_ID.NETID_HSCAN);
flow_cntrl_msg.padding = 0xAA; //Set Padding Byte
flow_cntrl_msg.id = 0x7E0 //ArbID of the message
flow_cntrl_msg.id_mask = 0xFFF; //The flow control arb filter mask (response id from receiver)
flow_cntrl_msg.fc_id = 0x7E8; //ArbID for the flow control Frame
flow_cntrl_msg.blockSize = 100;
flow_cntrl_msg.stMin = 100;
flow_cntrl_msg.cf_timeout = 1000;
//Set flags for Padding and ID information.
flow_cntrl_msg.flags = 0;
int iFlags = Convert.ToInt32(stCM_ISO157652_RxMessage_Flags.enableFlowControlTransmission);
iFlags = (iFlags | Convert.ToInt32(CSnet.stCM_ISO157652_TxMessage_Flags.paddingEnable));
flow_cntrl_msg.flags = Convert.ToUInt16(iFlags);
lResult = icsNeoDll.icsneoISO15765_ReceiveMessage(m_hObject, 0, ref flow_cntrl_msg);
Dim lResult As Integer
Dim flow_cntrl_msg As stCM_ISO157652_RxMessage
lResult = icsneoISO15765_EnableNetworks(m_hObject, NETID_HSCAN)
'//Build structure for message
flow_cntrl_msg.vs_netid = NETID_HSCAN
flow_cntrl_msg.padding = &HAA '//Set Padding Byte
flow_cntrl_msg.id = &H7E0 '//ArbID of the message
flow_cntrl_msg.id_mask = &HFFF '//The flow control arb filter mask (response id from receiver)
flow_cntrl_msg.fc_id = &H7E8 '//ArbID for the flow control Frame
flow_cntrl_msg.blockSize = 100
flow_cntrl_msg.stMin = 100
flow_cntrl_msg.cf_timeout = 1000
'//Set flags for Padding and ID information.
flow_cntrl_msg.flags = Convert.ToUInt32(stCM_ISO157652_RxMessage_Flags.enableFlowControlTransmission)
flow_cntrl_msg.flags = CUShort(flow_cntrl_msg.flags Or stCM_ISO157652_TxMessage_Flags.paddingEnable)
lResult = icsneoISO15765_ReceiveMessage(m_hObject, 0, flow_cntrl_msg)
Private m_hObject As IntPtr '// Declared at form level and previously open with a call to OpenNeoDevice
Dim iResult As Integer
Dim iNumberOfErrors As Integer
'//close the port
iResult = icsneoClosePort(m_hObject, iNumberOfErrors)
If CBool(iResult) Then
MsgBox("Port Closed OK!")
Else
MsgBox("Problem Closing Port")
End If
Private m_hObject As IntPtr '// Declared at form level and previously open with a call to OpenNeoDevice
Dim FireReadSettings As SFireSettings
Dim iNumberOfBytes As Integer
Dim iResult As Integer
'//Get the settings
iNumberOfBytes = System.Runtime.InteropServices.Marshal.SizeOf(FireReadSettings)
iResult = icsneoGetFireSettings(m_hObject, FireReadSettings, iNumberOfBytes)
If iResult = 0 Then
MsgBox("Problem reading FIRE configuration")
Exit Sub
End If
Private m_hObject As IntPtr '// Declared at form level and previously open with a call to OpenNeoDevice
Dim Fire2ReadSettings As SFIRE2Settings
Dim iNumberOfBytes As Integer
Dim iResult As Integer
'//Get the settings
iNumberOfBytes = System.Runtime.InteropServices.Marshal.SizeOf(Fire2ReadSettings)
iResult = icsneoGetFIRE2Settings(m_hObject, Fire2ReadSettings , iNumberOfBytes)
If iResult = 0 Then
MsgBox("Problem reading configuration")
Exit Sub
End If
Private m_hObject As IntPtr '// Declared at form level and previously open with a call to OpenNeoDevice
Dim VcanReadSettings As SVCANRFSettings
Dim iNumberOfBytes As Integer
Dim iResult As Integer
'//Get the settings
iNumberOfBytes = System.Runtime.InteropServices.Marshal.SizeOf(VcanReadSettings)
iResult = icsneoGetVCANRFSettings(m_hObject, VcanReadSettings , iNumberOfBytes)
If iResult = 0 Then
MsgBox("Problem reading VCAN configuration")
Exit Sub
End If
Private m_hObject As IntPtr '// Declared at form level and previously open with a call to OpenNeoDevice
Dim RadGalaxyReadSettings As SRADGalaxySettings
Dim iNumberOfBytes As Integer
Dim iResult As Integer
'//Get the settings
iNumberOfBytes = System.Runtime.InteropServices.Marshal.SizeOf(RadGalaxyReadSettings)
iResult = icsneoGetRADGalaxySettings(m_hObject, RadGalaxyReadSettings , iNumberOfBytes)
If iResult = 0 Then
MsgBox("Problem reading configuration")
Exit Sub
End If
Dim iResult As Int32
'//Stop CoreMini
iResult = icsneoScriptStop(m_hObject)
If iResult = 0 Then
lblCMStatus.Text = "CoreMini Failed to Stop"
Else
lblCMStatus.Text = "CoreMini Stopped"
End If
[in] The index value of the function block to start
piStatus
[out] 0 = stopped 1 = running
Return Values
1 if the function succeeded. 0 if it failed for any reason. GetLastAPIError must be called to obtain the specific error. The errors that can be generated by this function are:
The script containing the specified function block must have been successfully downloaded to the neoVI using ScriptLoadScript. Execution of the script must have been started by using ScriptStartScript. The valid index values for function blocks within a script can be found in the cmvspy.vs3cmb.h file (Produced by Vehicle Spy. Please see Vehicle Spy documentation).
Examples
Public Declare Function icsneoScriptGetFBlockStatus Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByVal fb_index As UInt32, ByRef piRunStatus As Int32) As Int32
1 if the function succeeded. 0 if it failed for any reason. GetLastAPIError must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_INVALID_NETID = 8
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
NEOVI_ERROR_DLL_RED_INVALID_BAUD_SPECIFIED = 122
NEOVI_ERROR_DLL_SEND_DEVICE_CONFIG_ERROR = 229
NEOVI_ERROR_DLL_GET_DEVICE_CONFIG_ERROR = 230
NEOVI_ERROR_DLL_UNKNOWN_NEOVI_TYPE = 231
Remarks
The specified network must exist on the connected neoVI device.
Examples
Public Declare Function icsneoSetBitRate Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByVal BitRate As Int32, ByVal NetworkID As Int32) As Int32
[in] Specifies the physical location of the script to be cleared on the neoVI device. Valid values are:
SCRIPT_LOCATION_FLASH_MEM = 0 (Valid only on a neoVI Fire or neoVI Red)SCRIPT_LOCATION_SDCARD = 1 (Valid only on a neoVI Fire or neoVI Red)SCRIPT_LOCATION_VCAN3_MEM = 4 (Valid only on a ValueCAN 3 device)
These values are defined in the icsnVC40.h file
Return Values
1 if the function succeeded. 0 if it failed for any reason. GetLastAPIError must be called to obtain the specific error. The errors that can be generated by this function are:
If a script exists in the specified location it will be erased from that location. If the script is running it will be stopped. Any function blocks that are running will be stopped.
Examples
Public Declare Function icsneoScriptClear Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByVal iLocation As Int32) As Int32
[in] The index value of the transmit message to read
double *dValue
[in] Contains the current value of the application signal.
Return Values
1 if the function succeeded. 0 if it failed for any reason. GetLastAPIError must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
NEOVI_ERROR_DLL_SCRIPT_INVALID_APPSIG_INDEX = 225
NEOVI_ERROR_DLL_SCRIPT_NO_SCRIPT_RUNNING = 226
Remarks
The script containing the specified application signal must have been successfully downloaded to the neoVI using ScriptLoadScript. The script must also have been started using ScriptStart. This function will fail if ScriptStop has been called. The valid index values for application signals within a script can be found in the cmvspy.vs3cmb.h file that is produced by Vehicle Spy. Please see Vehicle Spy documentation.
Examples
Public Declare Function icsneoScriptReadAppSignal Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByVal iIndex As UInt32, ByRef dValue As Double) As Int32
SFIRE2Settings Fire2ReadSettings;int iNumberOfBytes;int iResult;//################################//Fire2ReadSettings struct is read//and changed as needed before//Setting the new values//################################iNumberOfBytes=sizeof(Fire2ReadSettings);iResult =icsneoSetFIRE2Settings(m_hObject,&Fire2ReadSettings , iNumberOfBytes,1);if(iResult ==0){MessageBox::Show("Problem Sending FIRE2 configuration");return;}
SFIRE2Settings=newFire2ReadSettings();intiNumberOfBytes;intiResult;//################################//Fire2ReadSettings struct is read//and changed as needed before//Setting the new values//################################iNumberOfBytes=System.Runtime.InteropServices.Marshal.SizeOf(Fire2ReadSettings);iResult=icsNeoDll.icsneoSetFIRE2Settings(m_hObject,refFire2ReadSettings,iNumberOfBytes,1);if(iResult==0){MessageBox.Show("Problem Sending FIRE2 configuration");return;}
//Declared at form level and previously open with a call to OpenNeoDeviceIntPtrm_hObject;//handle for device,SVCAN3SettingsVcanReadSettings=newSVCAN3Settings();intiNumberOfBytes;intiResult;//Get the settingsiNumberOfBytes=System.Runtime.InteropServices.Marshal.SizeOf(VcanReadSettings);iResult=icsNeoDll.icsneoGetVCAN3Settings(m_hObject,refVcanReadSettings,iNumberOfBytes);if(iResult==0){MessageBox.Show("Problem reading VCAN configuration");return;}
SVCANRFSettings VCANReadSettings;int iNumberOfBytes;int iResult;//################################//VCANReadSettings struct is read//and changed as needed before//Setting the new values//################################iNumberOfBytes=sizeof(VCANReadSettings );iResult =icsneoSetVCANRFSettings(m_hObject,&VCANReadSettings , iNumberOfBytes,1);if(iResult ==0){MessageBox::Show("Problem Sending VCAN configuration");return;}
SVCANRFSettingsVCANReadSettings=newVCANReadSettings();intiNumberOfBytes;intiResult;//################################//VCANReadSettings struct is read//and changed as needed before//Setting the new values//################################iNumberOfBytes=System.Runtime.InteropServices.Marshal.SizeOf(VCANReadSettings);iResult=icsNeoDll.icsneoSetVCANRFSettings(m_hObject,refVCANReadSettings,iNumberOfBytes,1);if(iResult==0){MessageBox.Show("Problem Sending VCAN configuration");return;}
//Declared at form level and previously open with a call to OpenNeoDeviceIntPtrm_hObject;//handle for device,SVCAN412SettingsVcanReadSettings=newSVCAN412Settings();intiNumberOfBytes;intiResult;//Get the settingsiNumberOfBytes=System.Runtime.InteropServices.Marshal.SizeOf(VcanReadSettings);iResult=icsNeoDll.icsneoGetVCAN412Settings(m_hObject,refVcanReadSettings,iNumberOfBytes);if(iResult==0){MessageBox.Show("Problem reading configuration");return;}
int iRetVal;
int iRunStatus;
unsigned long lLastErrNum;
iRetVal = icsneoScriptGetFBlockStatus(hObject, Function_Block_1, &iRunStatus);
if(iRetVal == 0)
{
printf("\nFailed to check function block status);
}
else
{
printf("\nFunction block status = %s\r\n", iRunStatus == 0 ? "Stopped" : "Running");
}
Int32 iResult;
Int32 iStatus=0;
//Get Status of Function Block in CoreMini
iResult = icsNeoDll.icsneoScriptGetFBlockStatus(m_hObject, Convert.ToUInt32(cboFBToChange.SelectedIndex), ref iStatus);
if(iResult == 0)
{
lblFBStatus.Text = "Failed to get CoreMini Status";
}
else
{
switch(iStatus)
{
case (int)ScriptStates.SCRIPT_STATUS_RUNNING:
lblFBStatus.Text = "CoreMini Function Block Running";
break;
case (int)ScriptStates.SCRIPT_STATUS_STOPPED:
lblFBStatus.Text = "CoreMini Function Block Stopped";
break;
default:
lblFBStatus.Text = "Unhandled State";
break;
}
}
Dim iResult As Int32
Dim iStatus As Int32
'//Get Status of Function Block in CoreMini
iResult = icsneoScriptGetFBlockStatus(m_hObject, Convert.ToUInt32(cboFBToChange.SelectedIndex), iStatus)
If iResult = 0 Then
lblFBStatus.Text = "Failed to get CoreMini Status"
Else
Select Case iStatus
Case SCRIPT_STATUS_RUNNING
lblFBStatus.Text = "CoreMini Function Block Running"
Case SCRIPT_STATUS_STOPPED
lblFBStatus.Text = "CoreMini Function Block Stopped"
Case Else
lblFBStatus.Text = "Unhandled State"
End Select
End If
int iRetVal;
iRetVal = icsneoSetBitrate(hObject, 500000, NETID_HSCAN);
if(iRetVal == 0)
{
printf("\nFailed to set the bit rate");
}
else
{
printf("\nSuccessfully set the bit rate");
}
int iResult;
//Set the bit rate
iResult = icsNeoDll.icsneoSetBitRate(m_hObject, 500000, NETID_HSCAN);
if (iResult == 0)
{
MessageBox.Show("Problem setting bit rate");
}
Dim iResult As Integer
'//Set the bit rate
iResult = icsneoSetBitRate(m_hObject, 500000, NETID_HSCAN)
If (iResult = 0) Then MsgBox("Problem setting bit rate")
int iRetVal;
unsigned long lLastErrNum;
//Clear the script from it's storage location.
//Both SCRIPT_LOCATION_FLASH_MEM and SCRIPT_LOCATION_SDCARD are persistent.
//On a ValueCAN 3, SCRIPT_LOCATION_VCAN3_MEM will clear when the device
//loses power or resets.
iRetVal = icsneoScriptClear(hObject, DefaultScriptLocation);
if(iRetVal == 0)
{
printf("\nFailed to clear the script);
}
else
{
printf("\nSuccessfully cleared the script");
}
Dim iResult As Int32
'//clear CoreMini
iResult = icsneoScriptClear(m_hObject, SCRIPT_LOCATION_FLASH_MEM)
If iResult = 0 Then
lblCMStatus.Text = "CoreMini Failed to Clear"
Else
lblCMStatus.Text = "CoreMini Cleared"
End If
int iRetVal;
unsigned long lLastErrNum;
double dValue = 0;
iRetVal = icsneoScriptReadAppSignal(hObject, App_Signal_1, &dValue);
if(iRetVal == 0)
{
printf("\nFailed to read the application signal.);
}
else
{
printf("\nApplication signal = %f\r\n", dValue);
}
Dim iResult As Int32
Dim ValueToSet As Double
'//Read App signal
iResult = icsneoScriptReadAppSignal(m_hObject, Convert.ToUInt32(cboAppSig.SelectedIndex), ValueToSet)
If iResult = 0 Then
txtAppSigVal.Text = "Problem!"
Else
txtAppSigVal.Text = Convert.ToString(ValueToSet)
End If
Private m_hObject As IntPtr '// Declared at form level and previously open with a call to OpenNeoDevice
Dim iResult As Integer
Dim iTimeOut As UInt32
iTimeOut = Convert.ToUInt32(5000)
lblWaitForRxMessageWithTimeOutResult.Text = "Status"
Application.DoEvents()
'//This function will block until, A: A Message is received by the hardware, or B: the timeout is reached
iResult = icsneoWaitForRxMessagesWithTimeOut(m_hObject, iTimeOut)
If iResult = 1 Then
'Message received before timeout
lblWaitForRxMessageWithTimeOutResult.Text = "Message received"
Call cmdReceive_Click(sender, e)
'//Do something with the messages received
Else
'Timeout reached and no messages received
lblWaitForRxMessageWithTimeOutResult.Text = "Message Not received"
'//Take action if no messages were received
End If
//Declared at form level and previously open with a call to OpenNeoDevice
IntPtr m_hObject; //handle for device
int iResult;
UInt32 iTimeOut = 5000; //Set timeout to 5 seconds
lblWaitForRxMessageWithTimeOutResult.Text = "Status";
Application.DoEvents();
//This function will block until, A: A Message is received by the hardware, or B: the timeout is reached
iResult = icsNeoDll.icsneoWaitForRxMessagesWithTimeOut(m_hObject, iTimeOut);
if (iResult == 1)
{
//Message received before timeout
lblWaitForRxMessageWithTimeOutResult.Text = "Message received";
//Do something with the messages received
cmdReceive_Click(sender, e);
}
else
{
//Timeout reached and no messages received
lblWaitForRxMessageWithTimeOutResult.Text = "Message Not received";
//Take action if no messages were received
}
Dim Fire2ReadSettings As SFIRE2Settings
Dim iNumberOfBytes As Integer
Dim iResult As Integer
'//################################
'//Fire2ReadSettings struct is read
'//and changed as needed before
'//Setting the new values
'//################################
iNumberOfBytes = System.Runtime.InteropServices.Marshal.SizeOf(Fire2ReadSettings)
iResult = icsneoSetFIRE2Settings(m_hObject, Fire2ReadSettings , iNumberOfBytes, 1)
If iResult = 0 Then
MsgBox("Problem Sending FIRE2 configuration")
Exit Sub
End If
Private m_hObject As IntPtr '// Declared at form level and previously open with a call to OpenNeoDevice
Dim VcanReadSettings As SVCAN3Settings
Dim iNumberOfBytes As Integer
Dim iResult As Integer
'//Get the settings
iNumberOfBytes = System.Runtime.InteropServices.Marshal.SizeOf(VcanReadSettings)
iResult = icsneoGetVCAN3Settings(m_hObject, VcanReadSettings , iNumberOfBytes)
If iResult = 0 Then
MsgBox("Problem reading VCAN configuration")
Exit Sub
End If
SVCAN3Settings VCANReadSettings;
int iNumberOfBytes;
int iResult;
//################################
//VCANReadSettings struct is read
//and changed as needed before
//Setting the new values
//################################
iNumberOfBytes=sizeof(VCANReadSettings );
iResult = icsneoSetVCAN3Settings(m_hObject, &VCANReadSettings , iNumberOfBytes, 1);
if(iResult == 0)
{
MessageBox::Show("Problem Sending VCAN configuration");
return;
}
SVCAN3Settings VCANReadSettings = new VCANReadSettings();
int iNumberOfBytes;
int iResult;
//################################
//VCANReadSettings struct is read
//and changed as needed before
//Setting the new values
//################################
iNumberOfBytes = System.Runtime.InteropServices.Marshal.SizeOf(VCANReadSettings);
iResult = icsNeoDll.icsneoSetVCAN3Settings(m_hObject, ref VCANReadSettings , iNumberOfBytes, 1);
if(iResult == 0)
{
MessageBox.Show("Problem Sending VCAN configuration");
return;
}
Dim VCANReadSettings As SVCAN3Settings
Dim iNumberOfBytes As Integer
Dim iResult As Integer
'//################################
'//VCANReadSettings struct is read
'//and changed as needed before
'//Setting the new values
'//################################
iNumberOfBytes = System.Runtime.InteropServices.Marshal.SizeOf(VCANReadSettings)
iResult = icsneoSetVCAN3Settings(m_hObject, VCANReadSettings , iNumberOfBytes, 1)
If iResult = 0 Then
MsgBox("Problem Sending VCAN configuration")
Exit Sub
End If
Dim VCANReadSettings As SVCANRFSettings
Dim iNumberOfBytes As Integer
Dim iResult As Integer
'//################################
'//VCANReadSettings struct is read
'//and changed as needed before
'//Setting the new values
'//################################
iNumberOfBytes = System.Runtime.InteropServices.Marshal.SizeOf(VCANReadSettings)
iResult = icsneoSetVCANRFSettings(m_hObject, VCANReadSettings , iNumberOfBytes, 1)
If iResult = 0 Then
MsgBox("Problem Sending VCAN configuration")
Exit Sub
End If
SDeviceSettings DeviceReadSettings;
int iNumberOfBytes;
int iResult;
//################################
//Read Settings struct first
//and changed as needed before
//Setting the new values
//################################
iNumberOfBytes=sizeof(DeviceReadSettings);
iResult = icsneoSetDeviceSettings(m_hObject, &DeviceReadSettings, iNumberOfBytes, 1, 0);
if(iResult == 0)
{
MessageBox::Show("Problem Sending Device configuration");
return;
}
SDeviceSettings DeviceReadSettings = new SDeviceSettings
int iNumberOfBytes;
int iResult;
//################################
//Read Settings struct first
//and changed as needed before
//Setting the new values
//################################
iNumberOfBytes = System.Runtime.InteropServices.Marshal.SizeOf(DeviceReadSettings);
DeviceReadSettings.uiDevice = EDeviceSettingsType.DeviceFireSettingsType;
iResult = icsNeoDll.icsneoSetDeviceSettings(m_hObject, ref DevoceReadSettings, iNumberOfBytes, 1, 0);
if(iResult == 0)
{
MessageBox.Show("Problem Sending Device configuration");
return;
}
Dim DeviceReadSettings As SDeviceSettings
Dim iNumberOfBytes As Integer
Dim iResult As Integer
'//################################
'//Read Settings struct first
'//and changed as needed before
'//Setting the new values
'//################################
iNumberOfBytes = System.Runtime.InteropServices.Marshal.SizeOf(DeviceReadSettings)
DeviceReadSettings.uiDevice = EDeviceSettingsType.DeviceFireSettingsType
iResult = icsneoSetDeviceSettings(m_hObject, DeviceReadSettings , iNumberOfBytes, 1, 0)
If iResult = 0 Then
MsgBox("Problem Sending Device configuration")
Exit Sub
End If
int iRetVal;
unsigned long lLastErrNum;
printf("Attempting to start the script\n");
iRetVal = icsneoScriptStart(hObject, DefaultScriptLocation);
if(iRetVal == 0)
{
printf("Failed to start the script API Error\n");
}
else
{
printf("Successfully started the script\n");
}
Dim iResult As Int32
'//Start CoreMini
iResult = icsneoScriptStart(m_hObject, SCRIPT_LOCATION_FLASH_MEM)
If iResult = 0 Then
lblCMStatus.Text = "CoreMini Failed to Start"
Else
lblCMStatus.Text = "CoreMini Started"
End If
SDeviceSettings DeviceReadSettings;
int iNumberOfBytes;
int iResult;
//Get the settings
iNumberOfBytes=sizeof(DeviceReadSettings);
DeviceReadSettings.DeviceSettingType = DeviceFireSettingsType;
iResult = icsneoGetDeviceSettings(m_hObject, &DeviceReadSettings , iNumberOfBytes, 0);
if(iResult == 0)
{
MessageBox::Show("Problem reading configuration");
return;
}
SDeviceSettings DeviceReadSettings = new SDeviceSettings ();
int iNumberOfBytes;
int iResult;
//Get the settings
iNumberOfBytes = System.Runtime.InteropServices.Marshal.SizeOf(DeviceReadSettings);
DeviceReadSettings.uiDevice = EDeviceSettingsType.DeviceFireSettingsType;
iResult = icsNeoDll.icsneoGetDeviceSettings(m_hObject,ref DeviceReadSettings, iNumberOfBytes, 0);
if (iResult == 0)
{
MessageBox.Show("Problem reading configuration");
return;
}
Dim DeviceReadSettings As SDeviceSettings
Dim iNumberOfBytes As Integer
Dim iResult As Integer
'//Get the settings
iNumberOfBytes = System.Runtime.InteropServices.Marshal.SizeOf(DeviceReadSettings)
DeviceReadSettings.uiDevice = EDeviceSettingsType.DeviceFireSettingsType
iResult = icsneoGetDeviceSettings(m_hObject, DeviceReadSettings, iNumberOfBytes, 0)
If iResult = 0 Then
MsgBox("Problem reading configuration")
Exit Sub
End If
Private m_hObject As IntPtr '// Declared at form level and previously open with a call to OpenNeoDevice
Dim VcanReadSettings As SVCAN412Settings
Dim iNumberOfBytes As Integer
Dim iResult As Integer
'//Get the settings
iNumberOfBytes = System.Runtime.InteropServices.Marshal.SizeOf(VcanReadSettings)
iResult = icsneoGetVCAN412Settings(m_hObject, VcanReadSettings , iNumberOfBytes)
If iResult = 0 Then
MsgBox("Problem reading configuration")
Exit Sub
End If
int iRetVal;
iRetVal = icsneoSetFDBitrate(hObject, 5000000, NETID_HSCAN);
if(iRetVal == 0)
{
printf("\nFailed to set the bit rate");
}
else
{
printf("\nSuccessfully set the bit rate");
}
int iResult;
//Set the bit rate
iResult = icsNeoDll.icsneoSetFDBitRate(m_hObject, 5000000, NETID_HSCAN);
if (iResult == 0)
{
MessageBox.Show("Problem setting bit rate");
}
Dim iResult As Integer
'//Set the bit rate
iResult = icsneoSetFDBitRate(m_hObject, 5000000, NETID_HSCAN)
If (iResult = 0) Then MsgBox("Problem setting bit rate")
PhySettings.clause22.phyAddrOrPort=0x6;PhySettings.clause.regAddr=0x2;PhySettings.clause.pageOrDevice=1;PhySettings.WriteEnable=0;PhySettings.Enabled=1;//if not enabled, this entry of read/write operation will be ignored even if it is passed in.PhySettings.Clause45Enable=0;//Set this to 1 if the application is sending Clause45 type of Entries.icsneoReadWritePHYSettings(handle,&PhySettings,sizeof(PhyRegPkt_t),1);
Int32iResult;PhyRegPkt_tPhyRegPkt;intiTempFlags=0;//Copy data to the structurePhyRegPkt.ClausePkt.phyAddrOrPort=6;PhyRegPkt.ClausePkt.pageOrDevice=1;PhyRegPkt.ClausePkt.regAddr=2;PhyRegPkt.ClausePkt.regVal=0;//Set for Reading using Clause45 and EnablediTempFlags=iTempFlags|(int)PhyRegFlags.Enabled;iTempFlags=iTempFlags|(int)PhyRegFlags.Clause45Enable;PhyRegPkt.Flags=(ushort)iTempFlags;//Get and cast the size of the structrue.iResult=icsNeoDll.icsneoReadWritePHYSettings(m_hObject,refPhyRegPkt,(IntPtr)System.RuntimeSystem.Diagnostics.Debug.WriteLine(Convert.ToString(PhyRegPkt.ClausePkt.regVal));
iNumBytes
[in] This value is always the size, in bytes, of the SVCAN4Settings structure.
Return Values
Returns 1 if successful, 0 if an error occurred. GetLastAPIError must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
Remarks
After getting the current settings, you may change the parameters defined in the SVCAN4Settings structure and write the settings back to the ValueCAN 4-4 using SetVCAN4Settings.
//Declared at form level and previously open with a call to OpenNeoDeviceIntPtrm_hObject;//handle for device,
Public Declare Function icsneoGetVCAN4Settings Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pSettings As SVCAN4Settings, ByVal iNumBytes As Int32) As Int32
[out] This is the address of the first element of an array of long variables of at least 600 elements. This array will be loaded with the current error queue. The error queue will contain errors generated by all threads, not just the current thread. A separate topic describes the possible values for error messages. You can get a text description of this error using GetErrorInfo.
pNumberOfErrors
[out] Specifies the number of errors copied into the pErrorMsgs buffer. The maximum value will be 600.
Return Values
Returns 1 if successful, 0 on failure.
Remarks
The error queue will be reset after this method is called.
Examples
intiErrors[599];int lResult;
Public Declare Function icsneoGetErrorMessages Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pErrorMsgs As Int32, ByRef pNumberOfErrors As Int32) As Int32
1 if the function succeeded. 0 if it failed for any reason. GetLastAPIError must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
NEOVI_ERROR_DLL_SCRIPT_INVALID_APPSIG_INDEX = 225
Remarks
The script containing the specified application signal must have been successfully downloaded to the neoVI using ScriptLoad. The script must also have been started using ScriptStart. This function will fail if ScriptStop has been called. The valid index values for application signals within a script can be found in the cmvspy.vs3cmb.h file that is produced by Vehicle Spy. Please see Vehicle Spy documentation.
Examples
int iRetVal;unsignedlong lLastErrNum;double
Int32iResult;DoubleValueToSet;
Public Declare Function icsneoScriptWriteAppSignal Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByVal iIndex As UInt32, ByRef dValue As Double) As Int32
[in] The index value of the function block to start
Return Values
1 if the function succeeded. 0 if it failed for any reason. GetLastAPIError must be called to obtain the specific error. The errors that can be generated by this function are:
The script containing the specified function block must have been successfully downloaded to the neoVI using LoadScript. The valid index values for a function blocks within a script can be found in the cmvspy.vs3cmb.h file that is produced by Vehicle Spy. Please see Vehicle Spy documentation.
Examples
int iRetVal;unsignedlong lLastErrNum;
Int32iResult;//Start Function Block in CoreMiniiResult
Public Declare Function icsneoScriptStartFBlock Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByVal fb_index As UInt32) As Int32
[in] The index value of the function block to stop
Return Values
1 if the function succeeded. 0 if it failed for any reason. GetLastAPIError must be called to obtain the specific error. The errors that can be generated by this function are:
The script containing the specified function block must have been successfully downloaded to the neoVI using LoadScript. Execution of the script must have been started by StartScript. Execution of the function block must have been started using StartFBlock. The valid index values for function blocks within a script can be found in the cmvspy.vs3cmb.h file (Produced by Vehicle Spy. Please see Vehicle Spy documentation).
Examples
int iRetVal;unsignedlong lLastErrNum;
Int32iResult;//Stop Function Block in CoreMiniiResult
Public Declare Function icsneoScriptStopFBlock Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByVal fb_index As UInt32) As Int32
This method returns the neoVI hardware devices connected to the PC.
int _stdcall icsneoFindDevices(NeoDeviceEx* pNeoDeviceEx,int* pNumDevices ,unsigned
Public Declare Function icsneoFindDevices Lib "icsneo40.dll" (ByRef pNeoDevice As NeoDeviceEx, ByRef pNumDevices As Int32, ByRef DeviceTypes As UInt32, ByVal numDeviceTypes As UInt32, ByRef pOptionsFindNeoEx As OptionsNeoEx, ByVal reserved As UInt32) As Int32
[DllImport("icsneo40.dll")]publicstatic
Parameters
pNeoDeviceEx
[out] This is the address of the first element of an array of NeoDeviceEx structure. This array can be as big as 255 devices. You must specify the size of the pNeoDeviceEx array in the pNumDevices parameter. The number of devices found will be limited to the value of pNumberofDevices or 255, whichever is lower. Each returned NeoDevice structure will contain information for each device such as its type, device ‘handle’ and serial number.
pNumberOfDevices
[in/out] In: Specifies the size of the pNeoDevices array. Must be in the range 0 to 255.
Out: Specifies the number of neo devices that were found. This can be in the range 0 to 255.
DeviceTypes
__ [in] This is an array of device types to look for. Specifies the types of neoVI devices to find. Each element in the array need to have a value for the device type to look for. Currently supported values are:
NEODEVICE_UNKNOWN = 0x00000000
NEODEVICE_BLUE = 0x00000001
NEODEVICE_ECU_AVB = 0x00000002
NEODEVICE_RADSUPERMOON = 0x00000003
NEODEVICE_DW_VCAN = 0x00000004
NEODEVICE_RADMOON2 = 0x00000005
NEODEVICE_RADGIGALOG = 0x00000006
NEODEVICE_VCAN41 = 0x00000007
NEODEVICE_FIRE = 0x00000008
NEODEVICE_RADPLUTO = 0x00000009
NEODEVICE_VCAN42_EL = 0x0000000a
NEODEVICE_RADIO_CANHUB = 0x0000000b
NEODEVICE_NEOECU12 = 0x0000000c
NEODEVICE_OBD2_LCBADGE = 0x0000000d
NEODEVICE_RAD_MOON_DUO = 0x0000000e
NEODEVICE_VCAN3 = 0x00000010
NEODEVICE_RADJUPITER = 0x00000011
NEODEVICE_VCAN4_IND = 0x00000012
NEODEVICE_GIGASTAR = 0x00000013
NEODEVICE_ECU22 = 0x00000015
NEODEVICE_RED = 0x00000040
NEODEVICE_ECU = 0x00000080
NEODEVICE_IEVB = 0x00000100
NEODEVICE_PENDANT = 0x00000200
NEODEVICE_OBD2_PRO = 0x00000400
NEODEVICE_PLASMA = 0x00001000
NEODEVICE_NEOANALOG = 0x00004000
NEODEVICE_CT_OBD = 0x00008000
NEODEVICE_ION = 0x00040000
NEODEVICE_RADSTAR = 0x00080000
NEODEVICE_VCAN44 = 0x00200000
NEODEVICE_VCAN42 = 0x00400000
NEODEVICE_CMPROBE = 0x00800000
NEODEVICE_EEVB = 0x01000000
NEODEVICE_VCANRF = 0x02000000
NEODEVICE_FIRE2 = 0x04000000
NEODEVICE_FLEX = 0x08000000
NEODEVICE_RADGALAXY = 0x10000000
NEODEVICE_RADSTAR2 = 0x20000000
NEODEVICE_VIVIDCAN = 0x40000000
NEODEVICE_OBD2_SIM = 0x80000000
NEODEVICE_ALL = = 0xFFFFBFFF
Constants are defined in appropriate header or module. pNumDevicTypes
[in] In: Specifies the size of the DeviceTypes array. Must be in the range 0 to 255.
pOptionsNeoEx
[in] CAN netowork ID for connecting to devices over CAN. Set to null for USB or Ethernet connections.
Return Values
1 if the function succeeded. 0 if it failed for any reason. If the function succeeds but no devices are found 1 will still be returned and pNumberOfDevices will equal 0.
Remarks
The NeoDevice array elements that are returned with this function may be passed to so that individual neoVI devices can be opened.
Examples
ScriptGetScriptStatus Method - neoVI API
This method returns the status of the script on a neoVI device.
int _stdcall icsneoScriptGetScriptStatus(void* hObject,unsignedint
Public Declare Function icsneoScriptGetScriptStatus Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef piStatus As Int32) As Int32
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice.
iFunctionBlockIndex
[in] The index value of the function block
piStatus
[out] 0 = Stopped 1 = Running
Return Values
1 if the function succeeded. 0 if it failed for any reason. must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_SCRIPT_NO_SCRIPT_RUNNING = 226
Remarks
The script must have been successfully downloaded to the neoVI using .
Examples
Using the API in LabVIEW - neoVI API
Overview
The intrepidcs API packages all of the WIN32 methods into LabVIEW LLB. Inside the LLB the sub VIs can be accessed to make it easy for you to use neoVI with National Instruments LabVIEW.
Steps to use neoVI in LabVIEW
Open the “NEO VI Example.llb” found in the file. When you first access the main VI or sub VI’s you may receive a warning regarding a Dependency missing. Make sure that your project is pointing to the icsneo40.dll. This is normally installed to the system32 or SysWOW64 directories.
Example
A LabVIEW example (Figure 1) is included to show how the API all works together. An example project can be found here: .
The example shows how to open and close communication to the driver, send messages and read messages on the networks.
TxMessages Method - neoVI API
This method transmits messages asynchronously to vehicle networks using the neoVI hardware.
Parameters
hObject
[in] Handle which specifies the driver object created by .
ISO15765_TransmitMessage Method - neoVI API
This method transmits a message using ISO15765-2 on a CAN network. icsneoISO15765_EnableNetwroks must be called before using icsneoISO15765_TransmitMessage. PCI bytes and Flow control decoding is taken care of by the dll for the transaction.
Parameters
hObject
[in] Handle which specifies the driver object created with the OpenPort method.
SendConfiguration Method - neoVI API
This method sends configuration information to the hardware.
Parameters
hObject
[in] Specifies the driver object created by .
FindAllCOMDevices Method - neoVI API
This function is deprecated. Useinstead.
This method returns the number of COM (both serial and USB serial) hardware devices connected to the PC.
Parameters
lDriverType
FindNeoDevices Method - neoVI API
This method returns the neoVI hardware devices connected to the PC.
Parameters
DeviceTypes
[in] Specifies the types of neoVI devices to find. Currently supported values are:
Dim iResult As Int32
Dim PhyRegPkt As PhyRegPkt_t
Dim iTempFlags As Int32 = 0
Dim iParamCount As IntPtr = CType(1, IntPtr)
'//Copy data to the structure
PhyRegPkt.ClausePkt.phyAddrOrPort = 6
PhyRegPkt.ClausePkt.pageOrDevice = 1
PhyRegPkt.ClausePkt.regAddr = 3
PhyRegPkt.ClausePkt.regVal = 0
'//Set for Reading using Clause45 and Enabled
iTempFlags = iTempFlags Or PhyRegFlags.Enabled
iTempFlags = iTempFlags Or PhyRegFlags.Clause45Enable
PhyRegPkt.Flags = CUShort(iTempFlags)
'//Get and cast the size of the structrue.
Dim PhyRegSize As IntPtr = CType(System.Runtime.InteropServices.Marshal.SizeOf(PhyRegPkt), IntPtr)
iResult = icsneoReadWritePHYSettings(m_hObject, PhyRegPkt, PhyRegSize, iParamCount)
Debug.Print(CStr(PhyRegPkt.ClausePkt.regVal))
Private m_hObject As IntPtr '// Declared at form level and previously open with a call to OpenNeoDevice
Dim VcanReadSettings As SVCAN4Settings
Dim iNumberOfBytes As Integer
Dim iResult As Integer
'//Get the settings
iNumberOfBytes = System.Runtime.InteropServices.Marshal.SizeOf(VcanReadSettings)
iResult = icsneoGetVCAN4Settings(m_hObject, VcanReadSettings , iNumberOfBytes)
If iResult = 0 Then
MsgBox("Problem reading configuration")
Exit Sub
End If
Dim lResult As Integer '//Storage for result of Function Call
Dim lErrors(600) As Integer '//Array for Error information
Dim lNumberOfErrors As Integer '//Storage for Number of Errors
'// Read Out the errors
lResult = icsneoGetErrorMessages(m_hObject, lErrors(0), lNumberOfErrors)
'// Test the returned result
If Not CBool(lResult) Then
MsgBox("Problem Reading Errors")
End If
int iResult = 0; //Storage for Result of Call
int[] iErrors = new int[600]; //Array for Error Numbers
int iNumberOfErrors = 0; // Storage for number of errors
// Read Out the errors
iResult = icsNeoDll.icsneoGetErrorMessages(m_hObject,ref iErrors[0],ref iNumberOfErrors);
Dim iResult As Int32
Dim ValueToSet As Double
'//Set value to send
ValueToSet = Val(txtAppSigVal.Text)
'//Set App Signal
iResult = icsneoScriptWriteAppSignal(m_hObject, Convert.ToUInt32(cboAppSig.SelectedIndex), ValueToSet)
If iResult = 0 Then
txtAppSigVal.Text = "Problem!"
Else
txtAppSigVal.Text = "Set!"
End If
Dim iResult As Int32
'//Start Function Block in CoreMini
iResult = icsneoScriptStartFBlock(m_hObject, Convert.ToUInt32(cboFBToChange.SelectedIndex))
If iResult = 0 Then
lblFBStatus.Text = "Function Block failed to Start"
Else
lblFBStatus.Text = "Function Block Started"
End If
Dim iResult As Int32
'//Stop Function Block in CoreMini
iResult = icsneoScriptStopFBlock(m_hObject, Convert.ToUInt32(cboFBToChange.SelectedIndex))
If iResult = 0 Then
lblFBStatus.Text = "Function Block failed to Stop"
Else
lblFBStatus.Text = "Function Block Stopped"
End If
[in] This is the address of the first element of an array of icsSpyMessage structures. This array will be loaded by the application software with messages that are to be transmitted by the hardware.
lNetworkID
[in] Specifies the network to transmit the message on. See NetworkIDList List for a list of valid Network ID values. Network support varies by neoVI device. NETID_DEVICE transmits on to the neoVI Device Virtual Network (see users manual).
lNumMessages
[in] Specifies the number of messages to be transmitted. This parameter should always be set to one unless you are transmitting a long Message. Transmitting long messages on ISO or J1708 is described in a different topic.
Return Values
Returns 1 if successful, 0 if an error occurred. GetLastAPIError must be called to obtain the specific error. The errors that can be generated by this function are:
This function call adds a transmit message to the transmit queue. The message will be transmitted when the network is free and all previously transmitted messages have been transmitted. Transmitting long messages which are greater than 12 bytes on ISO or J1708 is described in a different topic.
Transmit Report
After the messages has been transmitted there will be a transmit report message returned from the device. The transmit report will be read out with GetMessages. Any message read which has the SPY_STATUS_TX_MSG (icsSpyStatusTx) bit set in the status bitfield is a transmit report.
You can also identify a particular transmitted message with DescriptionID field. This two byte field (only 14 bits are used) allows the programmer to assign an arbitrary number to a message. This number is then returned in the transmit report.
The transmit report does not necessarily mean the message was transmitted successfully. For example, the Ford SCP network will return a Transmit Report if it had tried to send a message. Therefore, the programmer should always check the GlobalError Flag in the status bitfield.
To transmit different messages, set the appropriate bits in the status bitfields. For example, there are bits for init waveforms, extended identifiers and remote frames.
Examples
Public Declare Function icsneoTxMessages Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pMsg As icsSpyMessage, ByVal lNetworkID As Int32, ByVal lNumMessages As Int32) As Int32
[in] Specifies which neoVI driver to use. This should always be set to INTREPIDCS_DRIVER_STANDARD (0).
lGetSerialNumbers
[in] Specifies whether the serial numbers should be read from the device (iGetSerialNumbers=1). Getting serial numbers will take longer than not doing it therefore so set this to zero if not required for the application. If a device is already opened the serial number cannot be read.
lStopAtFirst
[in] Indicates whether the function should stop at the first device found (lStopAtFirst=1). This is useful when you only have one device connected to the PC.
lUSBCommOnly
[in] Indicates to search USB serial devices only (lUSBCommOnly=1). Normal COM ports will not be searched. Normal COM port searches will take longer to execute.
p_lDeviceTypes
[out] Pointer to array of at least 255 elements. This array will be filled in with the type of device found. The valid device types include INTREPIDCS_DEVICE_NEO4 (0), INTREPIDCS_DEVICE_VCAN (1), or INTREPIDCS_DEVICE_NEO6 (2).
p_lComPorts
[out] Pointer to array of at least 255 elements. This array will be filled in with the com port numbers of each connected device.
p_lSerialNumbers
[out] Pointer to array of at least 255 elements. This array will be filled in with the serial number of each device if argument lGetSerialNumbers=1.
iNumDevices
[out] Points to a value which contains the number of devices found.
Return Values
If this function operates successfully the return value will be 1. If the function fails the return value will be zero.
Remarks
None.
Examples
Public Declare Function icsneoFindAllCOMDevices Lib “icsneo40.dll” _
(ByVal lDriverID As Integer, ByVal lGetSerialNumbers As Integer, _
ByVal lStopAtFirst As Integer, ByVal iUSBCommOnly As Integer, _
ByRef p_lDeviceTypes As Integer, ByRef p_lComPorts As Integer, _
ByRef p_lSerialNumbers As Integer, ByRef lNumDevices As Integer) As Integer
Constants are defined in appropriate header or module. You may use logical OR to choose which devices to look for or use NEODEVICE_ALL to specify all devices.
pNeoDevices [out] This is the address of the first element of an array of NeoDevice structure. This array can be as big as 255 devices. You must specify the size of the pNeoDevices array in the pNumberOfDevices parameter. The number of devices found will be limited to the value of pNumberofDevices or 255, whichever is lower. Each returned NeoDevice structure will contain information for each device such as its type, device ‘handle’ and serial number.
pNumberOfDevices[in/out] In: Specifies the size of the pNeoDevices array. Must be in the range 0 to 255.
Out: Specifies the number of neo devices that were found. This can be in the range 0 to 255.
Return Values
1 if the function succeeded. 0 if it failed for any reason. If the function succeeds but no devices are found 1 will still be returned and pNumberOfDevices will equal 0.
Remarks
The NeoDevice array elements that are returned with this function may be passed to OpenNeoDevice so that individual neoVI devices can be opened.
Examples
Public Declare Function icsneoFindNeoDevices Lib “icsneo40.dll” (ByVal DeviceTypes As UInt32, ByRef pNeoDevice As NeoDevice, ByRef pNumDevices As Int32) As Int32
int _stdcall icsneoFindNeoDevices(unsignedlong DeviceTypes, NeoDevice *pNeoDevices,int*pNumberOfDevices);
void * hObject = 0; // holds a handle to the neoVI object
icsSpyMessage stMsg;
int iResult;
// Load the message to be transmitted ArbID = FF standard data 0x22 0x52 0x12 0x28
stMsg.ArbIDOrHeader = 0xFF;
stMsg.NumberBytesData = 4;
stMsg.Data[0] = 0x22;
stMsg.Data[1] = 0x52;
stMsg.Data[2] = 0x12;
stMsg.Data[3] = 0x28;
// Status Bitfield standard ID no remote frame
stMsg.StatusBitField = 0;
stMsg.StatusBitField2 = 0;
// Transmit the message on high speed can
iResult = icsneoTxMessages(hObject,&stMsg,NETID_HSCAN,1);
if (iResult == 0)
MessageBox(hWnd,TEXT("Problem Transmitting Messages"),TEXT("neoVI Example"),0);
Dim lResult As Long
Dim stMessagesTx As icsSpyMessage
Dim lNumberBytes As Long
Dim sDataArray(7) As String
sDataArray(0) = txtDataByte1.Text ''Put data from form in
sDataArray(1) = txtDataByte2.Text ''form of Array
sDataArray(2) = txtDataByte3.Text
sDataArray(3) = txtDataByte4.Text
stMessagesTx.ArbIDOrHeader = Val("&H" & txtArbID.Text) ''Set ArbID in structur
stMessagesTx.NumberBytesData = 4 ''Set the number of Data bytes
stMessagesTx.Data1 = Val("&H" & sDataArray(0)) ''Set data bytes in structure
stMessagesTx.Data2 = Val("&H" & sDataArray(1))
stMessagesTx.Data3 = Val("&H" & sDataArray(2))
stMessagesTx.Data4 = Val("&H" & sDataArray(3))
lResult = icsneoTxMessages(m_hObject, stMessagesTx, 1, 1) ''Send message
If Not CBool(lResult) Then ''Check the status of sent message
MsgBox("Problem Transmitting Message")
End If
int iResult; //Storage for the Result from function call
icsSpyMessage stMessagesTx = new icsSpyMessage(); //Storage for TXMessage
//Set the ArbID information for TX message
stMessagesTx.ArbIDOrHeader = ConvertFromHex(txtArbID.Text);
//Set the number of Data Bytes and set the Data Bytes values
stMessagesTx.NumberBytesData = Convert.ToByte(4);
stMessagesTx.Data1=Convert.ToByte(ConvertFromHex(txtDataByte1.Text));
stMessagesTx.Data2=Convert.ToByte(ConvertFromHex(txtDataByte2.Text));
stMessagesTx.Data3=Convert.ToByte(ConvertFromHex(txtDataByte3.Text));
stMessagesTx.Data4=Convert.ToByte(ConvertFromHex(txtDataByte4.Text));
//Clear the Status BitFields
stMessagesTx.StatusBitField = 0;
stMessagesTx.StatusBitField2 = 0;
//Call the Tx funciton
iResult=icsNeoDll.icsneoTxMessages(m_hObject,ref stMessagesTx,1,0);
if(iResult== 0) //Check the status of the Function Call
{
MessageBox.Show ("Problem Transmitting Message");
}
Opens first device on USB Com port either a ValueCAN or neoVI PRO
int iDeviceTypes[255];
int iComPort[255];
int iSerialNum[255];
int iOpenedStates[255];
int iDeviceNumbers[255];
int iNumDevices;
if (icsneoFindAllCOMDevices(INTREPIDCS_DRIVER_STANDARD, 0,1,1,iDeviceTypes,iComPort,iSerialNum,&iNumDevices))
{
if (iNumDevices > 0)
{
lResult = icsneoOpenPortEx(iComPort[0] ,NEOVI_COMMTYPE_RS232,
INTREPIDCS_DRIVER_STANDARD,0,57600,1,bNetworkID, &hObject);
if (lResult == 0)
MessageBox(hWnd,TEXT("Problem Opening Port"),TEXT("neoVI Example"),0);
else
{
MessageBox(hWnd,TEXT("Port Opened Successfully"),TEXT("neoVI Example"),0);
}
}
}
else
MessageBox(hWnd,TEXT("Problem Opening Port"),TEXT("neoVI Example"),0);
}
else
MessageBox(hWnd,TEXT("Problem Opening Port"),TEXT("neoVI Example"),0);
This example demonstrates loading a list box with all the devices connected to the PC
int lResult = 0; //Storage for Result of Function call
int[] iDevices = new int[127]; //Array for the device numbers
int[] iSerialNumbers = new int[127]; //Araay for serial numbers of attached devices
int[] iOpenedStatus = new int[127]; //Array of the status of the driver
int iNumDevices = 0; //Storage for the number of devices
int[] iCommPortNumbers = new int[127]; //Array of Comm Port numbers in use
int Counter = 0; //Counter for Counting things
//Call function for Finding all Comm deivces
lResult = icsNeoDll.icsneoFindAllCOMDevices(Convert.ToInt32 (eDRIVER_TYPE.INTREPIDCS_DRIVER_STANDARD), 1,0,0,ref iDevices[0],ref iCommPortNumbers[0], ref iSerialNumbers[0],ref
iNumDevices)
//Check the status of the funciton call
if(lResult==1)
{
//Fill in list box with device findings
for(Counter=0;Counter<127; Counter++)
{
lstCommDevices.Items.Add("Device Type-" + Convert.ToString(iDevices[Counter]) + " SN-" + Convert.ToString(iSerialNumbers[Counter]) + " Port #" + Convert.ToString(iCommPortNumbers[Counter]));
}
}
else
{
//display error box if could not find anything
MessageBox.Show("Could Not Find anything");
}
This example demonstrates loading a list box with all the devices connected to the PC
Dim lResult As Integer ''Storage for Result of Function call
Dim iDevices(127) As Integer ''Array for the device numbers
Dim iSerialNumbers(127) As Integer ''Array for Serial numbers of attached devices
Dim iOpenedStatus(127) As Integer ''Array of Status of Driver
Dim iNumDevices As Integer ''Storage for the number of devices
Dim iCommPortNumbers(127) As Integer ''Array of Comm port numbers in use
Dim Counter As Integer ''Counter for counting things
''Function call for Finding all of the Comm devices
lResult = icsneoFindAllCOMDevices(INTREPIDCS_DRIVER_STANDARD, 1, 0, 0, iDevices(0), iCommPortNumbers(0), iSerialNumbers(0), iNumDevices)
''check the results
If lResult = 1 Then
For Counter = 0 To 127
''Fill list box with device findings
lstCommDevices.Items.Add("Device Type-" + Convert.ToString(iDevices(Counter)) + _
" SN-" + Convert.ToString(iSerialNumbers(Counter)) + " Port #" + Convert.ToString(iCommPortNumbers(Counter)))
Next Counter
Else
''Display error message if could not find anything
MsgBox("Could not find anything")
End If
NeoDevice Devices[255];
unsigned long lDevTypes;
int iNumDevices = 255;
int iRetVal = 0;
int lDevTypes;
lDevTypes = NEODEVICE_ALL;
iRetVal = icsneoFindNeoDevices(lDevTypes, Devices, &iNumDevices);
int iResult;//Holds the results from function call
NeoDevice ndNeoToOpen = new NeoDevice(); ; //Struct holding detected hardware information
int iNumberOfDevices; //Number of hardware devices to look for
int lDevTypes; //Holds the device types to look for
lDevTypes = NEODEVICE_ALL;
//Set the number of devices to find
iNumberOfDevices = 1;
//Search for connected hardware
iResult = icsNeoDll.icsneoFindNeoDevices(65535, ref ndNeoToOpen, ref iNumberOfDevices);
if (iResult == 0)
{
MessageBox.Show("Problem finding devices");
return;
}
Dim iResult As Integer '//Holds the results from function call
Dim ndNeoToOpen As NeoDevice '//Struct holding detected hardware information
Dim iNumberOfDevices As Integer '//Number of hardware devices to look for
Dim lDevTypes As Integer '//Holds the device types to look for
'//Set the devices to look for
lDevTypes = NEODEVICE_ALL
'//Set the number of devices to find
iNumberOfDevices = 1
'//Search for connected hardware
iResult = icsneoFindNeoDevices(lDevTypes, ndNeoToOpen, iNumberOfDevices)
If (iResult = 0) Then MsgBox("Problem finding devices")
NeoDeviceEx Devices[255];
unsigned long lDevTypes;
int iNumDevices = 255;
int iRetVal = 0;
int lDevTypes;
lDevTypes = NEODEVICE_ALL;
iRetVal = icsneoFindDevices(Devices, &iNumberOfDevices,NULL,0,NULL,0);
int iResult;//Holds the results from function call
NeoDeviceEx ndNeoToOpen = new NeoDeviceEx(); ; //Struct holding detected hardware information
int iNumberOfDevices; //Number of hardware devices to look for
int lDevTypes; //Holds the device types to look for
lDevTypes = NEODEVICE_ALL;
//Set the number of devices to find
iNumberOfDevices = 1;
//Search for connected hardware
iResult = icsNeoDll.icsneoFindDevices(ref ndNeoToOpenex[0],ref iNumberOfDevices, 0, 0,ref neoDeviceOption, 0);
if (iResult == 0)
{
MessageBox.Show("Problem finding devices");
return;
}
Dim iResult As Integer '//Holds the results from function call
Dim ndNeoToOpenex As NeoDeviceEx '//Struct holding detected hardware information
Dim iNumberOfDevices As Integer '//Number of hardware devices to look for
Dim lDevTypes As Integer '//Holds the device types to look for
Dim neoDeviceOption As OptionsNeoEx = New OptionsNeoEx '//Not using CAN 0 out
'//Set the devices to look for
lDevTypes = NEODEVICE_ALL
'//Set the number of devices to find
iNumberOfDevices = 1
'//Search for connected hardware
iResult = icsneoFindDevices(ndNeoToOpenex(0), iNumberOfDevices, 0, 0, neoDeviceOption, 0)
If (iResult = 0) Then MsgBox("Problem finding devices")
int iRetVal;int iStatus;unsignedlong lLastErrNum;iRetVal =icsneoScriptGetScriptStatus(hObject,&iStatus);if(iRetVal ==0){printf("\nFailed to get the script status. API Error = %d\r\n", lLastErrNum);}else{printf("\nScript status = %s\r\n", iStatus ==0?"Stopped":}
Int32iResult;Int32iStatus=0;//Get CoreMini StatusiResult=icsNeoDll.icsneoScriptGetScriptStatus(m_hObject,refiStatus);if(iResult==0){lblCMStatus.Text="Failed to get CoreMini Status";}else{switch(iStatus){case(int)ScriptStates.SCRIPT_STATUS_RUNNING:lblCMStatus.Text="CoreMini Script Running";break;case(int)ScriptStates.SCRIPT_STATUS_STOPPED:lblCMStatus.Text="CoreMini Script Stopped";break;default:lblCMStatus.Text="Unhandled State";break;}}
ulNetwork
[in] Specifies the network to transmit the message on. See NetworkID List for a list of valid Network ID values. Network support varies by neoVI device. NETID_DEVICE transmits on to the neoVI Device Virtual Network (see users manual).
stCM_ISO157652_TxMessage
[in] This is the address of the stCM_ISO15765_TxMessage structure. The structure contains the properties for the multi frame message transaction.
ulBlockingTimeout
[in] Amount of time in ms to wait for flow controls before timing out.
Return Values
None.
Remarks
None.
Examples
long lResult;int iNetwork =1;int
Public Declare Function icsneoISO15765_TransmitMessage Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByVal ulNetworkID As Integer, ByRef pMsg As stCM_ISO157652_TxMessage, ByVal ulBlockingTimeout As Integer) As Int32
[in] This is an array configuration bytes. The format of this array is defined in the Configuration Array help topic. This data should be filled in with a call to GetConfiguration before calling SendConfiguration. The size of this array must always be 1024 bytes.
lNumBytes
[in] This must always be set to 1024.
Return Values
Returns 1 if successful, 0 if an error occurred. GetLastAPIError must be called to obtain the specific error. The errors that can be generated by this function are:
NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75
Remarks
This method will only update the configuration defined in the Configuration Array topic. It will also apply checking to the data so that a neoVI is not programmed to an illegal state. For example, setting the CAN controller to an illegal operating mode.
This method downloads a script to a connected neoVI device into a specified location.
int _stdcall icsneoScriptLoad(void* hObject,constunsigned
Public Declare Function icsneoScriptLoad Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef bin As Byte, ByVal Len_Bytes As UInt32, ByVal iLocation As Int32) As Int32
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice.
bin[in] An array of bytes that represent a compiled script. These bytes are contained in a header file called cmvspy.h.
This file is created by Vehicle Spy when a script is compiled. Please see Vehicle Spy documentation for details.
len_bytes
[in] Specifies the number of bytes represented by the bin parameter
iLocation
[in] Specifies the physical location to where the script will be loaded on the neoVI device. Valid values are as follows:
SCRIPT_LOCATION_FLASH_MEM = 0 (Valid only on a neoVI Fire or neoVI Red)SCRIPT_LOCATION_SDCARD = 1 (Valid only on a neoVI Fire or neoVI Red)SCRIPT_LOCATION_VCAN3_MEM = 4 (Valid only on a ValueCAN 3 device)
These values are defined in the icsnVC40.h file
Return Values
1 if the function succeeded. 0 if it failed for any reason. must be called to obtain the specific error. The errors that can be generated by this function are:
The script will be stored on the device in the specified location. If the location is SCRIPT_LOCATION_FLASH_MEM or SCRIPT_LOCATION_SDCARD the script will persist in the device in that location until cleared by . If the neoVI device is booted (plugged in to power) without being connected to a USB port the stored script will execute. The location SCRIPT_LOCATION_VCAN3_MEM applies only to the ValueCAN 3 device and the storage will be cleared when power is removed from the device.
Examples
OpenPortEx Method - neoVI API
This function is deprecated. Use theOpenNeoDevicemethod instead.
This function opens a connection to a neoVI device.
int _stdcall icsneoOpenPortEx(int lPortNumber,int lPortType,int
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”)]publicstatic
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.
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).
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.
Every time you create a new neoVI driver object you must call (after ). If you do not you will create a memory leak.
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
Each successful call to OpenPort should be matched with a call to . The OpenPort call will reset the timestamp clock.
Examples
GetErrorInfo Method - neoVI API
This method returns a text description of an neoVI API error number.
Parameters
lErrorNumber
[in] This is the number of the error message returned from . A separate topic describes the possible values for .
sErrorDescriptionShort
[out] This is short description of the error. This parameter should be sized to include up to 255 characters including the NULL terminator.
Dim iResult As Int32
Dim iStatus As Int32
'//Get CoreMini Status
iResult = icsneoScriptGetScriptStatus(m_hObject, iStatus)
If iResult = 0 Then
lblCMStatus.Text = "Failed to get CoreMini Status"
Else
Select Case iStatus
Case SCRIPT_STATUS_RUNNING
lblCMStatus.Text = "CoreMini Script Running"
Case SCRIPT_STATUS_STOPPED
lblCMStatus.Text = "CoreMini Script Stopped"
Case Else
lblCMStatus.Text = "Unhandled State"
End Select
End If
int lResult;
int iCounter;
int iNetwork = 1;
byte[] DataBytes = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
//Create Message and adjust array to proper size
stCM_ISO157652_TxMessage tx_msg = new stCM_ISO157652_TxMessage();
tx_msg.data = new byte[4096];
//enable ISO15765
lResult = icsNeoDll.icsneoISO15765_EnableNetworks(m_hObject, 1);
tx_msg.id = 0x7E0; //ArbID of the message
tx_msg.vs_netid = 1; //Network to use
tx_msg.num_bytes = 64; //The number of data bytes to use
tx_msg.padding = 0xAA; //Set Padding Byte
//Set Flags
int iFlags=0;
iFlags = (iFlags | Convert.ToInt32(CSnet.stCM_ISO157652_TxMessage_Flags.paddingEnable)); //Enable Padding
tx_msg.flags = Convert.ToUInt16(iFlags);
//Set up Flow control
tx_msg.fc_id = 0x7E8; //ArbID for the flow control Frame
tx_msg.fc_id_mask = 0xFFF; //The flow control arb filter mask (response id from receiver)
tx_msg.fs_timeout = 0x100; //Flow Control Time out in ms
tx_msg.fs_wait = 0x3000; //Flow Control FS=Wait Timeout ms
tx_msg.blockSize = 0;//Block size (for sending flow Control)
tx_msg.stMin = 0;
//Fill data
for (iCounter = 0; iCounter < DataBytes.GetUpperBound(0);iCounter ++)
{
tx_msg.data[iCounter] = DataBytes[iCounter];
}
lResult = icsNeoDll.icsneoISO15765_TransmitMessage(m_hObject, iNetwork,ref tx_msg, 3000);
Dim lResult As Integer
Dim iCounter As Integer
Dim iNetwork As Integer = 1
Dim DataIn() As Byte = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}
'//Create Message and adjust array to proper size
Dim tx_msg As stCM_ISO157652_TxMessage
tx_msg.data = New Byte(4096) {}
'//Create Flow Control Receive filter
Dim flow_cntrl_msg As New stCM_ISO157652_RxMessage
'//enable ISO15765
lResult = icsneoISO15765_EnableNetworks(m_hObject, GetNetworkIDfromString(lstISO15765Network.Text))
tx_msg.id = &H7E0 '//ArbID of the message
tx_msg.vs_netid = NETID_HSCAN '//Network to use
tx_msg.num_bytes = 64 '//The number of data bytes to use
tx_msg.padding = &HAA '//Set Padding Byte
tx_msg.flags = 0 '//Clear Flags
tx_msg.flags = CUShort(tx_msg.flags Or stCM_ISO157652_TxMessage_Flags.paddingEnable)'//Enable Padding
'//Configure Flow Control
tx_msg.fc_id = &H7E8 '//ArbID for the flow control Frame
tx_msg.fc_id_mask = &HFFF '//The flow control arb filter mask (response id from receiver)
tx_msg.flowControlExtendedAddress = 0 '//Extended ID
tx_msg.fs_timeout = &H100 '//Flow Control Time out in ms
tx_msg.fs_wait = &H3000 '//Flow Control FS=Wait Timeout ms
tx_msg.blockSize = 0 '//Block size (for sending flow Control)
tx_msg.stMin = 0
'//Fill data
For iCounter = 0 To UBound(DataIn)
tx_msg.data(iCounter) = DataIn(iCounter)
Next iCounter
lResult = icsneoISO15765_TransmitMessage(m_hObject, iNetwork, tx_msg, 3000)
Dim bConfigBytes(1024) As Byte ''Storage for Data bytes from device
Dim iNumBytes As Integer ''Storage for Number of Bytes
Dim lResult As Integer ''Storage for Result of Called Function
Dim Counter As Integer
Dim iNumberOfErrors As Long ''Storage for Number of Errors Received
''Clear ListBox
lstConfigInformation.Items.Clear()
''Call Get Configuration
lResult = icsneoGetConfiguration(m_hObject, bConfigBytes(0), iNumBytes)
''Fill Listbox with Data From Function Call
For Counter = 0 To 1024
lstConfigInformation.Items.Add("Byte Number-" & Counter & " Byte Data-" & bConfigBytes(Counter))
Next Counter
'/---------------------READ CONFIGURATION -----------------------------------------------
''Set HS CAN Baud Rate Information
bConfigBytes(NEO_CFG_MPIC_HS_CAN_CNF1) = Val("&H" & txtCNF1.Text)
bConfigBytes(NEO_CFG_MPIC_HS_CAN_CNF2) = Val("&H" & txtCNF2.Text)
bConfigBytes(NEO_CFG_MPIC_HS_CAN_CNF3) = Val("&H" & txtCNF3.Text)
'/---------------------SEND CONFIGURATION -----------------------------------------------
''Call Sned configuration
lResult = icsneoSendConfiguration(m_hObject, bConfigBytes(0), iNumBytes)
'// make sure the read was successful
If Not CBool(lResult) Then
MsgBox("Problem sending configuration")
lResult = icsneoClosePort(m_hObject, iNumberOfErrors)
Exit Sub
Else
MsgBox("Configuration Successfull")
End If
byte[] bConfigBytes= new byte[1024]; //Storage for Data bytes from device
int iNumBytes = 0; //Storage for Number of Bytes
int lResult = 0; //Storage for Result of Called Function
int Counter;
int lNumberOfErrors = 0; //Storage for Number of Errors Received
//Clear ListBox
lstConfigInformation.Items.Clear();
//---------------------READ CONFIGURATION -----------------------------------------------
//Call Get Configuration
lResult = icsNeoDll.icsneoGetConfiguration(m_hObject, ref bConfigBytes[0],ref iNumBytes);
//Fill Listbox with Data From Function Call
for(Counter=0; Counter<1024;Counter++)
{
lstConfigInformation.Items.Add("Byte Number-" + Counter + " Byte Data-" + bConfigBytes[Counter]);
}
//Set HS CAN Baud Rate Information
bConfigBytes[Convert.ToInt32(icsConfigSetup.NEO_CFG_MPIC_HS_CAN_CNF1)] = Convert.ToByte(ConvertFromHex(txtCNF1.Text));
bConfigBytes[Convert.ToInt32(icsConfigSetup.NEO_CFG_MPIC_HS_CAN_CNF2)] = Convert.ToByte(ConvertFromHex(txtCNF2.Text));
bConfigBytes[Convert.ToInt32(icsConfigSetup.NEO_CFG_MPIC_HS_CAN_CNF3)] = Convert.ToByte(ConvertFromHex(txtCNF3.Text));
//---------------------SEND CONFIGURATION -----------------------------------------------
//Call Sned configuration
lResult = icsNeoDll.icsneoSendConfiguration(m_hObject, ref bConfigBytes[0], iNumBytes);
// make sure the read was successful
if(lResult==0)
{
MessageBox.Show("Problem sending configuration");
lResult = icsNeoDll.icsneoClosePort(m_hObject, ref lNumberOfErrors);
}
else
{
MessageBox.Show("Configuration Successfull");
}
MessageBox(hWnd,TEXT("Port Not Open"),TEXT("neoVI Example"),0);
sErrorDescriptionLong
[out] This is longer more detailed description of the error. This parameter should be sized to include up to 255 characters including the NULL terminator.
lMaxLengthShort
[in] This is the size in characters of the sErrorDescriptionShort array that is being passed in. This value must be 255 or less.
lMaxLengthLong
[in] This is the size in characters of the sErrorDescriptionLong array that is being passed in. This value must be 255 or less.
lErrorSeverity
[out] This indicates the error severity. This is estimated severity for the application and doesn't have significant meaning. See Table 1 below for more information.
lRestartNeeded
[out] If 1 it is recommend that the application close communications with the DLL and reopen it.
Return Values
If the error number was found successfully the return value will be non-zero.
Remarks
None.
Table 1 - Descriptions of Error Severity
Error Severity
Description
const unsigned long icsspyErrCritical=0x10;
A critical error which affects operation or accuracy
const unsigned long icsspyErrExclamation=0x30;
An important error which may be critical depending on the application.
const unsigned long icsspyErrInformation=0x40;
An error which probably does not need attention.
const unsigned long icsspyErrQuestion=0x20;
An error which is not understood.
Examples
Public Declare Function icsneoGetErrorInfo Lib "icsneo40.dll" _
(ByVal lErrorNumber As Int32, _
ByVal sErrorDescriptionShort As String, _
ByVal sErrorDescriptionLong As String, _
ByRef lMaxLengthShort As Int32, _
ByRef lMaxLengthLong As Int32, _
ByRef lErrorSeverity As Int32, _
ByRef lRestartNeeded As Int32) As Int32
// Read the errors from the DLL
lResult = icsneoGetErrorMessages(hObject,iErrors,&lNumberOfErrors);
if (lResult == 0)
MessageBox(hWnd,TEXT("Problem Reading errors"),TEXT("neoVI Example"),0);
// dump the neoVI errors
if (lNumberOfErrors > 0)
{
for (lCount=0;lCount <lNumberOfErrors;lCount++)
{
wsprintf(szOut,TEXT("Error %d - "),iErrors[lCount]);
OutputDebugString(szOut);
icsneoGetErrorInfo(iErrors[lCount],szDescriptionShort,szDescriptionLong,
&lMaxLengthShort,&lMaxLengthLong,&lErrorSeverity,&lRestartNeeded);
OutputDebugString(szDescriptionShort);
OutputDebugString(TEXT("\n"));
}
}
else
OutputDebugString(TEXT("No Errors to report\n"));
Public Function icsneoGetDLLErrorInfo(ByVal lErrorNum As Int32, ByRef sErrorShort As String, ByRef sErrorLong As String, ByRef lSeverity As Int32, ByRef bRestart As Int32) As Boolean
Dim lErrorLongLength As Int32
Dim lErrorShortLength As Int32
Dim lRestart As Int32
Dim lResult As Int32
sErrorLong = New String(Chr(0), 255)
sErrorShort = New String(Chr(0), 255)
lErrorLongLength = 255
lErrorShortLength = 255
lResult = icsneoGetErrorInfo(lErrorNum, sErrorShort, sErrorLong, lErrorShortLength, lErrorLongLength, lSeverity, lRestart)
sErrorShort = Left(sErrorShort, lErrorShortLength)
sErrorLong = Left(sErrorLong, lErrorLongLength)
bRestart = CBool(lRestart)
icsneoGetDLLErrorInfo = CBool(lResult)
End Function
**This function reads errors and loads them into a list box**
Private Sub cmdGetErrors_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdGetErrors.Click
Dim lResult As Integer '//Storage for result of Function Call
Dim lErrors(600) As Int32 '//Array for Error information
Dim lNumberOfErrors As Integer '//Storage for Number of Errors
Dim lCount As Integer '//Counter
Dim sErrorShort As String '//String Holding Short Error Name
Dim sErrorLong As String '//String Holding Long Error Name
Dim iSeverity As Int32 '//Storage for Level of error
Dim bRestart As Int32 '//flag for if Restart is required
'// Read Out the errors
lResult = icsneoGetErrorMessages(m_hObject, lErrors(0), lNumberOfErrors)
'// Test the returned result
If Not CBool(lResult) Then
MsgBox("Problem Reading Errors")
Else
'//List Error information
lstErrorHolder.Items.Clear()
For lCount = 1 To lNumberOfErrors
Call icsneoGetDLLErrorInfo(lErrors(lCount - 1), sErrorShort, sErrorLong, iSeverity, bRestart)
lstErrorHolder.Items.Add(sErrorShort + " - Description" + _
sErrorLong + " - Errornum: " + Convert.ToString(lErrors(lCount - 1)))
Next lCount
End If
End Sub
private void cmdGetErrors_Click(object sender, System.EventArgs e)
{
int iResult = 0; //Storage for Result of Call
int[] iErrors = new int[600]; //Array for Error Numbers
int iNumberOfErrors = 0; // Storage for number of errors
int iCount= 0; //Counter
int iSeverity =0; //tells the Severity of Error
int iMaxLengthShort = 0; //Tells Max length of Error String
int iMaxLengthLong = 0; //Tells Max Length of Error String
int lRestart = 0; //tells if a restart is needed
StringBuilder sErrorShort = new StringBuilder(256); //String for Error
StringBuilder sErrorLong = new StringBuilder(256); //String for Error
iMaxLengthShort = 1; //Set initial conditions
iMaxLengthLong = 1; //Set initial conditions
// Read Out the errors
iResult = icsNeoDll.icsneoGetErrorMessages(m_hObject,ref iErrors[0],ref iNumberOfErrors);
// Test the returned result
if(iResult == 0)
{
MessageBox.Show ("Problem Reading Errors");
}
else
{
if(iNumberOfErrors != 0)
{
for(iCount=0;iCount< iNumberOfErrors;iCount++)
{
//Get Text Description of the Error
iResult = icsNeoDll.icsneoGetErrorInfo(iErrors[iCount],
sErrorShort, sErrorLong ,ref iMaxLengthShort , ref iMaxLengthLong, ref iSeverity,ref lRestart);
lstErrorHolder.Items.Add (sErrorShort + " - Description " + sErrorLong + " - Errornum: " + iErrors[iCount]);
}
}
}
}
int iRetVal;
unsigned long lLastErrNum;
unsigned long NumBinBytes;
NumBinBytes = CM_EXE_SIZE; //from the cmvspy.h file. The length of the compiled script
//ucharConfigurationArrayPM is defined in cmvspy.h.
//It is a pointer to the array of compiled script bytes
iRetVal = icsneoScriptLoad(hObject, ucharConfigurationArrayPM, NumBinBytes, DefaultScriptLocation);
if(iRetVal == 0)
{
printf("\nFailed to load the script into the neo device);
}
else
{
printf("\nSuccessfully loaded the script into the neoVI");
}
Int32 iResult;
UInt32 iLength=0;
byte[] CoreMiniData=new byte[1];
'//Helper function
iResult = GetCoreMiniData(ref CoreMiniData,ref iLength);
if(iResult != 1)
{
MessageBox.Show("Problem Loading CoreMini");
return;
}
iResult = icsNeoDll.icsneoScriptLoad(m_hObject,ref CoreMiniData[0], iLength, Convert.ToInt32(CoreMiniStoreLocation.SCRIPT_LOCATION_FLASH_MEM));
if(iResult == 0)
{
lblCMStatus.Text = "CoreMini Not Loaded";
}
else
{
lblCMStatus.Text = "CoreMini loaded into hardware";
}
//Helper function for reading the *.vs3cmbeMini file
private Int32 GetCoreMiniData(ref byte[] DataArray,ref UInt32 DataLength)
{
string sNameOfFile;
System.IO.FileStream ReadFileStream;
System.IO.BinaryReader ReadBinaryData;
//Open file Dialog
OpenFileDialog.ShowDialog();
sNameOfFile = OpenFileDialog.FileName;
// Check for the file to exist
if(!System.IO.File.Exists(sNameOfFile)) return 0;
//Read data in
try
{
ReadFileStream = new System.IO.FileStream(sNameOfFile, System.IO.FileMode.Open);
ReadBinaryData = new System.IO.BinaryReader(ReadFileStream);
DataLength = Convert.ToUInt32(ReadFileStream.Length);
DataArray = ReadBinaryData.ReadBytes(Convert.ToInt32(DataLength));
ReadFileStream.Close();
return 1;
}
catch(System.Exception ex)
{
return 0;
}
}
Dim iResult As Int32
Dim iLength As UInt32
Dim CoreMiniData(1) As Byte
'//Helper function
iResult = GetCoreMiniData(CoreMiniData, iLength)
If iResult <> 1 Then MsgBox("Problem Loading CoreMini", MsgBoxStyle.OKOnly) : Exit Sub
Select Case iOpenDeviceType
Case NEODEVICE_VCAN3
iResult = icsneoScriptLoad(m_hObject, CoreMiniData(0), iLength, SCRIPT_LOCATION_VCAN3_MEM)
Case NEODEVICE_FIRE
iResult = icsneoScriptLoad(m_hObject, CoreMiniData(0), iLength, SCRIPT_LOCATION_FLASH_MEM)
Case Else
MsgBox("Hardware does not support CoreMini")
iResult = 0
End Select
If iResult = 0 Then
lblCMStatus.Text = "CoreMini Not Loaded"
Else
lblCMStatus.Text = "CoreMini loaded into hardware"
End If
'//Helper function for reading the \*.vs3cmbeMini file
Private Function GetCoreMiniData(ByRef DataArray() As Byte, ByRef DataLength As UInt32) As Int32
Dim sNameOfFile As String
Dim ReadFileStream As IO.FileStream
'//Open file Dialog
OpenFileDialog.ShowDialog()
sNameOfFile = OpenFileDialog.FileName
'// Check for the file to exist
If Not IO.File.Exists(sNameOfFile) Then Return 0
'//get the data length
DataLength = Convert.ToUInt32(FileLen(sNameOfFile))
'//Read data in
Try
ReadFileStream = New IO.FileStream(sNameOfFile, IO.FileMode.Open)
Dim ReadBinaryData As New IO.BinaryReader(ReadFileStream)
DataArray = ReadBinaryData.ReadBytes(Convert.ToInt32(DataLength))
ReadFileStream.Close()
Catch ex As Exception
ReadFileStream.Close()
Return 0
End Try
Return 1
End Function
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
}
TxMessagesEx Method - neoVI API
This method transmits longer messages asynchronously to vehicle networks using the neoVI hardware. Method supports CAN FD and Ethernet networks.
int _stdcall icsneoTxMessagesEx(void* hObject, icsSpyMessage *pMsg,
Public Declare Function icsneoTxMessagesEx Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pMsg As icsSpyMessage, ByVal lNetworkID As Int32, ByVal lNumMessages As Int32, ByRef NumTxed As Int32, ByVal reserved As Int32) As Int32int _stdcall icsneoTxMessagesEx(void * hObject, icsSpyMessage *pMsg, int lNetworkID, int lNumMessages, int *NumTxed, int reserved);
[DllImport(“icsneo40.dll”)]publicstatic
Parameters
hObject
[in] Handle which specifies the driver object created by OpenNeoDevice
pMsg
[in] This is the address of the first element of an array of structures. This array will be loaded by the application software with messages that are to be transmitted by the hardware.
lNetworkID
[in] Specifies the network to transmit the message on. See for a list of valid Network ID values. Network support varies by neoVI device. NETID_DEVICE transmits on to the neoVI Device Virtual Network (see users manual).
lNumMessages
[in] Specifies the number of messages to be transmitted. This parameter should always be set to one unless you are transmitting a long Message. Transmitting long messages on ISO or J1708 is described in a .
NumTxed
[out] Specifies the number of messages that have been transmitted.
reserved
[in] Reserved parameter for future use. Set to 0.
Return Values
Returns 1 if successful, 0 if an error occurred. must be called to obtain the specific error. The errors that can be generated by this function are:
This function call adds a transmit message to the transmit queue for CAN FD (more than 8 bytes) and Ethernet. The message will be transmitted when the network is free and all previously transmitted messages have been transmitted.
Transmit Report
After the messages has been transmitted there will be a transmit report message returned from the device. The transmit report will be read out with . Any message read which has the SPY_STATUS_TX_MSG (icsSpyStatusTx) bit set in the is a transmit report.
You can also identify a particular transmitted message with DescriptionID field. This two byte field (only 14 bits are used) allows the programmer to assign an arbitrary number to a message. This number is then returned in the transmit report.
The transmit report does not necessarily mean the message was transmitted successfully. For example, the Ford SCP network will return a Transmit Report if it had tried to send a message. Therefore, the programmer should always check the GlobalError Flag in the .
To transmit different messages, set the appropriate bits in the . For example, there are bits for init waveforms, extended identifiers and remote frames.
long lResult;
icsSpyMessage stMessagesTx;
int lNetworkID;
unsigned int iNumberTxed;
unsigned char iDataBytes[]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; //Data to send
//Send on HS CAN
lNetworkID = NETID_HSCAN;
//Set the ID
stMessagesTx.ArbIDOrHeader = 0x123;
stMessagesTx.NumberBytesHeader = 0;
stMessagesTx.StatusBitField = 0; //11 bit ID
stMessagesTx.Protocol = SPY_PROTOCOL_CANFD;
stMessagesTx.StatusBitField3 = 16; //Enable bitrate switch
// The number of Data Bytes
//NOTE: CAN FD is limited to lengths of 0,1,2,3,4,5,6,7,8,12,16,20,24,32,48,64
stMessagesTx.NumberBytesData = 64;
//Enable Extra Data Pointer
stMessagesTx.ExtraDataPtrEnabled = 1;
stMessagesTx.ExtraDataPtr = &iDataBytes;
lResult = icsneoTxMessagesEx(m_hObject, &stMessagesTx, lNetworkID, 1, &iNumberTxed, 0);
if (iResult == 0)
MessageBox(hWnd,TEXT("Problem Transmitting Messages"),TEXT("neoVI Example"),0);
Dim lResult As Long
Dim stMessagesTx As New icsSpyMessage
Dim lNetworkID As Integer
Dim iNumberTxed As Int32
Dim sSplitString() As String
Dim iDataBytes() As Byte = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}
Dim iCounter As Int32
'//Get pointer to data
Dim gcHandle As System.Runtime.InteropServices.GCHandle = System.Runtime.InteropServices.GCHandle.Alloc(iDataBytes, System.Runtime.InteropServices.GCHandleType.Pinned)
Dim CanFDptr As IntPtr = gcHandle.AddrOfPinnedObject
'//Send on HS CAN
lNetworkID = GetNetworkIDfromString(lstCANFDNetwork.Text)
'//Set the ID
stMessagesTx.ArbIDOrHeader = &h7E0
'// The number of Data Bytes
'//NOTE: CAN FD is limited to lengths of 0,1,2,3,4,5,6,7,8,12,16,20,24,32,48,64
stMessagesTx.NumberBytesData = 64
stMessagesTx.NumberBytesHeader = 0
stMessagesTx.iExtraDataPtr = CanFDptr
stMessagesTx.Protocol = SPY_PROTOCOL_CANFD
'//Use Normal ID
stMessagesTx.StatusBitField = 0
stMessagesTx.StatusBitField2 = 0
stMessagesTx.StatusBitField3 = 16 '//Enable bitrate switch
'// Transmit the assembled message
'//CAN FD More than 8 bytes
'//Enable Extra Data Pointer
stMessagesTx.ExtraDataPtrEnabled = 1
lResult = icsneoTxMessagesEx(m_hObject, stMessagesTx, lNetworkID, 1, iNumberTxed, 0)
If Not CBool(lResult) Then
MsgBox("Problem Transmitting Message")
End If
gcHandle.Free()
//Hardware must have CAN FD support for this tor work.
int lResult;
icsSpyMessage stMessagesTx = new icsSpyMessage();
int lNetworkID;
uint iNumberTxed = 0;
byte[] iDataBytes = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
int iCounter;
//Get pointer to data (could also be done with Unsafe code)
System.Runtime.InteropServices.GCHandle gcHandle = System.Runtime.InteropServices.GCHandle.Alloc(iDataBytes, System.Runtime.InteropServices.GCHandleType.Pinned);
IntPtr CanFDptr = gcHandle.AddrOfPinnedObject();
//Send on HS CAN
string sNetIDToUse = 1;
lNetworkID = icsNeoDll.GetNetworkIDfromString(ref sNetIDToUse);
//Set the ID
stMessagesTx.ArbIDOrHeader = 0x7E0;
// The number of Data Bytes
//NOTE: CAN FD is limited to lengths of 0,1,2,3,4,5,6,7,8,12,16,20,24,32,48,64
stMessagesTx.NumberBytesData = 64;
stMessagesTx.NumberBytesHeader = 0;
stMessagesTx.iExtraDataPtr = CanFDptr;
stMessagesTx.Protocol = Convert.ToByte(CSnet.ePROTOCOL.SPY_PROTOCOL_CANFD);
//Use Normal ID
stMessagesTx.StatusBitField = 0;
stMessagesTx.StatusBitField2 = 0;
stMessagesTx.StatusBitField3 = 16; //Enable bitrate switch
//CAN FD More than 8 bytes
//Enable Extra Data Pointer
stMessagesTx.ExtraDataPtrEnabled = 1;
lResult = icsNeoDll.icsneoTxMessagesEx(m_hObject, ref stMessagesTx, Convert.ToUInt32(lNetworkID), 1, ref iNumberTxed, 0);
// Test the returned result
if (lResult != 1)
{
MessageBox.Show("Problem Transmitting Message");
}
gcHandle.Free();
WIN32 API Overview - neoVI API
Basic Operations
Name
Description
Used to locate connected neoVI and ValueCAN devices.
Used to open a communication link with a specific neoVI or ValueCAN device.
Closes the communication link with the neoVI device.
Message Functions
Name
Description
Device Settings Functions
Name
Description
Error Functions
Name
Description
General Utility Functions
Name
Description
CoreMini Functions
Function
Description
Deprecated Functions
Name
Description
Enables ISO15765 for the selective CAN/CANFD network
Configures an outgoing ISO15765 transaction
Configures the hardware to listen for a ISO15765 transaction
In formation on sending longer frames on ISO9171 and Keyword 2000 networks
Sets device and network parameters for a neoVI Fire 2 device
Gets device and network parameters for a ValueCAN3 device
Sets device and network parameters for a ValueCAN3 device
Gets device and network parameters for a ValueCAN4-1 and ValueCAN4-2 device
Sets device and network parameters for a ValueCAN4-1 and ValueCAN4-2 device
Gets device and network parameters for a ValueCAN RF device
Sets device and network parameters for a ValueCAN RF device
Gets device and network parameters for a RAD Galaxy device
Sets device and network parameters for a RAD Galaxy device
Set the baud or bit rate for a specific neoVI network
Gets the firmware version of a neoVI device
Gets the firmware version stored in the DLL API
Forces the firmware to updated on a neoVI device
Gets individual parameters for a neoVI device
Sets individual parameters for a neoVI device
Sets callback function pointers for flashing a neoVI
Clears callback function pointers for flashing a neoVI
Gets the current real-time clock value from a connect neoVI device
Sets the current real-time clock value in a connected neoVI device
Returns the run status of a function block within a script on a neoVI device
Stops the execution of a function block within a script on a neoVI device
Stops the execution of a function block within a script on a neoVI device
Read an application signal from a script running on a neoVI device
Set the value of an application signal in a script running on a neoVI device
ScriptReadISO15765TxMessage
Read parameters of an ISO15765-2 long transmit message in a script on a neoVI device
ScriptWriteISO15765TxMessage
Change the parameters for an ISO15765-2 long transmit message defined in a script on a neoVI device
Reads parameters for a transmit message defined within a script on a neoVI device
ScriptWriteRxMessage
Alter a receive message defined within script on a neoVI device
ScriptWriteTxMessage
Alter a transmit message defined within a script on a neoVI device
Table 1 lists the possible error messages returned in the GetErrorMessages API call. Some of these errors may also be returned by the GetLastAPIError API call.
Table 1 - Error Messages
NEOVI_ERROR_DLL_TX_BUFFER_OVERFLOW =0
The transmit buffer in the DLL has overflowed. This could occur if the USB connection was lost. It also could occur if you transmit more messages than can be sent on the vehicle networks.
NEOVI_ERROR_DLL_ERROR_BUFFER_OVERFLOW =1
This error occurs when the error queue overflows.
NEOVI_ERROR_DLL_USB_SEND_DATA_ERROR =2
This error occurs when there is a problem sending data on USB.
NEOVI_ERROR_DLL_ISO_DATA_BUFFER_ALLOC =3
Internal Driver Error.
NEOVI_ERROR_DLL_ISO_DATA_READ_BUFFER =4
Internal Driver Error.
NEOVI_ERROR_DLL_ISO_DATA_ZERO_PACKETS =5
Internal Driver Error.
NEOVI_ERROR_DLL_RX_MSG_BUFFER_OVERFLOW =6
This error occurs if the DLL overflows it’s receive message buffer. Solve this error by calling at a faster interval.
NEOVI_ERROR_DLL_STOP_ISO_STREAM =7
Internal Driver Error.
NEOVI_ERROR_DLL_INVALID_NETID =8
Internal Driver Error.
NEOVI_ERROR_DLL_PROBLEM_STOPPING_RX_THREAD =9
Internal Driver Error.
NEOVI_ERROR_DLL_PROBLEM_STOPPING_TX_THREAD =10
Internal Driver Error.
NEOVI_ERROR_DLL_MAIN_PIC_BUFFER_OVERFLOW =11
This error occurs if there is an overflow in the neoVI internal buffer.
NEOVI_ERROR_DLL_INVALID_DEVICE_RESPONSE =12
Internal Driver Error.
NEOVI_ERROR_DLL_ISOTX_DATA_BUFFER_ALLOC =13
Internal Driver Error.
NEOVI_ERROR_DLL_RX_CMD_BUFFER_OVERFLOW=14
Internal Driver Error.
NEOVI_ERROR_DLL_RS232_RX_BUFFER_OVERFLOW=15
RS232 Buffer Overflow Error
NEOVI_ERROR_DLL_RS232_ERR_READCOMERR =16
Internal Driver Error.
NEOVI_ERROR_DLL_RS232_ERR_READ=17
Internal Driver Error.
NEOVI_ERROR_DLL_RS232_BUFFER_ALLOC=18
Internal Driver Error.
NEOVI_ERROR_DLL_RS232_TX_BUFFER_OVERFLOW=19
Internal Driver Error.
NEOVI_ERROR_DLL_RS232_MISC_ERROR=20
Internal Driver Error.
NEOVI_ERROR_DLL_RS232_FIND_WRITE=21
Internal Driver Error.
NEOVI_ERROR_DLL_RS232_FIND_BUFFER_ALLOC=22
Internal Driver Error.
NEOVI_ERROR_DLL_RS232_FIND_CLEARCOMM=23
Internal Driver Error.
NEOVI_ERROR_DLL_RS232_FIND_READCOMM=24
Internal Driver Error.
NEOVI_ERROR_DLL_RS232_FIND_TIMEOUT=25
This error occurs if the neoVI DLL could not find the neoVI device on the specified RS232 port.
NEOVI_ERROR_DLL_RS232_ERR_BREAK=26
RS232 Break Error.
NEOVI_ERROR_DLL_RS232_ERR_FRAME=27
RS232 Framing Error.
NEOVI_ERROR_DLL_RS232_ERR_IOE=28
RS232 IOE Error.
NEOVI_ERROR_DLL_RS232_ERR_OVERRUN=29
RS232 Overrun Error.
NEOVI_ERROR_DLL_RS232_ERR_PARITY=30
RS232 Parity Error.
NEOVI_ERROR_DLL_RS232_TXBUFFER_ALLOC=31
Internal Driver Error.
NEOVI_ERROR_DLL_USB_TX_RS232_ERROR=32
Internal Driver Error.
NEOVI_ERROR_DLL_RS232_CREATE_FILE=33
Problem opening RS232 port. This is probably caused by another application using the port or the port not being valid.
NEOVI_ERROR_DLL_RS232_GET_COMM_STATE=34
Internal Driver Error.
NEOVI_ERROR_DLL_RS232_SET_COMM_STATE=35
Internal Driver Error.
NEOVI_ERROR_DLL_RS232_START_COMM_RX_THREAD=36
Internal Driver Error.
NEOVI_ERROR_DLL_RS232_START_COMM_TX_THREAD=37
Internal Driver Error.
NEOVI_ERROR_DLL_SYNC_COUNT_ERR=38
A message rollover timestamp was missed. This is caused if the neoVI device is disconnected or powered down when in RS232 mode. It will also be caused if two neoVI applications open up the same USB port.
NEOVI_ERROR_DLL_RX_MSG_FRAME_ERR=39
A neoVI message packet was not properly formatted.
NEOVI_ERROR_DLL_RX_MSG_FIFO_OVER=40
The internal DLL FIFO used to store data received before parsing has overflowed.
NEOVI_ERROR_DLL_RX_MSG_CHK_SUM_ERR=41
A neoVI message packet was properly formatted but had an incorrect checksum.
NEOVI_ERROR_DLL_PROBLEM_STOPPING_BULKIN_THREAD=42
Internal Driver Error.
NEOVI_ERROR_DLL_BULKIN_ERR_READ=43
Internal Driver Error.
NEOVI_ERROR_DLL_MAIN51_RX_FIFO_OVERFLOW=44
The Rx FIFO used to store network data before it is sent to the PC has overflowed.
NEOVI_ERROR_DLL_MAIN51_TX_FIFO_OVERFLOW=45
Each network has a FIFO on the Main51 controller for transmission. If you send messages to neoVI faster than neoVI can transmit them, you will receive this error.
NEOVI_ERROR_DLL_MAIN51_DEV_FIFO_OVERFLOW=46
This is a FIFO over error related to messages passed from the Main51 uController to the Main PIC uController
NEOVI_ERROR_DLL_RESET_STATUS_CHANGED=47
The neoVI reset status has changed. This error would occur if the neoVI had a watchdog reset.