SendConfiguration Method - neoVI API
int _stdcall icsneoSendConfiguration(int hObject, unsigned char *pData, int lNumBytes);[DllImport("icsneo40.dll")]
public static extern Int32 icsneoSetFireSettings(Int32 hObject, ref SFireSettings pSettings, Int32 iNumBytes, Int32 bSaveToEEPROM);Public Declare Function icsneoSendConfiguration Lib “icsneo40.dll” (ByVal hObject As Int32, ByRef pData As Byte, ByVal lNumBytes As Int32) As Int32Examples
unsigned char bConfigBytes[1024];
int iNumConfigBytes = 1024;
if(m_bPortOpen)
{
lResult = icsneoGetConfiguration(hObject, bConfigBytes, &iNumConfigBytes);
if (lResult == 0)
MessageBox(hWnd,TEXT("Problem Reading Configuration"),TEXT("neoVI Example"),0);
else
{
iOldCNF1=bConfigBytes[NEO_CFG_MPIC_HS_CAN_CNF1];
iOldCNF2=bConfigBytes[NEO_CFG_MPIC_HS_CAN_CNF2];
iOldCNF3=bConfigBytes[NEO_CFG_MPIC_HS_CAN_CNF3];
// 250 K for Value CAN 500k for neoVI (neoVI and valuecan use different CAN controller rates)
bConfigBytes[NEO_CFG_MPIC_HS_CAN_CNF1] = 0x03;
bConfigBytes[NEO_CFG_MPIC_HS_CAN_CNF2] = 0xB8;
bConfigBytes[NEO_CFG_MPIC_HS_CAN_CNF3] = 0x05;
lResult = icsneoSendConfiguration(hObject, bConfigBytes, iNumConfigBytes);
if (lResult == 0)
MessageBox(hWnd,TEXT("Problem Updating Configuration"),TEXT("neoVI Example"),0);
else
{
wsprintf(szOut,TEXT("Old Values: HSCAN CNF1 = %x HSCAN CNF2 = %x HSCAN CNF3 = %x \n\nNew Values HSCAN CNF1 = %x HSCAN CNF2 = %x HSCAN CNF3 = %x "),
iOldCNF1,
iOldCNF2,
iOldCNF3,
bConfigBytes[NEO_CFG_MPIC_HS_CAN_CNF1],
bConfigBytes[NEO_CFG_MPIC_HS_CAN_CNF2],
bConfigBytes[NEO_CFG_MPIC_HS_CAN_CNF3]);
MessageBox(hWnd,szOut,TEXT("neoVI Example"),0);
}
}
}
else
MessageBox(hWnd,TEXT("Port Not Open"),TEXT("neoVI Example"),0);Last updated