Pleora Technologies Inc. eBUS SDK v6.2.8.5877 API



PvDeviceGEV Class Reference

Connect, configure and control a GigE Vision device. More...

Public Member Functions

 PvDeviceGEV ()
 Constructor.
 
virtual ~PvDeviceGEV ()
 Destructor.
 
PvResult Connect (const PvDeviceInfo *aDeviceInfo)
 Connect to a GigE Vision device. More...
 
PvResult Connect (const PvDeviceInfo *aDeviceInfo, PvAccessType aAccessType)
 Connect to a GigE Vision device (found with PvSystem, PvInterface, PvDeviceInfo). More...
 
PvResult Connect (const PvString &aInfo)
 Connect to a GigE Vision device with the default access control mode. More...
 
PvResult Connect (const PvString &aInfo, PvAccessType aAccessType)
 Connect to a GigE Vision device. More...
 
PvResult SetStreamDestination (const PvString &aIPAddress, uint16_t aDataPort, uint32_t aChannel=0)
 Set the UDP/IP destination to which the GigE Vision device transmits data. More...
 
PvResult ResetStreamDestination (uint32_t aChannel=0)
 Resets the UDP/IP streaming destination of the GigE Vision device. More...
 
PvResult SetPacketSize (uint32_t aPacketSize, uint32_t aChannel=0)
 Sets the packet size for a streaming channel. More...
 
PvResult NegotiatePacketSize (uint32_t aChannel=0, uint32_t aDefaultPacketSize=0)
 Automatically finds and sets the optimal packet size. More...
 
PvResult ReadRegister (int64_t aAddress, uint32_t &aValue)
 Read a 32-bit value from a specific register address on the GigE Vision device. More...
 
PvResult WriteRegister (int64_t aAddress, uint32_t aValue, bool aAcknowledge=true)
 Write a 32-bit value to a specific register address on the GigE Vision device. More...
 
PvAccessType GetAccessType () const
 Returns the access type of the connected device. More...
 
PvDeviceClass GetClass () const
 Returns the GigE Vision device class of the connected device. More...
 
PvString GetIPAddress () const
 Returns the IP address of the connected device. More...
 
PvString GetMACAddress () const
 Returns the MAC address of the connected device. More...
 
- Public Member Functions inherited from PvDevice
virtual ~PvDevice ()
 Destructor.
 
PvDeviceType GetType () const
 Returns the type of the instantiated device. More...
 
PvResult Disconnect ()
 Disconnect the PvDevice object from the GigE Vision or USB3 Vision device to which it is currently connected. More...
 
PvResult StreamEnable (uint32_t aChannel=0)
 Enables streaming on the device. More...
 
PvResult StreamDisable (uint32_t aChannel=0)
 Disables streaming on the device. More...
 
bool IsConnected () const
 Test if this PvDevice is currently connected to a GigE Vision or USB3 Vision device. More...
 
bool IsPleoraPowered () const
 Test if this PvDevice is currently connected to a Pleora powered GigE Vision or USB3 Vision device. More...
 
PvResult DumpGenICamXML (const PvString &aFilename)
 Save the GigE Vision or USB3 Visio device's GenICam XML file to disk. More...
 
PvResult GetDefaultGenICamXMLFilename (PvString &aFilename)
 Returns a good default filename to use with DumpGenICamXML. More...
 
PvGenParameterArrayGetParameters ()
 Get the parameters used to control the GigE Vision or USB3 Vision device to which you are connected. More...
 
PvGenParameterArrayGetCommunicationParameters ()
 Get the parameters used to define how PvDevice connects to and communicates with the device. More...
 
PvResult ReadMemory (int64_t aAddress, unsigned char *aDestination, int64_t aByteCount)
 Reads bytes starting at a specific register address on the GigE Vision or USB3 Vision device. More...
 
PvResult WriteMemory (int64_t aAddress, const unsigned char *aSource, int64_t aByteCount)
 Writes bytes starting at a specific register address on the GigE Vision or USB3 Vision device. More...
 
PvResult WaitForMessagingChannelIdle (uint32_t aTimeout)
 Waits for the messaging channel to become idle. More...
 
PvResult RegisterEventSink (PvDeviceEventSink *aEventSink)
 Register an event sink used for callbacks. More...
 
