Functions
GigE Camera

APIs only supported by GigE cameras. More...

Functions

MV_CAMCTRL_API int __stdcall MV_CC_GetOptimalPacketSize (IN void *handle)
 Get the optimal packet size. Only support GigE cameras. More...
 
MV_CAMCTRL_API int __stdcall MV_GIGE_SetEnumDevTimeout (IN unsigned int nMilTimeout)
 Set enumeration timeout period (only supports GigE protocols). Range: [1,UINT_MAX). More...
 
MV_CAMCTRL_API int __stdcall MV_GIGE_ForceIpEx (IN void *handle, IN unsigned int nIP, IN unsigned int nSubNetMask, IN unsigned int nDefaultGateWay)
 Force camera network parameter, including IP address, subnet mask, default gateway. More...
 
MV_CAMCTRL_API int __stdcall MV_GIGE_SetIpConfig (IN void *handle, IN unsigned int nType)
 Configure IP mode. More...
 
MV_CAMCTRL_API int __stdcall MV_GIGE_SetNetTransMode (IN void *handle, IN unsigned int nType)
 Set SDK internal priority network mode. More...
 
MV_CAMCTRL_API int __stdcall MV_GIGE_GetNetTransInfo (IN void *handle, IN OUT MV_NETTRANS_INFO *pstInfo)
 Get network transmission information, including received data size, number of lost frames. More...
 
MV_CAMCTRL_API int __stdcall MV_GIGE_SetDiscoveryMode (IN unsigned int nMode)
 Set the ACK mode of enumeration command. More...
 
MV_CAMCTRL_API int __stdcall MV_GIGE_SetGvspTimeout (IN void *handle, IN unsigned int nMillisec)
 Set GVSP streaming timeout. More...
 
MV_CAMCTRL_API int __stdcall MV_GIGE_GetGvspTimeout (IN void *handle, IN OUT unsigned int *pnMillisec)
 Get GVSP streaming timeout. More...
 
MV_CAMCTRL_API int __stdcall MV_GIGE_SetGvcpTimeout (IN void *handle, IN unsigned int nMillisec)
 Set GVCP cammand timeout. More...
 
MV_CAMCTRL_API int __stdcall MV_GIGE_GetGvcpTimeout (IN void *handle, IN OUT unsigned int *pnMillisec)
 Get GVCP cammand timeout. More...
 
MV_CAMCTRL_API int __stdcall MV_GIGE_SetRetryGvcpTimes (IN void *handle, IN unsigned int nRetryGvcpTimes)
 Set the number of times of resending GVCP command. More...
 
MV_CAMCTRL_API int __stdcall MV_GIGE_GetRetryGvcpTimes (IN void *handle, IN OUT unsigned int *pnRetryGvcpTimes)
 Get the number of times of resending GVCP command. More...
 
MV_CAMCTRL_API int __stdcall MV_GIGE_SetResend (IN void *handle, IN unsigned int bEnable, IN unsigned int nMaxResendPercent, IN unsigned int nResendTimeout)
 Set parameters of resending packets. More...
 
MV_CAMCTRL_API int __stdcall MV_GIGE_SetResendMaxRetryTimes (IN void *handle, IN unsigned int nRetryTimes)
 Set the maximum times one packet can be resent. More...
 
MV_CAMCTRL_API int __stdcall MV_GIGE_GetResendMaxRetryTimes (IN void *handle, IN OUT unsigned int *pnRetryTimes)
 Get the maximum times one packet can be resent. More...
 
MV_CAMCTRL_API int __stdcall MV_GIGE_SetResendTimeInterval (IN void *handle, IN unsigned int nMillisec)
 Set the packet resending interval. More...
 
MV_CAMCTRL_API int __stdcall MV_GIGE_GetResendTimeInterval (IN void *handle, IN OUT unsigned int *pnMillisec)
 Get the packet resending interval. More...
 
MV_CAMCTRL_API int __stdcall MV_GIGE_SetTransmissionType (IN void *handle, IN MV_TRANSMISSION_TYPE *pstTransmissionType)
 Set transmission mode. More...
 
MV_CAMCTRL_API int __stdcall MV_GIGE_IssueActionCommand (IN MV_ACTION_CMD_INFO *pstActionCmdInfo, IN OUT MV_ACTION_CMD_RESULT_LIST *pstActionCmdResults)
 Send action command. More...
 
MV_CAMCTRL_API int __stdcall MV_GIGE_GetMulticastStatus (IN MV_CC_DEVICE_INFO *pstDevInfo, IN OUT bool *pbStatus)
 Get the device multicast status. More...
 

