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... | |
![]() | |
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... | |
PvGenParameterArray * | GetParameters () |
Get the parameters used to control the GigE Vision or USB3 Vision device to which you are connected. More... | |
PvGenParameterArray * | GetCommunicationParameters () |
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 PvDevice * | CreateAndConnect (const PvDeviceInfo *aDeviceInfo, PvResult *aResult) |
Dynamically allocates a PvDevice of the right type. More... | |
static PvDevice * | CreateAndConnect (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 | |
![]() | |
PvDevice () | |
Constructor. | |
Connect, configure and control a GigE Vision device.
To connect and configure a GigE Vision device to begin transmitting data:
For a complete example that illustrates the steps above, refer to the following samples:
The SDK can let you automatically recover from problems such as accidental disconnects, power interrupts, and so on. To learn more, see PvDeviceEventSink.
|
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.
[in] | aDeviceInfo | The GigE Vision device's network connectivity information; a PvDeviceInfo object. |
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.
[in] | aDeviceInfo | The GigE Vision device's network connectivity information; a PvDeviceInfo object. |
[in] | aAccessType | The GigE Vision device's availability for connections by multiple controllers. See PvAccessType. |
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.
[in] | aInfo | Information that uniquely identifies the GigE Vision device. You may use one of the following:
|
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.
[in] | aInfo | Information that uniquely identifies the GigE Vision device. You may use one of the following:
|
[in] | aAccessType | The access control privilege to set at the time of connection. See PvAccessType. |
PvAccessType PvDeviceGEV::GetAccessType | ( | ) | const |
Returns the access type of the connected device.
If no device is connected, PvAccessUnknown is returned.
|
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.
[in] | aDeviceIPAddress | The IP address of the GigE Vision device. |
[out] | aAccessType | The access type of the GigE Vision device on success. PvAccessUnknown on failure. |
PvDeviceClass PvDeviceGEV::GetClass | ( | ) | const |
Returns the GigE Vision device class of the connected device.
If no device is connected, PvDeviceClassTransmitter is returned.
PvString PvDeviceGEV::GetIPAddress | ( | ) | const |
Returns the IP address of the connected device.
If no device is connected, an empty string is returned.
PvString PvDeviceGEV::GetMACAddress | ( | ) | const |
Returns the MAC address of the connected device.
If no device is connnected, an emptyu string is returned.
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.
[in] | aChannel | The streaming channel. Use 0 for most GigE Vision devices only supporting a single streaming channel. |
[in] | aDefaultPacketSize | The 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. |
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.
[in] | aAddress | The GigE Vision device's register address (mod 4). |
[out] | aValue | The value read from the GigE Vision device's register. |
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).
[in] | aChannel | See the aChannel parameter for the SetStreamDestination method. |
|
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.
[in] | aMACAddress | The GigE Vision device's MAC address. |
[in] | aIP | The GigE Vision device's new IP address. |
[in] | aSubnetMask | The GigE Vision device's new subnet mask. |
[in] | aGateway | The GigE Vision device's new gateway. |
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.
[in] | aPacketSize | The packet size to use for aChannel. |
[in] | aChannel | The streaming channel. Use 0 for most GigE Vision devices only supporting a single streaming channel. |
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.
[in] | aIPAddress | The receiving PC's IP address (GenICam feature name: GevSCDA) or a multicast IP address. |
[in] | aDataPort | The receiving PC's data port (feature name: GevSCPHostPort) or the multicast port. |
[in] | aChannel | The GigE Vision stream channel; the channel over which the GigE Vision device transmits images. Use 0 for device having supporting a single streaming channel. |
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.
[in] | aAddress | The GigE Vision device's register address (mod 4). |
[in] | aValue | The value to be written to the register. |
[in] | aAcknowledge | When 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. |
Copyright (c) 2002-2021 Pleora Technologies Inc.
www.pleora.com