PvResult UnregisterEventSink (PvDeviceEventSink *aEventSink)
 Unregister an event sink. More...
 
uint32_t GetHeartbeatThreadPriority () const
 Get the priority of the heartbeat thread. More...
 
PvResult SetHeartbeatThreadPriority (uint32_t aPriority)
 Set the priority of the heartbeat thread. More...
 
uint32_t GetInterruptLinkThreadPriority () const
 Get the priority of the interrupt link thread. More...
 
PvResult SetInterruptLinkThreadPriority (uint32_t aPriority)
 Set the priority of the interrupt link thread. More...
 
uint32_t GetInterruptQueueThreadPriority () const
 Get the priority of the interrupt queue thread. More...
 
PvResult SetInterruptQueueThreadPriority (uint32_t aPriority)
 Set the priority of the interrupt queue thread. More...
 
uint32_t GetPayloadSize ()
 Returns the payload size the device is currently configured to stream with. More...
 
PvResult GetUniqueID (PvString &aID)
 Returns a unique string identifier for the device. More...
 

Static Public Member Functions

static PvResult GetAccessType (const PvString &aDeviceIPAddress, PvAccessType &aAccessType)
 Returns the current access type of a device identified by its IP address. More...
 
static PvResult SetIPConfiguration (const PvString &aMACAddress, const PvString &aIP, const PvString &aSubnetMask=PvString("255.255.255.0"), const PvString &aGateway=PvString("0.0.0.0"))
 Sets the GigE Vision device's IP address. More...
 
- Static Public Member Functions inherited from PvDevice
static PvDeviceCreateAndConnect (const PvDeviceInfo *aDeviceInfo, PvResult *aResult)
 Dynamically allocates a PvDevice of the right type. More...
 
static PvDeviceCreateAndConnect (const PvString &aInfo, PvResult *aResult)
 Dynamically allocates a PvDevice of the right type. More...
 
static void Free (PvDevice *aDevice)
 Frees an object allocated with CreateAndConnect. More...
 

Additional Inherited Members

- Protected Member Functions inherited from PvDevice
 PvDevice ()
 Constructor.
 

Detailed Description

Connect, configure and control a GigE Vision device.

To connect and configure a GigE Vision device to begin transmitting data:

  1. Select the GigE Vision device to which you want to connect. See PvSystem, PvInterface, PvDeviceInfo.
  2. Connect to a GigE Vision device. Use Connect.
  3. Get the GigE Vision device's GenICam interface. Use GetParameters.
  4. Configure the device through the GenICam interface. See PvGenParameterArray.
  5. Configure the receiver and take note of its IP address and port.
  6. Configure your PvDevice's streaming destination using PvDeviceGEV::SetStreamDestination.
  7. Lock the interface for streaming. Set TLParamsLocked feature of the GigE Vision device's GenICam interface to 1.
  8. Configure the GigE Vision device to send images. Use AcquisitionStart feature of the GigE Vision device's GenICam interface.
  9. Release the interface for streaming. Set TLParamsLocked feature of the GigE Vision device's GenICam interface to 0.
  10. Configure the GigE Vision device to stop sending images. Use AcquisitionStop feature of the GigE Vision device's GenICam interface.

For a complete example that illustrates the steps above, refer to the following samples:

  • MulticastMaster - Configure a GigE Vision device to transmit
  • PvPipelineSample - Configure a GigE Vision device to transmit and receive the data it transmits in the same application

Recovery

The SDK can let you automatically recover from problems such as accidental disconnects, power interrupts, and so on. To learn more, see PvDeviceEventSink.

Member Function Documentation

PvResult PvDeviceGEV::Connect ( const PvDeviceInfo aDeviceInfo)
virtual

Connect to a GigE Vision device.

The Connect method connects to a GigE Vision device found using a PvSystem or device finder dialog object. Only one device can be connected to at a time.

Parameters
[in]aDeviceInfoThe GigE Vision device's network connectivity information; a PvDeviceInfo object.
Returns
Includes:

Reimplemented from PvDevice.

PvResult PvDeviceGEV::Connect ( const PvDeviceInfo aDeviceInfo,
PvAccessType  aAccessType 
)

Connect to a GigE Vision device (found with PvSystem, PvInterface, PvDeviceInfo).