Detailed Description

APIs only supported by GigE cameras.

Function Documentation

◆ MV_CC_GetOptimalPacketSize()

MV_CAMCTRL_API int __stdcall MV_CC_GetOptimalPacketSize ( IN void *  handle)

Get the optimal packet size. Only support GigE cameras.

Parameters
handle[IN] Device handle.
Returns
Optimal packetsize
Remarks
The optimized packet size is the size of a packet transported via the network. For GigEVision device it is SCPS, and for USB3Vision device it is the size of packet read from driver each time. The API should be called after MV_CC_OpenDevice() and before MV_CC_StartGrabbing() .
This API should be called after MV_CC_OpenDevice() , and before MV_CC_StartGrabbing().
This API is not supported by CameraLink device or U3V device.
This API is not supported by GenTL device due to unsupported protocols. For GigE Vision cameras added via GenTL, configure GevSCPSPacketSize or configure 1500 as needed.
Examples
ChunkData.cpp, ConnectSpecCamera.cpp, Display.cpp, Events.cpp, Grab_Asynchronous.cpp, GrabImage.cpp, GrabImage_Callback.cpp, GrabImage_HighPerformance.cpp, GrabMultipleCamera.cpp, HighBandwidthDecode.cpp, ImageProcess.cpp, ImageSave.cpp, InterfaceAndDeviceDemo.cpp, MultiCast.cpp, MultiLightCtrl_ImageStitching.cpp, ParametrizeCamera_AreaScanIOSettings.cpp, ParametrizeCamera_LineScanIOSettings.cpp, ReconnectDemo.cpp, Trigger_Image.cpp, and Trigger_ImageCallback.cpp.

◆ MV_GIGE_SetEnumDevTimeout()

MV_CAMCTRL_API int __stdcall MV_GIGE_SetEnumDevTimeout ( IN unsigned int  nMilTimeout)

Set enumeration timeout period (only supports GigE protocols). Range: [1,UINT_MAX).

Parameters
nMilTimeout[IN] Timeout period (ms). It should be an integer and the default value is 100.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
Before calling MV_CC_EnumDevices() to enumerate devices, call this API to set the timeout period for enumerating GigE devices. You can speed up the enumeration by reducing the timeout period.
Only supports entering integer without any sign. This API is only for GigE Vision devices.

◆ MV_GIGE_ForceIpEx()

MV_CAMCTRL_API int __stdcall MV_GIGE_ForceIpEx ( IN void *  handle,
IN unsigned int  nIP,
IN unsigned int  nSubNetMask,
IN unsigned int  nDefaultGateWay 
)

Force camera network parameter, including IP address, subnet mask, default gateway.

Parameters
handle[IN] Device handle.
nIP[IN] IP address.
nSubNetMask[IN] Subnet mask.
nDefaultGateWay[IN] Default gateway.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
After forcing camera network parameters (including IP address, subnet mask, default gateway), you should create the device handle again.
If device is in DHCP status, after calling this API to force camera network parameter, the device will restart.
This function is supported only by GigEVision cameras.
Examples
ForceIP.cpp, and ForceIPEx.cpp.

◆ MV_GIGE_SetIpConfig()

MV_CAMCTRL_API int __stdcall MV_GIGE_SetIpConfig ( IN void *  handle,
IN unsigned int  nType 
)

Configure IP mode.

Parameters
handle[IN] Device handle.
nType[IN] IP type, refer to MV_IP_CFG_x
Macro Definition Value Description
MV_IP_CFG_STATIC 0x05000000 Static mode
MV_IP_CFG_DHCP 0x06000000 DHCP mode
MV_IP_CFG_LLA 0x04000000 LLA (Link-local address)
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
Send command to set the MVC IP configuration mode, such as DHCP, LLA, and so on.
This API is only supported by GigEVision camera.
Examples
ForceIP.cpp, and ForceIPEx.cpp.

◆ MV_GIGE_SetNetTransMode()

MV_CAMCTRL_API int __stdcall MV_GIGE_SetNetTransMode ( IN void *  handle,
IN unsigned int  nType 
)

Set SDK internal priority network mode.

Parameters
handle[IN] Device handle.
nType[IN] Network transmission mode, refer to MV_NET_TRANS_x
Macro Definition Value Description
MV_NET_TRANS_DRIVER 0x00000001 Driver mode
MV_NET_TRANS_SOCKET 0x00000002 Socket mode
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
The internal priority network mode is driver mode by default, and supported only by GigE Vision camera.

◆ MV_GIGE_GetNetTransInfo()

MV_CAMCTRL_API int __stdcall MV_GIGE_GetNetTransInfo ( IN void *  handle,
IN OUT MV_NETTRANS_INFO pstInfo 
)

Get network transmission information, including received data size, number of lost frames.

Parameters
handle[IN] Device handle.
pstInfo[IN][OUT] Network transmission information.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
Call this API after starting image acquisition through MV_CC_StartGrabbing() .
This API is supported only by GigEVision Camera.

◆ MV_GIGE_SetDiscoveryMode()

MV_CAMCTRL_API int __stdcall MV_GIGE_SetDiscoveryMode ( IN unsigned int  nMode)

Set the ACK mode of enumeration command.

Parameters
nMode[IN] ACK mode: 0-unicast, 1-broadcast (default).
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
This API is only effective on GigE cameras.

◆ MV_GIGE_SetGvspTimeout()

MV_CAMCTRL_API int __stdcall MV_GIGE_SetGvspTimeout ( IN void *  handle,
IN unsigned int  nMillisec 
)

Set GVSP streaming timeout.

Parameters
handle[IN] Device handle.
nMillisec[IN] Timeout period, which is 300 by default, and the minimum value is 10, unit: millisecond.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
After connecting the device and before starting streaming, call this API to set GVSP streaming timeout value. If the timeout period is too short, image exception might occur; if the timeout period is too long, streaming time will become longer.

◆ MV_GIGE_GetGvspTimeout()

MV_CAMCTRL_API int __stdcall MV_GIGE_GetGvspTimeout ( IN void *  handle,
IN OUT unsigned int *  pnMillisec 
)

Get GVSP streaming timeout.

Parameters
handle[IN] Device handle.
pnMillisec[IN][OUT] Timeout period, unit: millisecond.
Returns
Return MV_OK for success, and return corresponding error code for failure.

◆ MV_GIGE_SetGvcpTimeout()

MV_CAMCTRL_API int __stdcall MV_GIGE_SetGvcpTimeout ( IN void *  handle,
IN unsigned int  nMillisec 
)

Set GVCP cammand timeout.

Parameters
handle[IN] Device handle.
nMillisec[IN] Timeout, default 500ms, range: 0 to 10000ms.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
After the device is connected, call this API to set GVCP command timeout.

◆ MV_GIGE_GetGvcpTimeout()

MV_CAMCTRL_API int __stdcall MV_GIGE_GetGvcpTimeout ( IN void *  handle,
IN OUT unsigned int *  pnMillisec 
)

Get GVCP cammand timeout.

Parameters
handle[IN] Device handle.
pnMillisec[IN][OUT] Timeout, unit: ms.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
This API is used to get the current GVCP timeout.

◆ MV_GIGE_SetRetryGvcpTimes()

MV_CAMCTRL_API int __stdcall MV_GIGE_SetRetryGvcpTimes ( IN void *  handle,
IN unsigned int  nRetryGvcpTimes 
)

Set the number of times of resending GVCP command.

Parameters
handle[IN] Device handle.
nRetryGvcpTimes[IN] The number of times for retrying, range:0 to 100.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
This API is used to increase the times of retransmission when GVCP packet transmission is abnormal, and to some extents it can avoid camera offline.

◆ MV_GIGE_GetRetryGvcpTimes()

MV_CAMCTRL_API int __stdcall MV_GIGE_GetRetryGvcpTimes ( IN void *  handle,
IN OUT unsigned int *  pnRetryGvcpTimes 
)

Get the number of times of resending GVCP command.

Parameters
handle[IN] Device handle.
pnRetryGvcpTimes[IN][OUT] The number of times for resending.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
This API is used to get the number of GVCP retransmissions. The default number is 3.

◆ MV_GIGE_SetResend()

MV_CAMCTRL_API int __stdcall MV_GIGE_SetResend ( IN void *  handle,
IN unsigned int  bEnable,
IN unsigned int  nMaxResendPercent,
IN unsigned int  nResendTimeout 
)

Set parameters of resending packets.

Parameters
handle[IN] Device handle.
bEnable[IN] Enable resending packet or not: 0-disable, 1-enable.
nMaxResendPercent[IN] Maximum packet resending percentage, range: [0,100].
nResendTimeout[IN] Packet resending timeout, unit: ms.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
After the device is connected, call this API to set resend packet properties. It is supported only by GigEVision camera.

◆ MV_GIGE_SetResendMaxRetryTimes()

