06-21-2018 03:43 PM
Hardware I am using:
Software I am using:
About the issue:
I'm trying to acquire images at several different time intervals. I set up an array of the time intervals and hacked together some condition statements (I don't know if this is the correct way to do something like this, this is my second week using IMAQ). When the capture command is given the images are flattened to a string. I'm trying to append to the string by using concatenate string, but it doesn't appear to be working.
Right now it is only writing one of the images into JSON formatting. I've attached the output text for you all to look at. Not exactly sure what the issue is since no error is being produced.
This is the segment of timed capture that I'm not sure about. I imagine there is a much more forward approach to this, so hopefully someone can point me in the right direction. I want the time intervals to range from 2^-4 to 2^10 milliseconds. Where the first capture is at 2^-4 ms, the second at 2^-3 and so on
Here is where I am trying to convert the information to JSON format. As you can see I am flattening the image to a string, then clustering everything together. Once all the information is clustered, I flatten the variant to a string. This is where I try to concatenate the strings to before converting back to a variant.
Also, ideally my JSON output would look like this:
{ "Image_1":{ "Image_Time": time, "Image_Binary":image binary data } "Image_2":{ "Image_Time": time, "Image_Binary":image binary data } etc. }
but that isn't as important as the timing and appending issues
06-22-2018 02:20 AM
can you please downgrade the vi to LV2014 or below, not everyone has the privledge to use the advance versions.....
06-22-2018 08:09 AM
I don't have a Dalsa camera, so I can't run the code. But how does the Timer Duration attribute work with your camera? Does it set the exposure time for the sensor? Or is it the time between taking subsequent frames?
Either way, I see one problem with the way you are doing the acquisition. I believe you are doing a continuous acquisition and you have set the Acquire Image Type to acquire every image. This means that as soon as you start acquiring, IMAQdx is going to start buffering frames in the background. In your loop when you call the Vision Acquisition Express VI, it will return the next frame in the buffer. Because of this, I'm pretty sure the returned image will not correspond to the updated Timer Duration setting you are giving the express VI. I'd make a suggestion about another way to approach this, except I'd need more information about how you are trying to use the Timer Duration setting.
As for why only one image is being written to the JSON string, I could see this happening if you are only entering the True case of that case structure once. You should debug the logic that gets you into that True case to make sure it is sound.
-Jordan
06-22-2018 09:03 AM
How do I save it as a 2013 copy?
06-22-2018 09:08 AM
I think the timer duration sets the time between the frames. I'm trying to use the timer duration setting to capture a photo at .0625 ms, .125 ms, ... I'm not sure if it is the right control to use for that sort of thing or if I need to use one of the other controls.
For the JSON, the true case enters the same amount of times as the capture count. I can see it entering and outputting the correct names/strings in highlight execution mode, but even then it is not updating the string properly
06-22-2018 10:20 AM
Here is a list of the camera controls from the vision acquisition express VI associated with my camera
06-22-2018 10:22 AM
To backsave the VI, open it and then go to File»Save for previous version.
I made some changes to the acquisition so that I could at least run the VI. I found through probes that the string is concatenating correctly, but the Flattened String to Variant function is cutting off everything except the first image's data. The problem is that you are taking a cluster (which is fixed size), flattening it to a string, concatenating the string, and then trying to unflatten it back into the same cluster datatype (which is determined by the Type String input to Flattened String to Variant). Not sure what a workaround would be. Maybe try using the normal Unflatten from String function instead of the variant version?
-Jordan
06-22-2018 10:25 AM - edited 06-22-2018 10:35 AM
Here's the 2013 version
Edit: When I use a regular unflatten string I get this text output
06-25-2018 09:51 AM
I think the biggest issue right now is to make sure the image is capturing at the exact rates that I am inputting, but I am not sure how to check that without properly converting/saving the images
06-25-2018 10:13 AM
It looks like that is stripping out the cluster information. We already determined that you can't add on to the string and then try to unflatten it back into a cluster since the cluster is a fixed size. Do you have to use that data structure? Could you use an array of clusters instead of trying to append to the data string?
-Jordan