The Connect method connects to a GigE Vision device found using a PvSystem or device finder dialog object. Only one device can be connected to at a time.

Parameters
[in]aDeviceInfoThe GigE Vision device's network connectivity information; a PvDeviceInfo object.
[in]aAccessTypeThe GigE Vision device's availability for connections by multiple controllers. See PvAccessType.
Returns
Includes:
PvResult PvDeviceGEV::Connect ( const PvString aInfo)
virtual

Connect to a GigE Vision device with the default access control mode.

If you know the GigE Vision device's IP address, MAC address or DeviceUserID, you can use this method to connect to it.

  1. If aInfo contains an IP address, the connection attempt is direct.
  2. If aInfo contains a MAC address or DeviceUserID:
    • An internal PvSystem is used to find all reachable GigE Vision devices
    • Found devices are browsed, looking for a match on either MAC address or DeviceUserID
    • If the device is found, connection is attempted.
Parameters
[in]aInfoInformation that uniquely identifies the GigE Vision device. You may use one of the following:
  • GigE Vision device's MAC address. Use the form 00:11:22:33:44:5F.
  • GigE Vision device's IP Address. Use the form 192.168.1.114.
  • GigE Vision device's DeviceUserID.
Returns
Includes:

Reimplemented from PvDevice.

PvResult PvDeviceGEV::Connect ( const PvString aInfo,
PvAccessType  aAccessType 
)

Connect to a GigE Vision device.

If you know the GigE Vision device's IP address, MAC address or DeviceUserID, you can use this method to connect to it.

  1. If aInfo contains an IP address, the connection attempt is direct.
  2. If aInfo contains a MAC address or DeviceUserID:
    • An internal PvSystem is used to find all reachable GigE Vision devices
    • Found devices are browsed, looking for a match on either MAC address or DeviceUserID
    • If the device is found, connection is attempted.
Parameters
[in]aInfoInformation that uniquely identifies the GigE Vision device. You may use one of the following:
  • GigE Vision device's MAC address. Use the form 00:11:22:33:44:5F.
  • GigE Vision device's IP Address. Use the form 192.168.1.114.
  • GigE Vision device's DeviceUserID.
[in]aAccessTypeThe access control privilege to set at the time of connection. See PvAccessType.
Returns
Includes:
PvAccessType PvDeviceGEV::GetAccessType ( ) const

Returns the access type of the connected device.

If no device is connected, PvAccessUnknown is returned.

Returns
Access type of the device was connected with.
PvResult PvDeviceGEV::GetAccessType ( const PvString aDeviceIPAddress,
PvAccessType aAccessType 
)
static

Returns the current access type of a device identified by its IP address.

This function is static. It does not work on an specific object but will return the access type of a GigE Vision device identified by its IP address.

Parameters
[in]aDeviceIPAddressThe IP address of the GigE Vision device.
[out]aAccessTypeThe access type of the GigE Vision device on success. PvAccessUnknown on failure.
Returns
Includes:
PvDeviceClass PvDeviceGEV::GetClass ( ) const

Returns the GigE Vision device class of the connected device.

If no device is connected, PvDeviceClassTransmitter is returned.

Returns
Device class of the device was connected with.
PvString PvDeviceGEV::GetIPAddress ( ) const

Returns the IP address of the connected device.

If no device is connected, an empty string is returned.

Returns
IP address of the device.
PvString PvDeviceGEV::GetMACAddress ( ) const

Returns the MAC address of the connected device.

If no device is connnected, an emptyu string is returned.

Returns
MAC address of the device.
PvResult PvDeviceGEV::NegotiatePacketSize ( uint32_t  aChannel = 0,
uint32_t  aDefaultPacketSize = 0 
)

Automatically finds and sets the optimal packet size.

The NegotiatePacketSize method tests the network connection for the largest as possible packet size that the network can support between the GigE Vision transmitter and the controlling PC.

Calling this method resets the streaming destination for aChannel. You should always call this method AFTER connecting, BEFORE setting the GigE Vision streaming destination using SetStreamDestination.

The highest possible packet size from { MTU (if below 9000), 9000, 8000, 4000, 2000, 1500, 1000, 600 } is used. These values are used as raw seeds and are adjusted by removing 24 bytes for the Ethernet layer and then rounded down to meet the increment requirement imposed by the GevSCPSPacketSize parameter.

