07-16-2012 06:00 PM - edited 07-16-2012 06:01 PM
Hi,
My experience with LabView is neither very good nor extensive. I am a scientist and I am acquiring data with IMAQ.My current problem is that the people who wrote the script in the beginning made it neither versatile, nor modular nor clear structured. So I am trying to reduce the ridiculous numbers of execution controls in a single flowchart to a level that people can actually understand it... and to make the script more versatile for future experiments.
I am introducing quite a few subVIs to be executed repetitively. However, I can't find out how to pass the IMAQ session on to the subVI. I always get error messages. In this case I want to acquire frames with OIDE_CollectFrame.vi controlled by OIDE_TrialPhaseCollect.vi. I couldn't figure out how to assign the IMAQ session refnum class, either.
It's probably a newbie question but I usually don't program with LabView. 😉
Dennis
Solved! Go to Solution.
07-17-2012 01:17 PM
Hi,
See the attached example. It passes the IMAQ session created in the main VI on to the subVI and then passses it again from the SubVI to the main VI.
Regards,
Greg H.
07-23-2012 12:18 PM - edited 07-23-2012 12:20 PM
Sorry, I am running LabView 2009 Basic Edition, your version is newer 😞
Could you just explain what to do?
07-24-2012 08:26 AM
Hi,
See attached, you should be able to open these. Let me know if you cannot.
Regards,
Greg H.
08-13-2012 12:54 PM - edited 08-13-2012 12:56 PM
Hi,
your files work. It shows me what I knew how it is supposed to look like... but not how you did it.
I probably did not make my question clear. I know what to do, but not how... e.g. How do you generate the session handler in the subVI?
Dennis
08-14-2012 10:01 AM
Dennis,
Do you mean how to actually make the session controls and indicators in the the SubVI? If so, you will see in the snap.vi subVI that there is an IMAQ session in and out connected to the IMAQ snap.vi. You can create these by right clicking the session in terminal on the left hand side of this VI and selecting create»control. Then you can do the same thing to the session out terminal on the right hand side, except you will want to create an indicator. Then you can create terminals for this control and indicator on the connector pane. Then save this VI and inset it into another VI as a subVI. The session in and session out with show up as terminals that you can use to pass the session. Please let me know if you have any questions.
Regards,
Greg H.
08-14-2012 11:47 AM
Hi,
thanks a lot, this is the question I had. I actually tried exactly that but the icons coming up don't look like in your script and I get error messages when I try to connect them.
Dennis
08-15-2012 03:55 PM
Hi,
Are you trying this on the IMAQ Snap.vi or a different VI? If you are trying this on the IMAQ Snap.vi could you attach a screenshot of what your block diagram looks like?
Regards,
Greg H.
08-17-2012 08:55 AM - edited 08-17-2012 09:03 AM
okay, although I still don't get the icons that look like yours, in the snap.iv, it works (see screenshot). I could actually connect it to the connector and in the Snap_Main connect the session ID to it, and it runs.
Question is, why this does not work in my scripts...
P.S. I have no idea what went differently, but now it worked o.O I am pretty sure I did it that way, all the time. The script runs but returns there was a bad session ID, I guess this is a different issue. However, how do you create these smaller icons for session id's?
08-17-2012 09:08 AM - edited 08-17-2012 09:11 AM
P.P.S. (sorry for that!) I just realized that the session ID numbers do not match between the different subVIs.