GetCameraIPList
Top  Previous  Next

Description

Returns the array of strings containing the IP addresses of connected GigE Vision™ devices in Internet standard dotted format.


Syntax


[VB]
Value=objActiveGige.GetCameraIPList()


[C/C++]
HRESULT GetCameraIPList( VARIANT* pList );


Data Types
[VB]

Return value: Variant (Array of strings)


Parameters
[C/C++]

pList [out,retval]  
Pointer to the SAFEARRAY containing IP addresses  


Return Values


S_OK  
Success  
E_FAIL  
Failure.  


Example


This VB example initializes a combo box with IP addresses and uses it to switch between the cameras:

Private Sub
 Form_Load()
CamIPLst = ActiveGige1.GetCameraIPList
For
 i = 0 
To
 UBound(CamIPLst)
Combo1.AddItem (CamIPLst(i))
Next
Combo1.ListIndex = 0
ActiveGige1.Acquire = 
True
End Sub

Private Sub
 Combo1_Click()
ActiveGige1.Camera = Combo1.ListIndex
End Sub
 
This MFC example fills out a combo box with IP addresses:

VARIANT m_CamArray=m_ActiveGige.GetCameraIPList();
SAFEARRAY *pArray=m_CamArray.parray;
UINT nCam=pArray->rgsabound[0].cElements;

CString strCamera;
CComboBox *pCamera=(CComboBox*)GetDlgItem(IDC_CAMERA);
for(UINT i=0;i<nCam;i++)
{
      CString str; str.Format("Camera %d",i);
      pCamera->AddString(str);
}
int iCam=m_ActiveGige.GetCamera();
pCamera->SetCurSel(iCam);


SafeArrayDestroy(pArray);



Remarks


The IP addresses are returned in the Internet standard dotted format such as 169.254.102.77

The index of an element in the IP list can be used as an argument of the Camera property to select a specific device.

Note that in C/C++ applications it is required to call SafeArrayDestroy() to delete the SAFEARRAY returned by GetCameraIPList.