SetFDBitRate Method - intrepidcs API

C/C++ declare - VB.NET declare - C# declare - Parameters - Return Values - Remarks - C/C++ example - VB.NET example - C# example

This method sets bit rates for networks on neoVI devices

C/C++ Declare

int _stdcall icsneoSetFDBitRate(void * hObject, int iBitRate, int iNetworkID);

Visual Basic .NET Declare

Public Declare Function icsneoSetFDBitRate Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByVal BitRate As Int32, ByVal NetworkID As Int32) As Int32

C# Declare

[DllImport(“icsneo40.dll”)] public static extern Int32 icsneoSetFDBitRate(IntPtr hObject, Int32 BitRate, Int32 NetworkID);

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. 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

C/C++ Example:

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");
}

C# Example:

int iResult;

//Set the bit rate
iResult = icsNeoDll.icsneoSetFDBitRate(m_hObject, 5000000, NETID_HSCAN);
if (iResult == 0)
{
    MessageBox.Show("Problem setting bit rate");
}

Visual Basic .NET Example:

Dim iResult As Integer
'//Set the bit rate
iResult = icsneoSetFDBitRate(m_hObject, 5000000, NETID_HSCAN)
If (iResult = 0) Then MsgBox("Problem setting bit rate")