# GetConfiguration Method - neoVI API

This method reads the configuration from the hardware device.\
\
\&#xNAN;*Note: This function is only to be used for neoVI Blue and ValueCAN. For neoVI Fire and neoVI Red use the* [GetFireSettings](/neovi-api/win32-api-overview-intrepidcs-api/device-settings-functions-overview-intrepidcs-api/neovi-fire-intrepidcs-api/getfiresettings-method-intrepidcs-api.md) *method. For ValueCAN3 use the* [GetVCAN3Settings](/neovi-api/win32-api-overview-intrepidcs-api/device-settings-functions-overview-intrepidcs-api/valuecan3-intrepidcs-api/getvcan3settings-method-intrepidcs-api.md) *method.*

{% tabs %}
{% tab title="C/C++ Declare" %}

```cpp
int _stdcall icsneoGetConfiguration(int hObject, unsigned char *pData, int *plNumBytes);
```

{% endtab %}

{% tab title="Visual Basic .NET Declare" %}

```vbnet
Public Declare Function icsneoGetConfiguration Lib "icsneo40.dll" (ByVal hObject As Int32, ByRef pData As Byte, ByRef lNumBytes As Int32) As Int32
```

{% endtab %}

{% tab title="C# Declare" %}

```csharp
[DllImport("icsneo40.dll")]
public static extern Int32 icsneoGetConfiguration(Int32 hObject, ref byte pData, ref Int32 lNumBytes);
```

{% endtab %}
{% endtabs %}

**Parameters**

hObject

\[in] Specifies the driver object created with the [OpenNeoDevice](/neovi-api/win32-api-overview-intrepidcs-api/basic-functions-overview-intrepidcs-api/openneodevice-method-intrepidcs-api.md) 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. [GetLastAPIError](/neovi-api/win32-api-overview-intrepidcs-api/error-functions-overview-intrepidcs-api/getlastapierror-method-intrepidcs-api.md) 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**

{% tabs %}
{% tab title="C/C++ Example" %}
**Displays the Value of CNF1 of ValueCAN/neoVI HSCAN**

```cpp
unsigned char bConfigBytes[1024];

int iNumConfigBytes = 1024;

lResult  =  icsneoGetConfiguration(hObject, bConfigBytes, &iNumConfigBytes);
if (lResult == 0)
    MessageBox(hWnd,TEXT("Problem Reading Configuration"),TEXT("neoVI Example"),0);
else
{
    wsprintf(szOut,TEXT("HSCAN CNF1 = %x"),bConfigBytes[NEO_CFG_MPIC_HS_CAN_CNF1]);
    MessageBox(hWnd,szOut,TEXT("neoVI Example"),0);
} 
```

{% endtab %}

{% tab title="C# Example " %}

```csharp
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]);
}
```

{% endtab %}

{% tab title="Visual Basic .NET Example" %}

```vbnet
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]);
} 
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.intrepidcs.com/neovi-api/win32-api-overview-intrepidcs-api/device-settings-functions-overview-intrepidcs-api/getconfiguration-method-intrepidcs-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
