Touseefelahi / GigeVision

Simple GigeVision implementation, GVSP, GVCP protocol implemented
97 stars 31 forks source link

Register Dictionary is null #76

Open Touseefelahi opened 1 year ago

Touseefelahi commented 1 year ago

Register dictionary is not being populated

Watearth commented 1 year ago

I Have this problem with camera who use http://www.genicam.org/GenApi/GenApiSchema_Version_1_1.xsd

because i try tu see something with GigeVisionLibrary.Test.Wpf and it is work for camera who use http://www.genicam.org/GenApi/Version_1_0 but not http://www.genicam.org/GenApi/Version_1_1

FaisalFagihi commented 1 year ago

Registers dictionary is not required to be populated anymore. the current flow of accessing the camera registers is as the following: 1- Fetch and load the xml file from the camera. 2- Provide the required register name, which is unique in all cameras based on GenICam standers (ex: Width). 3- Lookup for the register availability. 4- Apply the required command (get/set). 5- Return the GVCP reply with status code.

I just tested it with camera who uses the same GenApi version (1_1) and it worked just fine with commenting the following lines in MainWindow.xaml.cs (GigeVisionLibrary.Test.Wpf).

//var listOfDevices = await camera.Gvcp.GetAllGigeDevicesInNetworkAsnyc().ConfigureAwait(false);
//cameraCount.Text = "Cam count: " + listOfDevices.Count.ToString();
//if (listOfDevices.Count > 0)
//{
//    Camera.IP = listOfDevices.FirstOrDefault()?.IP;
//    Camera.RxIP = listOfDevices.FirstOrDefault()?.NetworkIP;
//}

the above service is not directly related to this issue, but it is causing a crash with this camera (needs to be investigated).

PS: Make sure that your local master branch is updated to the latest changes.

@Watearth

Watearth commented 1 year ago

I check my 2 types of camera and the difference is a formula for Width in GeniCam version 1_1 camera. image

now with "modification" my first one (genicam version 1_0 camera) doesn't work with this test due to my network port number on my computer (9 network ports and 4 connected) and the code take the wrong network IP address.

for working again i change in thecode in 'else' of Button_Click on MainWindows.xaml.cs : width = (int)camera.Width; height = (int)camera.Height; Dispatcher.Invoke(() => { lightControl.WidthImage = width; lightControl.HeightImage = height; lightControl.IsColored = !camera.IsRawFrame; }); var listOfDevices = await camera.Gvcp.GetAllGigeDevicesInNetworkAsnyc().ConfigureAwait(true); cameraCount.Text = "Cam count: " + listOfDevices.Count.ToString(); if (listOfDevices.Count > 0) { foreach (var device in listOfDevices) { if(device.IP == Camera.IP) Camera.RxIP = device.NetworkIP; } } await camera.StartStreamAsync(camera.RxIP).ConfigureAwait(false);

FaisalFagihi commented 1 year ago

Can you kindly provide the camera xml file so I can look it up. @Watearth

Watearth commented 1 year ago

BAUMER.zip Voilà

FaisalFagihi commented 1 year ago

I've found what causing the issue in GenICam Formulas.

Kindly switch to this branch (https://github.com/Touseefelahi/GigeVision/tree/Fix_GenICamFormula) and test it; hopefully it will work with you as it did with me. @Watearth

Watearth commented 1 year ago

Good work but we have some null in CategoryDictionary : image

and when I try to see live view on this camera, I have formula return at 0 : image image

Watearth commented 1 year ago

I think, for CategoryDictionary, when you search all pFeatures for 1 category, you scan scan all file and not only the right category. In this case we have multiple same name in this file. For formula, I think is more complex due to multiple formula to have the right things, Ex: Width...

FaisalFagihi commented 1 year ago

the null values are for the nodes that not been implemented yet in this library, check them out: pAlias pBlockPolling pCastAlias pError pInvalidator pIsAvailable pIsImplemented pIsLocked pSelected

most likely from what I notice they are Selectors (pSelected).


the test I did was in a different Baumer camera that I have, this time I will try to test it using the formulas in the xml file you sent (this test will not be 100% valid as long as I don't have the actual camera to read the required registers values from the formulas).

Watearth commented 1 year ago

I understand and it is the "lastest" Baumer camera with 65Mpx.

For formula, it is very strange for Width information, it is working but I think is not simple.

I cheat a little bit for 'Width' & 'Height', I changed in software for have 'SensorWidth' (9344) and 'SensorHeight' (7000) and on wpf test, it is look like working but I have 0fps and 0 FrameReady.

In the beginning I just want use 'GenICam protocol' to do a software for my cameras easily but I for now I will do it with all sdk from Vendor.

I would like to do the same thing of you, a WPF software with a selector of IP address and see cameras.

Thanks for your time. I will try another time with your software.

FaisalFagihi commented 1 year ago

here is the formula that the math parser couldn't calculate:

((SCFGMODE=1)||(SEN=1))?(CFGBASE + 12):(DEVICE)

because I was not covering the case of having or condition in the FormatExpression method (1ebd94ba28cd9f2126e0cad6159d6163bc9bb892)

kindly pull out the latest changes in this branch (https://github.com/Touseefelahi/GigeVision/tree/Fix_GenICamFormula).

I hope it will work with you this time.

@Watearth

Watearth commented 1 year ago

Same thing, Width & Height don't work and 0 fps.