03-25-2016 05:07 AM
03-25-2016 05:27 AM - edited 03-25-2016 05:38 AM
Current firewire cameras are max 14fps but at image quality needed for processing afterwards (digital image correlation, cams are AVT stingray) this shrinks even further. 2 firewire cams are sharing the same firewire port so there's another bottleneck for the framerate. USB cameras are faster but not that fast either since it's on a laptop and going trough a hub. I'm working with what I have here since it's for an internship for school.
Need pics at extrema of 3hz signal so that makes 6 pics a sec. There's just no way the pics will be at the right moment. It's for a tensile test bench. I read the force signal with daq box and at max and min force I need to take a pic of the sample being tested. So I calced the times at which the max and min will accure and a bit in front (timed by using test setup) let labview take a pic so the pic is at the actual max and min (It's not an actuel trigger for the cams). That's the plan anyway.
03-25-2016 02:34 PM
03-31-2016 02:26 AM - edited 03-31-2016 02:27 AM
2 further quistions...
What would be the best way to take a picture with IMAQdx?? The configuration is done before the acqsuisition (open camera, buffers etc.) and I use multiple buffers and save the picture afterwards, so its just the part in the loops I'm talking about (see pic with quick setup I've made at bottom). I've timed the loops with difference between tick counts and shift register and the snap option is way slower than the grab- and low level option (+- 460 ms vs +- 245ms for the other 2).
Can I use the timestamp (received from custom keys, see http://digital.ni.com/public.nsf/allkb/D0488009D5AC87CF862579BA007B5F9B ) to ensure my picture is at the right moment? I'd use this in a configuration mode and calculate the difference x between the timestamp I want to take the picture and the timestamp from the actual photo. Then call my take photo command the time x before I want my photo. This instead of the LED option above to make sure the photo is at the right time.
Cedric
03-31-2016 07:35 AM
Sorry, I'd love to help, but since you persist in posting JPegs instead of VI, I'll refrain, as I'm not confident I'll be answering the "right question" or contributing to "the solution" to your problem (which I have yet to fully see). See my earlier post.
Bob Schor
03-31-2016 09:19 AM
Bob,
Here's the main VI. Since there are shared variables from third party software (labview based) and hardware as well you'll won't be able to run it so I didn't add all the smaller subVI's. (Couldn't find a zip creator on this laptop either for some reason) But I think the name of the subVI's should be sufficient to get the picture of what they do. It's the fatigue test (case) part I'm working on but if you see something else you would change you're welcome to mention it as well. This is the last version I posted. It does what it needs to do but I'm still figuring out if the pictures are taken at the right moment (that's for tomorrow though).
If something is not clear you can send me a private message or post it here and I'll answer asap.
Cedric
03-31-2016 04:31 PM
First thing, banish, remove, and resolve never again to use a Stacked Sequence Structure. Learn about State Machines and keeping variables in a Shift Register of a While Loop. Here's an example (very incomplete) --
This has four States (governed by the Enum) -- Initialize, Wait for Trigger, Acquire Image, and Quit. If you drag this Snippet into a LabVIEW 2015 (blank) Block Diagram, it will become code you can inspect. I've shown one of your inputs here, "memorized" by the Shift Register so that any other State can use it. The State is in the top Shift Register. In the Wait for Trigger State, if you are polling, you ask if it is time to take the image, in which case you put "Acquire Image" as the next State, otherwise you put "Wait for Trigger" and wait again.
Try to make your VIs more compact so that the viewer (and yourself) can take more in without having to scroll around the screen.
See if you can refactor your code to make it more "self-documenting" (as I assert the State Machine model would do). Once you have, I'll take another look ...
Bob Schor
04-01-2016 01:23 AM
I'll change it to a finite state machine. Had been thinking about that but wanted to make sure it worked first... I'll post the vi in this message when I'm done converting it.
04-01-2016 09:10 AM
Bob,
So I changed the stacked sequence structure to a finite state machine. For now I kept the while loop for the pictures instead of doing the wait on next trigger and take picture states you mentioned because it works but I might change it to your way at the end of my internship if I have spare time. Changed some other stuff as well to shrink the code. I'll do those things in the other case as well to simplify it (quasi static). It makes my .vi more fool proof for the users as well so only pros there.
I added the delay measurement vi as well. I build this starting from the example to read the timestamps from IMAQ keys to find the difference between the timestamp I get from the IMAQ keys and a timestamp from just before I call the ''get image'' block from IMAQdx low level. I'd like to call the get image a time x before I need my picture and determine x with the delay measurement vi. You think this is any good? Don't really see how else I could sync these because the led method mentioned above isn't easy as well. It's a basis this vi, I will add extra functionalities for more then 2 cameras and so on but you get the point I guess...
Cedric.
04-01-2016 01:46 PM
Cedric,
I'm not 100% certain I know what you want to do (which is why I'm not giving a lot of specific advice here), but you would definitely benefit from having an available LabVIEW Guru to give you some general pointer and help you clean up your code. Once that is done, it will be a lot easier to "get the algorithm right".
The following are "Style" comments (ever since I read Peter Blume's "The LabVIEW Style Book", maybe 8 years ago, with frequent cover-to-cover re-reads, I've been, well, "obsessed" might be a tad too strong a word, "a believer in" good Style when programming with LabVIEW).
Now for another "level" of Style Rules.
Don't worry that you won't do this -- I have colleagues here who don't, and I yell at (well, scold) them. My students, of course, don't do this, but they are usually a little easier to persuade, particularly when we "refactor" their code together and they see how much nicer it looks in a Project, split into 4 or 5 VIs, each with an Icon + Description (and they see how easy/fast it is to create Icons and Documentation), and fitting in 10 to 20 percent of the Screen area.
Bob Schor