Hi,
I made Python program from https://help.commonvisionblox.com/NextGen/14.0/cvbpy/dd/d2f/cvb_2_streaming_simple-example.html with parameter 0 or 1 for a system with 2 cameras at port 0 and 1:
with cvb.DeviceFactory.open(os.path.join(cvb.install_path(), "Drivers", "GenICam.vin"), port=CAM_PORT) as device:
I call it from 2 scripts parallel
grab0.cmd:
python grab.py 0
grab1.cmd:
python grab.py 1
This works only if I start first grab0.cmd and then grab1.cmd
If I start grab1.cmd first then in grab0.cmd an error occure:
with cvb.DeviceFactory.open(os.path.join(cvb.install_path(), “Drivers”, “GenICam.vin”), port=CAM_PORT) as device:
RuntimeError: {C-API call failed} ({LoadImageFileW})
A similar problem is with the .Net example Cvb.Net\GenICam.
I appended a parameter for the port in program.cs
public static int port = 0;
[STAThread]
static void Main(string[] args)
{
if (args.Length != 0)
int.TryParse(args[0], out port);
and in Mainform.cs:
public MainForm() {
InitializeComponent();
this.Text += " Port:"+Program.port;
...
var device = FileDialogs.LoadByDialog(path => DeviceFactory.Open(path,board:0, port:Program.port), "Video Interface Drivers (*.vin)|*.vin");
But in this case I get an Error by opening driver for port 1 if the driver of camera on Port 0 was opened in the other instance of the program:
Error loading driver:
Loading the Device from file C:\Program Files\STEMMER IMAGING\Common Vision Blox\Drivers\GenICam.vin failed.
How can a make a program which can start twice to grab on port 0 and port 1 independent?
Peter