Issue Accessing Camera via NxLib C++ API Using nxSimple Sample in Visual Studio 2019

General Information

  • Product: X36-BL
  • Serial Number: 193464
  • Ensenso SDK Version: 4.0.1502
  • Firmware version: 2.10.14871
  • Operating System: Windows

I can successfully open the camera and view images in NxView, so the hardware connection seems stable. However, when I attempt to access the camera using the C++ nxSimple project from Ensenso SDK, I receive an exception. I’m using Visual Studio 2019

The output I receive upon running the program is as follows:

Could you please advise on how to resolve this issue? I have verified that the camera is working correctly in NxView, so it seems to be an API or configuration issue. Any insights or troubleshooting steps would be greatly appreciated.

Hi Alfonso,

we appear to be using an incorrect type specifier in a string formatting function somewhere.

I have not found the location yet and did not manage to reproduce the error either, so it would greatly aid the search if you could provide an NxLib log file from running the example. It is probably easiest if you copy the code snippets from the online guides to set the log level and set the level to valTrace, and then use the log writer built into NxLib. In the meantime, I will keep scanning our codebase.

This is not a common issue, so I am confident that we will find a workaround.

Regards,
Raphael

Hi Raphael,

Thank you for your response.

I have attached the requested logs for your review.

Additionally, I wanted to mention that I tried running the same example with an older version of the Ensenso SDK (version 2.3), and the example works correctly with that version.

Please let me know if there is any other information I can provide or any additional tests you would like me to perform.

log_20241111_145616.zip (100.0 KB)

Hi,

Have you had a chance to review the logs I sent? I’m planning to install the latest SDK version and would appreciate any updates or recommendations to fix the issue.

I am still working on it. I could not pinpoint an exact location from you log, so I have enabled every check I could find: still nothing. I have improved the runtime error reporting as well, but since I do not see the error I need your help. If I send you a preview release containing the improved reporting, could you run that and see if the error persists and send me back the new error message? I could have that ready for you on monday.

Thank you for the update. Yes, please send me the preview release with the improved error reporting. I’d be happy to test it and provide you with the new error messages.

Thank you for the feedback you provided via PM. It helped me a lot to fix the bad format string.

Now we can focus on solving your underlying problem: the NxLib fails to connect to the projector when using the NxSimple example but not using NxView. Could you send me a log from NxView where you open the camera, so I can compare the two?

To capture a log in NxView you can use NxTreeEdit or press Ctrl-L in the camera selection window, open the camera normally and pres Ctrl-L again. This should open NxProfiler, which shows the path to the file in the title bar.

Hi, I attach the log opening the camera normally with Nxview. I hope it helps.
open_camera.zip (6.9 MB)

I suspect some issue with your network. Is you configuration okay, e.g. no overlapping subnets etc.? NxView shows a warning in the lower right of the camera selection window if it detects possible problems, which you can click on for further information:

image

From the log your configuration looks okay, but can you post a copy of the NxLib tree so I can verify? It lists all your network adapters and IP addresses.

How to copy the NxLib tree
  • Click the NxTreeEdit icon in NxView:
    image
  • Right-click the root node / at the very top.
  • Select “Copy value as JSON string” from the context menu.
  • Paste the JSON into any text editor and save, or paste it directly in you reply.

Do you have a firewall enabled that blocks NxSimple but not NxView? The X projector requires TCP and UDP ports 24100, as detailed in our firewall configuration guide. UDP seems to be working for both programs, otherwise the projector would not be detected and NxSimple would not try to open the camera. Can you disable the windows firewall and see if it makes a difference?

Can your rule out any IP conflicts? Do you have the camera attached directly to your PC or do they talk over some wider network?

Is there already more information about this issue? We are having a similar issue. On an IPC (with windows 10 and EnsensoSDK 4.0.1502) it does not work from a C# project (we got also error code 17); NxView works without any problems. Firewall is enabled for the specific ports and no conflicting IP configurations.

1 Like

Hello John,

I have no additional information at this time.

How similar is your issue? Do you get the same error text about the incorrect format string? If you get a different error message, it might be better if you started a new thread.

In any case: can you please attach a log on debug level Trace and a copy of your NxLib tree, both from NxView and from your application? Do you get the same error on any of the NxSimple examples?

Regards,
Raphael