MV_CAMCTRL_API int __stdcall MV_GIGE_SetResendMaxRetryTimes ( IN void *  handle,
IN unsigned int  nRetryTimes 
)

Set the maximum times one packet can be resent.

Parameters
handle[IN] Device handle.
nRetryTimes[IN] The maximum times one packet can be resent, which is 20 by default, and the minimum value is 0.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
You should call this API after enabling the function of resending packets by calling MV_GIGE_SetResend() .
Otherwise the calling will fail and return MV_E_CALLORDER.

◆ MV_GIGE_GetResendMaxRetryTimes()

MV_CAMCTRL_API int __stdcall MV_GIGE_GetResendMaxRetryTimes ( IN void *  handle,
IN OUT unsigned int *  pnRetryTimes 
)

Get the maximum times one packet can be resent.

Parameters
handle[IN] Device handle.
pnRetryTimes[IN][OUT] The maximum times one packet can be resent.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
You should call this API after enabling the function of resending packets by calling MV_GIGE_SetResend() .
Otherwise the calling will fail and return MV_E_CALLORDER.

◆ MV_GIGE_SetResendTimeInterval()

MV_CAMCTRL_API int __stdcall MV_GIGE_SetResendTimeInterval ( IN void *  handle,
IN unsigned int  nMillisec 
)

Set the packet resending interval.

Parameters
handle[IN] Device handle.
nMillisec[IN] Packet resending interval, which is 10 by default, unit: millisecond.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
You should call this API after enabling the function of resending packets by calling MV_GIGE_SetResend() .
Otherwise the calling will fail and return MV_E_CALLORDER.

◆ MV_GIGE_GetResendTimeInterval()

MV_CAMCTRL_API int __stdcall MV_GIGE_GetResendTimeInterval ( IN void *  handle,
IN OUT unsigned int *  pnMillisec 
)

Get the packet resending interval.

Parameters
handle[IN] Device handle.
pnMillisec[IN][OUT] Packet resending interval, unit: millisecond.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
You should call this API after enabling the function of resending packets by calling MV_GIGE_SetResend() .
Otherwise the calling will fail and return MV_E_CALLORDER.

◆ MV_GIGE_SetTransmissionType()

MV_CAMCTRL_API int __stdcall MV_GIGE_SetTransmissionType ( IN void *  handle,
IN MV_TRANSMISSION_TYPE pstTransmissionType 
)

Set transmission mode.

Parameters
handle[IN] Device handle.
pstTransmissionType[IN] Transmission mode.
Macro Definition Value Description
MV_GIGE_TRANSTYPE_UNICAST 0 Unicast
MV_GIGE_TRANSTYPE_MULTICAST 1 Multicast
MV_GIGE_TRANSTYPE_LIMITEDBROADCAST 2 LAN broadcast
MV_GIGE_TRANSTYPE_SUBNETBROADCAST 3 Subnet broadcast
MV_GIGE_TRANSTYPE_CAMERADEFINED 4 Get from camera
MV_GIGE_TRANSTYPE_UNICAST_DEFINED_PORT 5 Port No. of getting image data
MV_GIGE_TRANSTYPE_UNICAST_WITHOUT_RECV 00010000 Unicast mode, but not receive image data
MV_GIGE_TRANSTYPE_MULTICAST_WITHOUT_RECV 00010001 Multiple mode, but not receive image data
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
Call this API to set the transmission mode as single cast mode and multicast mode. And this API is supported only by GigEVision camera.
Examples
MultiCast.cpp.

◆ MV_GIGE_IssueActionCommand()

MV_CAMCTRL_API int __stdcall MV_GIGE_IssueActionCommand ( IN MV_ACTION_CMD_INFO pstActionCmdInfo,
IN OUT MV_ACTION_CMD_RESULT_LIST pstActionCmdResults 
)

Send action command.

Parameters
pstActionCmdInfo[IN] Command information.
pstActionCmdResults[IN][OUT] Returned information list.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
This API is supported only by GigE Vision camera.

◆ MV_GIGE_GetMulticastStatus()

MV_CAMCTRL_API int __stdcall MV_GIGE_GetMulticastStatus ( IN MV_CC_DEVICE_INFO pstDevInfo,
IN OUT bool *  pbStatus 
)

Get the device multicast status.

Parameters
pstDevInfo[IN] Device information structure.
pbStatus[IN][OUT] Status: "true" (in multicast), "false" (not in multicast).
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
When enumerating the device, you can call this API to check if the device is in multicast status without opening the device.