情報詳細Q: pylonAPIより、カメラの接続状態を一定間隔で確認したいと思います。どのように記述すればよいでしょうか。言語は、C#を使用しております。A: カメラの接続状況を確認する方法として、C#ではCameraFinderのクラスにあるGetDeviceAccessibilityInfoのメソッドを使用ください。値の取得はCameraインスタンスのCameraInfoにより取得可能。カメラ接続のステータスが5つに分かれております。OpenedExclusively:デバイスにアクセスでき、他のアプリケーションなどによって既にに開かれている状態。Ok:デバイスを開くことが可能な状態。Unknown:デバイスがアクセス可能であるかを特定できず、アクセス可能であるか不明な状態。Opened:デバイスにアクセス可能であるが、読み取り専用モードでのみ開くことが可能な状態。NotReachable:デバイスに到達できなかったか存在していない状態であり、デバイスへの接続を確立できない状態。上記より判別することが可能です。例としてコードを下記に示します。***************************************************** switch (CameraFinder.GetDeviceAccessibilityInfo(camera.CameraInfo)) { case DeviceAccessibilityInfo.OpenedExclusively: Console.WriteLine("The device is reachable, but already opened exclusively, e.g. by another application. "); break; case DeviceAccessibilityInfo.Ok: Console.WriteLine("The device can be opened."); break; case DeviceAccessibilityInfo.Unknown: Console.WriteLine("The accessibility of the device could not be determined. The state of accessibility is unknown."); break; case DeviceAccessibilityInfo.Opened: Console.WriteLine("The device is reachable, but can be opened in read only mode only."); break; case DeviceAccessibilityInfo.NotReachable: Console.WriteLine("The device could not be reached or it does not exist.A connection to the device cannot be established."); break; }***************************************************** 添付ファイルタイトルC#カメラの接続状況を確認するための方法(GigE,USBカメラ)URL 名000005112公開状況公開済み検証状況公開済み