I work on Windev software.
I add on the project Cvb activeX (Image control and Display)
On the Image control i can use “serial number”.
I would like use it to check if the camera is online ( i have only 1 camera).
I “initialize” the activeX, i can take a picture and save it, but the serial number command return 0 everytime and i don’t find why.
On Cvb viewver i see the camera and the serial ID.
// initialize
( AX_CVB = image control activeX and AX_Display is display activeX)
is there a reason why you want to go with the ActiveX Control?
If not, you could have a look at the following example:
%cvb%\Tutorial\Image Manager\Cvb.Net
You can also get the SerialNumber directly from the NodeMap.
Here is an example on how to get the NodeMap of a camera and work with it:
// Load driver
using (Device device = DeviceFactory.Open("GenICam.vin"))
{
// Load NodeMap for the device
var dev_node_map = device.NodeMaps["Device"];
using (var camModel = dev_node_map["DeviceModelName"] as StringNode)
{
Console.WriteLine("Loaded device: " + camModel.Value);
}
using (var camFirmWare = dev_node_map["DeviceFirmwareVersion"] as StringNode)
{
Console.WriteLine("Current Firmwareversion : " + camFirmWare.Value);
}
using (var exposureTime = dev_node_map["ExposureTime"] as FloatNode)
{
Console.WriteLine("Current exposure time : " + exposureTime.Value);
var exposureTimeOld = exposureTime.Value;
exposureTime.Value = 32;
Console.WriteLine("Small exposure time : " + exposureTime.Value);
exposureTime.Value = exposureTimeOld;
Console.WriteLine("Resetted to old exposure time : " + exposureTime.Value);
}
}
Also, if you only have one camera on the machine, what is the reason for checking the serialnumber?
Maybe there is a better way to achieve what you want once we fully understand what you are trying to do.
if no camera is connected then loading the driver will fail, that would be the easiest way to check as this results in an exception that you could handle.
If a camera was already found and gets disconnected for some reason, the following code will notify you (and also once the device is back up and running):
With this combination you would be independent of the actual camera (model or even specific camera).
If you still want to check for a specific camera you can still go with the NodeMap and the DeviceID (I think should be the serialnumber) node.
I have never worked with windev, so, unfortunately I cant help you on how to get CVB running in there.
What I found out so far is, that windev has its own programming language.
If there is a possibility to write your own plugins/classes/scripts using C++, C# or Python then I can provide you the code for what you want to do.
sorry this confused you, but the SerialNumber property of the CVImage control actually reports - as the two of you found out - the CVB serial number, not the camera’s serial number. It is also somewhat outdated: CVB today supports more than just one serial number, but the property will only ever report the “best” one (i. e. the one that has the best tool coverage).
As a general rule, our ActiveX controls are more or less approaching their end of life and today we add new functionality to the CVB.Net, CVBpy and CVB++ API rather than to the ActiveX controls, so not everything that you find here on the forum can be guaranteed to be feasible with the ActiveX controls (device discovery is one example that comes to mind, another one would be the more advanced acquisition features like MultiPart or FlowSetPools).
Yes not a problem to the serial now i know …
To the activeX system it’s old function to a computer but i work on industrial automatism and to include activeX is a new function on automatism side (2 years).