The vinBuffer nodemap itself is indeed not the right nodemap to get the correct nodes you need.
The safe method Simon mentioned is still available over the Device Nodemap where these chunk related nodes are updated, when you access them after receiving an image and executing
The issue I’m encountering is that the deviceNodeMap can’t be directly obtained from the image in my case. While this approach works well in a single-threaded scenario, I believe it causes synchronization issues in my setup.
I have another thread running an interface that allows me to access the deviceNodeMap and modify the sensor settings. This seems to interfere with the chunk data retrieval, as both threads might be updating the same deviceNodeMap.
This is why I’d like to read the ChunkLineStatusAll parameter directly from the image.
Hi @mario , the “Device”-Nodemap is nothing attached to an image. As the name indicates, it is attached to device related information.
Without knowing the exact intention of your multithreaded application, also without any specific knowledge about the IO control related features of a camera:
The node “Std::ChunkLineStatusAll” is nothing we can tie to an (software representation) of an image. The only way to get that temporal connection between the value of the node and the image is, through asking for the value in the moment you got an image. That is through accessing the value of the Device nodemap’s node after waiting for the image.
Hi, @s-woe. That information is supposed to be accessible in the chunk data associated with the image. This ensures that the state of the digital signals corresponds exactly to the received image.
This is why I’m trying to replicate the example mentioned earlier by @simon:
as @Sebastian mentioned, please use “using (NodeMapDictionary nodeMaps = NodeMapDictionary.FromImage(image))” instead of manually accessing memory. The Chunk info will be synchronized to the current received image, also if there are multiple images in the buffer queue currently:
using (Composite composite = stream.Wait(out WaitStatus status))
{
using (MultiPartImage image = MultiPartImage.FromComposite(composite))
{
//Extract Chunkdata from the Nodemap
using (NodeMapDictionary nodeMaps = NodeMapDictionary.FromImage(image))
{
Console.WriteLine("ChunkTimestamp: " + ChunkTimestampNode.Value + " | ChunkLineStatusAll: " + ChunkLineStatusAll.Value);
}
}
}
However, I’d like to ask if this functionality is also available in the C++ library. So far, I’ve only been able to find the NodeMapDictionary class mentioned in the CVB C# documentation. Is there an equivalent method to extract the chunk data directly from the image in C++?
let me jump in here real quick.
To realize your code in Cpp what you want to do is to pass a pointer to the DeviceNodemap into the function that handles image acquisition.
Once the Wait() call is (internally) done with creating the composite, it will attach the chunk data to the device nodemap.
So after your Wait() call is finished, you can use the Nodemap ptr to get the current chunkdata that was attached with the last awaited image.
In the nodeMaps returned by the Wait() call, I don’t see the Device nodemap. If I use the deviceNodeMap directly, can I be sure that the chunk data read from it is fully synchronized with the image received?
What concerns me is that, in my application, I have another thread simultaneously reading to other nodes in the deviceNodeMap. Could this potentially cause desynchronization issues?
I’ve noticed occasional situations, particularly when the PC becomes slow, where the digital inputs don’t seem to match the image profiles. This gives me the impression that a desynchronization might be occurring on the PC side. If the chunk data came pre-synchronized from the sensor, such mismatches shouldn’t happen.
Any thoughts on this? Thanks again for your support!
Mario