Class PvDevice
Connect, configure and control a GigE Vision or USB3 Vision device.
Implements
Inherited Members
Namespace: eBUSDotNetReceive
Assembly: eBUSDotNetReceive.dll
Syntax
public class PvDevice : IDisposable
Fields
View SourceswigCMemOwn
Determines who is responsible for deleting the underlying C++ object.
Declaration
protected bool swigCMemOwn
Field Value
| Type | Description |
|---|---|
| bool |
Properties
View SourceCommunicationParameters
Gets the parameters used to define how PvDevice connects to and communicates with the device.
Declaration
public PvGenParameterArray CommunicationParameters { get; }
Property Value
| Type | Description |
|---|---|
| PvGenParameterArray |
Connected
Gets whether this PvDevice is currently connected to a GigE Vision or USB3 Vision device.
Declaration
public bool Connected { get; }
Property Value
| Type | Description |
|---|---|
| bool |
HeartbeatThreadPriority
Gets or sets the priority of the heartbeat thread.
Declaration
public uint HeartbeatThreadPriority { get; set; }
Property Value
| Type | Description |
|---|---|
| uint |
InterruptLinkThreadPriority
Gets or sets the priority of the interrupt link thread.
Declaration
public uint InterruptLinkThreadPriority { get; set; }
Property Value
| Type | Description |
|---|---|
| uint |
InterruptQueueThreadPriority
Gets or sets the priority of the interrupt queue thread.
Declaration
public uint InterruptQueueThreadPriority { get; set; }
Property Value
| Type | Description |
|---|---|
| uint |
Parameters
Gets the parameters used to control the GigE Vision or USB3 Vision device to which you are connected.
Declaration
public PvGenParameterArray Parameters { get; }
Property Value
| Type | Description |
|---|---|
| PvGenParameterArray |
PayloadSize
Gets the payload size the device is currently configured to stream with.
Declaration
public uint PayloadSize { get; }
Property Value
| Type | Description |
|---|---|
| uint |
PleoraPowered
Gets whether this PvDevice is currently connected to a Pleora powered GigE Vision or USB3 Vision device.
Declaration
public bool PleoraPowered { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Type
Gets the type of the instantiated device.
Declaration
public PvDeviceType Type { get; }
Property Value
| Type | Description |
|---|---|
| PvDeviceType |
Methods
View SourceConnect(PvDeviceInfo)
Connect to a GigE Vision or USB3 Vision device.
Declaration
public virtual PvResult Connect(PvDeviceInfo aDeviceInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| PvDeviceInfo | aDeviceInfo | The GigE Vision device's network connectivity information; a #PvDeviceInfo object. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
Connect(string)
Connect to a GigE Vision or USB3 Vision device.
Declaration
public virtual PvResult Connect(string aInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aInfo | Information that uniquely identifies the 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 or USB3 Vision device's DeviceUserID. - USB3 Vision GUID. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
CreateAndConnect(PvDeviceInfo, ref PvResult)
Dynamically allocates a PvDevice of the right type.
Declaration
public static PvDevice CreateAndConnect(PvDeviceInfo aDeviceInfo, ref PvResult aResult)
Parameters
| Type | Name | Description |
|---|---|---|
| PvDeviceInfo | aDeviceInfo | Pointer to the device information used to connect the device. |
| PvResult | aResult | Outcome of the operation: - #PvResult::Code::OK - #PvResult::Code::INVALID_PARAMETER (if NULL aDeviceInfo, or bad parameter passed) - #PvResult::Code::NOT_CONNECTED (if device was found, initially connected but disconnect during the connection process) - #PvResult::Code::GENERIC_ERROR (if an unexpected exception was thrown or if socket cannot bind or connect[GEV] or usb driver is busy [U3V]) - #PvResult::Code::NETWORK_ERROR (if sending packets failed, GEV) - #PvResult::Code::TIMEOUT (if socket binds and sends but times out on receive, GEV) - #PvResult::Code::THREAD_ERROR (if heartbeat thread will not start) - #PvResult::Code::GENICAM_XML_ERROR (if creating device genicam node map failed with xml error) - #PvResult::Code::NOT_FOUND (if the device specified is not found) - #PvResult::Code::NOT_SUPPORTED (if no message channels are supported) - #PvResult::Code::CANT_READ_MANIFEST (if manifest table could not be read. This can sometimes happen if the U3V device is not powered properly) |
Returns
| Type | Description |
|---|---|
| PvDevice | A pointer to the new object on success, NULL on failure. See aResult for more information on the failure. |
CreateAndConnect(string, ref PvResult)
Dynamically allocates a PvDevice of the right type.
Declaration
public static PvDevice CreateAndConnect(string aInfo, ref PvResult aResult)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aInfo | String identifying the device. See PvDevice::Connect for more information. |
| PvResult | aResult | Outcome of the operation. - #PvResult::Code::OK - #PvResult::Code::INVALID_PARAMETER (if empty aInfo, or bad parameter passed) - #PvResult::Code::NOT_CONNECTED (if device was found, initially connected but disconnect during the connection process) - #PvResult::Code::NETWORK_ERROR (if sending packets failed, GEV) - #PvResult::Code::TIMEOUT (if socket binds and sends but times out on receive, GEV) - #PvResult::Code::THREAD_ERROR (if heartbeat thread will not start) - #PvResult::Code::GENERIC_ERROR (if an unexpected exception was thrown or if socket cannot bind or connect[GEV] or usb driver is busy [U3V]) - #PvResult::Code::GENICAM_XML_ERROR (if creating device genicam node map failed with xml error) - #PvResult::Code::NOT_FOUND (if the device specified is not found) - #PvResult::Code::NOT_SUPPORTED (if no message channels are supported) - #PvResult::Code::CANT_READ_MANIFEST (if manifest table could not be read. This can sometimes happen if the U3V device is not powered properly) |
Returns
| Type | Description |
|---|---|
| PvDevice | A pointer to the new object on success, NULL on failure. See aResult for more information on the failure. |
Disconnect()
Disconnect the #PvDevice object from the GigE Vision or USB3 Vision device to which it is currently connected.
Declaration
public PvResult Disconnect()
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
See Also
View SourceDispose()
Dispose.
Declaration
public void Dispose()
Dispose(bool)
Dispose
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing |
DumpGenICamXML(string)
Save the GigE Vision or USB3 Visio device's GenICam XML file to disk.
Declaration
public PvResult DumpGenICamXML(string aFilename)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aFilename | The file's name. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
~PvDevice()
Destructor.
Declaration
protected ~PvDevice()
Free(PvDevice)
Frees an object allocated with CreateAndConnect.
Declaration
public static void Free(PvDevice aDevice)
Parameters
| Type | Name | Description |
|---|---|---|
| PvDevice | aDevice | Pointer to the device object to delete. |
GetDefaultGenICamXMLFilename(out string)
Returns a good default filename to use with DumpGenICamXML.
Declaration
public PvResult GetDefaultGenICamXMLFilename(out string aFilename)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aFilename | A default filename built from the device XML location URL. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
GetType()
Returns the type of the instantiated device.
Declaration
public PvDeviceType GetType()
Returns
| Type | Description |
|---|---|
| PvDeviceType | Type of device controller. See #PvDeviceType enum |
GetUniqueID(out string)
Returns a unique string identifier for the device.
Declaration
public PvResult GetUniqueID(out string aID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aID | Unique string identifier for the device. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
ReadMemory(long, byte[], long)
Reads bytes starting at a specific register address on the GigE Vision or USB3 Vision device.
Declaration
public PvResult ReadMemory(long aAddress, byte[] aDestination, long aByteCount)
Parameters
| Type | Name | Description |
|---|---|---|
| long | aAddress | Start address of the read memory operation (mod 4). |
| byte[] | aDestination | Buffer where to write data read from the device. |
| long | aByteCount | Bytes to read from the device (mod 4, non 0) |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
RegisterEventSink(PvDeviceEventSinkSwigInterface)
Register an event sink used for callbacks.
Declaration
public PvResult RegisterEventSink(PvDeviceEventSinkSwigInterface aEventSink)
Parameters
| Type | Name | Description |
|---|---|---|
| PvDeviceEventSinkSwigInterface | aEventSink | A pointer to the event sink. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
StreamDisable()
Disables streaming on the device.
Declaration
public PvResult StreamDisable()
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
StreamDisable(uint)
Disables streaming on the device.
Declaration
public PvResult StreamDisable(uint aChannel)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | aChannel | The channel on which to enable streaming. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
StreamEnable()
Enables streaming on the device.
Declaration
public PvResult StreamEnable()
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
StreamEnable(uint)
Enables streaming on the device.
Declaration
public PvResult StreamEnable(uint aChannel)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | aChannel | The channel on which to enable streaming. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
UnregisterEventSink(PvDeviceEventSinkSwigInterface)
Unregister an event sink
Declaration
public PvResult UnregisterEventSink(PvDeviceEventSinkSwigInterface aEventSink)
Parameters
| Type | Name | Description |
|---|---|---|
| PvDeviceEventSinkSwigInterface | aEventSink | A pointer to the event sink. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
WaitForMessagingChannelIdle(uint)
Waits for the messaging channel to become idle.
Declaration
public PvResult WaitForMessagingChannelIdle(uint aTimeout)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | aTimeout | Maximum time to wait, in ms. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
WriteMemory(long, byte[], long)
Writes bytes starting at a specific register address on the GigE Vision or USB3 Vision device.
Declaration
public PvResult WriteMemory(long aAddress, byte[] aSource, long aByteCount)
Parameters
| Type | Name | Description |
|---|---|---|
| long | aAddress | Start address of the write memory operation (mod 4). |
| byte[] | aSource | Buffer holding the data to write to the device. |
| long | aByteCount | Bytes to write to the device (mod 4, non 0) |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
Events
View SourceOnCmdLinkRead
Callback invoked after a port read on the command link.
Declaration
public event OnCmdLinkRead OnCmdLinkRead
Event Type
| Type | Description |
|---|---|
| OnCmdLinkRead |
OnCmdLinkReadSafe
Thread-safe callback invoked after a port read on the command link.
Declaration
public event OnCmdLinkReadSafe OnCmdLinkReadSafe
Event Type
| Type | Description |
|---|---|
| OnCmdLinkReadSafe |
OnCmdLinkWrite
Callback invoked after a port write on the command link.
Declaration
public event OnCmdLinkWrite OnCmdLinkWrite
Event Type
| Type | Description |
|---|---|
| OnCmdLinkWrite |
OnCmdLinkWriteSafe
Thread-safe callback invoked after a port write on the command link.
Declaration
public event OnCmdLinkWriteSafe OnCmdLinkWriteSafe
Event Type
| Type | Description |
|---|---|
| OnCmdLinkWriteSafe |
OnEvent
Messaging channel raw event notification.
Declaration
public event OnEvent OnEvent
Event Type
| Type | Description |
|---|---|
| OnEvent |
OnEventGenICam
Messaging channel GenICam event notification.
Declaration
public event OnEventGenICam OnEventGenICam
Event Type
| Type | Description |
|---|---|
| OnEventGenICam |
OnEventSafe
Thread-safe messaging channel raw event notification.
Declaration
public event OnEventSafe OnEventSafe
Event Type
| Type | Description |
|---|---|
| OnEventSafe |
OnLinkDisconnected
Notification that the PvDevice unexpectedly lost contact with the device.
Declaration
public event OnLinkDisconnectedHandler OnLinkDisconnected
Event Type
| Type | Description |
|---|---|
| OnLinkDisconnectedHandler |
OnLinkReconnected
Deprecated, no longer used. PvDevice no longer attempts automatic reconnection.
Declaration
public event OnLinkReconnectedHandler OnLinkReconnected
Event Type
| Type | Description |
|---|---|
| OnLinkReconnectedHandler |