Parameters
[in]aChannelThe streaming channel. Use 0 for most GigE Vision devices only supporting a single streaming channel.
[in]aDefaultPacketSizeThe packet size to use, in bytes, should the negotiation fail. Use 1476 for a safe packet size; 0 to continue using the GigE Vision device's original setting in case of failure.
Returns
Includes:
PvResult PvDeviceGEV::ReadRegister ( int64_t  aAddress,
uint32_t &  aValue 
)

Read a 32-bit value from a specific register address on the GigE Vision device.

aValue is returned in the platform's expected Endianess. GigE Vision single register operations are always performed as Big Endian and on Intel platforms are corrected to/from Little Endian.

Parameters
[in]aAddressThe GigE Vision device's register address (mod 4).
[out]aValueThe value read from the GigE Vision device's register.
Returns
See WriteMemory.
PvResult PvDeviceGEV::ResetStreamDestination ( uint32_t  aChannel = 0)

Resets the UDP/IP streaming destination of the GigE Vision device.

This method is equivalent to calling SetStreamDestination with values ("0.0.0.0", 0, aChannel).

Parameters
[in]aChannelSee the aChannel parameter for the SetStreamDestination method.
Returns
Includes:
PvResult PvDeviceGEV::SetIPConfiguration ( const PvString aMACAddress,
const PvString aIP,
const PvString aSubnetMask = PvString( "255.255.255.0" ),
const PvString aGateway = PvString( "0.0.0.0" ) 
)
static

Sets the GigE Vision device's IP address.

This static method lets you configure the GigE Vision device's IP address. You cannot change the IP address when a PvDevice is connected.

Can be used to assign a valid IP configuration to a device before connecting a PvDevice to a GigE Vision device (using the Connect method). The GigE Vision device to be configured is identified using its MAC address.

Parameters
[in]aMACAddressThe GigE Vision device's MAC address.
[in]aIPThe GigE Vision device's new IP address.
[in]aSubnetMaskThe GigE Vision device's new subnet mask.
[in]aGatewayThe GigE Vision device's new gateway.
Returns
Includes:
PvResult PvDeviceGEV::SetPacketSize ( uint32_t  aPacketSize,
uint32_t  aChannel = 0 
)

Sets the packet size for a streaming channel.

Applies a specific packet size to a streaming channel. Unlike the NegotiatePacketSize method, it does not attempt to find the best packet size, it just uses the one provided as a parameter.

Parameters
[in]aPacketSizeThe packet size to use for aChannel.
[in]aChannelThe streaming channel. Use 0 for most GigE Vision devices only supporting a single streaming channel.
Returns
Includes:
PvResult PvDeviceGEV::SetStreamDestination ( const PvString aIPAddress,
uint16_t  aDataPort,
uint32_t  aChannel = 0 
)

Set the UDP/IP destination to which the GigE Vision device transmits data.

The destination constists of an IP address (unicast or multicast) and a port number.

Parameters
[in]aIPAddressThe receiving PC's IP address (GenICam feature name: GevSCDA) or a multicast IP address.
[in]aDataPortThe receiving PC's data port (feature name: GevSCPHostPort) or the multicast port.
[in]aChannelThe GigE Vision stream channel; the channel over which the GigE Vision device transmits images. Use 0 for device having supporting a single streaming channel.
Returns
Includes:
PvResult PvDeviceGEV::WriteRegister ( int64_t  aAddress,
uint32_t  aValue,
bool  aAcknowledge = true 
)

Write a 32-bit value to a specific register address on the GigE Vision device.

See warnings about accessing the register map directly in WriteMemory.

aValue is provided in the platform's expected Endianess. GigE Vision single register operations are always performed as Big Endian and on Intel platforms are corrected to/from Little Endian.

Parameters
[in]aAddressThe GigE Vision device's register address (mod 4).
[in]aValueThe value to be written to the register.
[in]aAcknowledgeWhen sending the command, sets the acknowledge requested bit and waits for that acknowledge. If set to false, the acknowledge is not requested and the method returns as soon as the command has been pushed in the UDP socket. If not specified true is assumed.
Returns
See WriteMemory.

The documentation for this class was generated from the following files:

Copyright (c) 2002-2021 Pleora Technologies Inc.
www.pleora.com