This VB example finds the optimal packet size and modifies the packet size register of the camera accordingly. If the optimal packet size negotiaion failed, the packet size is set to 1500.
ActiveGigE1. Camera = 2
MTU=ActiveGigE1.GetOptimalPacketSize
if MTU=0 then
MTU=1500
endif
ActiveGige1.PacketSize=MTU
Remarks
The optimal packet size is determined using the packet negotiation functionality of GigE Vision cameras. Network packets of different sizes are requested from the camera until the maximum packet size possible for the current configuration is found. If the camera does not support the packet size negotiation, this method will return zero.
The value of the optimal packet size is typically defined by the maximum packet size supported by the network card and camera, whichever is lower. Setting the packet size to the optimal value reduces the CPU load during the video transmission.