Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register Dictionary is null #76

Open
Touseefelahi opened this issue Sep 19, 2022 · 12 comments
Open

Register Dictionary is null #76

Touseefelahi opened this issue Sep 19, 2022 · 12 comments
Assignees

Comments

@Touseefelahi
Copy link
Owner

Register dictionary is not being populated

@Watearth
Copy link

Watearth commented Nov 7, 2022

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
Copy link
Collaborator

FaisalFagihi commented Nov 8, 2022

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
Copy link

Watearth commented Nov 8, 2022

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
Copy link
Collaborator

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

@Watearth
Copy link

Watearth commented Nov 8, 2022

BAUMER.zip
Voilà

@FaisalFagihi
Copy link
Collaborator

FaisalFagihi commented Nov 9, 2022

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
Copy link

Watearth commented Nov 9, 2022

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
Copy link

Watearth commented Nov 9, 2022

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
Copy link
Collaborator

FaisalFagihi commented Nov 10, 2022

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
Copy link

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
Copy link
Collaborator

FaisalFagihi commented Nov 10, 2022

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 (1ebd94b)

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants