LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

For loop + shift register + multiply instances

Solved!
Go to solution

For the code you showed to work the VI you are trying to open must be in memory. Either give it a fully qualified path the the VI or use a static refernce that is assocaited with that VI.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 21 of 29
(1,929 Views)

Intaris wrote:

Ben wrote:

Nice work for a noob! Smiley Wink

 

Thanks for sharing your solution.

 

Ben


I was thinking the same thing.  Nifty code for a beginner to be sure!  Makes me want to ask the question whether you're a beginner at all or if this is simply a bad assumption.  Straight wires and no overlapping structures.  Even Altenbach would find little (He always finds SOMETHING) wrong with this code.

 

Keep it up.

 

Shane

 

Glad you got it working. 


Well I never really said that I was a beginner 😛 but to give you a little overview. I came in contact with labview 3 years ago in my first year at university. I and other students had to do a project in it.  Then about half year ago I had to build a vision application with labVIEW, see post history. Now I'm working for my thesis on a project where I need to use labVIEW. So really I know labVIEW already 3 years but I only worked with it at my projects. What I meant to say with "just a homble student who has a thing for labVIEW" is that I'm not a employee whos main tool is labVIEW like you people are proberbly. 


Ben wrote: 

For the code you showed to work the VI you are trying to open must be in memory. Either give it a fully qualified path the the VI or use a static refernce that is assocaited with that VI.

 

Ben


I tried filling in the full path; C:\ni-rt\startup\Untitled 5.vi

But it didn't had any effect. (Also tried with a filename which didn't contain any spaces, could be that RT couldn't read spaces but it does.)

And what do you mean use a static refernce that is assocaited with that VI, am I not doing that already?

 

Naamloos.png 

 

I can also just select a static VI reference but then the wire in the second for loop gets broken because the "call by reference node" needs, I quote from help; "Calls the VI specified by reference. The reference VI must be a strictly typed VI reference."

 

Naamloos.png 

 

Ps. as said I can also just unwire the the "Open VI reference" from the error wire (which I actually did now as you can see) but that doesn't have my preference 😉

 

Thanks already for your help 

 

Message Edited by WouterG on 03-31-2010 12:37 PM
0 Kudos
Message 22 of 29
(1,905 Views)

Can't reply since on-site with old LV version.

 

Curious as to why it works but even tho errors.

 

File path on RT may be different ... stuffed in exe?).

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 23 of 29
(1,890 Views)

Hmmmm... I found out something interesting...

 

When I first open the VI for one encoder, Untitled 5.vi, then I run it then 1 time on the target. Following up I start the main program which uses the VI with the array...

 

thanks.png  

 

Then it works... but if I just open the main, and not first run (standalone) the Untitled 5.vi then it doesn't work and returns that error 7...

0 Kudos
Message 24 of 29
(1,856 Views)

Hence THIS answer already by Ben.

 

Shane.

0 Kudos
Message 25 of 29
(1,851 Views)

Just like Ben said, if you wire only the VI name to "Open VI Reference" it will only find it if it is already in memory. I don't know why it doesn't work if you provide the full path. This is strange.

Anyway, what Ben meant is to just place a static VI reference somewhere in your code (not wired to anything) to make sure the VI is in memory. I use this method often and it works nicely. If the VI is in memory already you can also just wire a string constant (instead of a path constant) to "Open VI Reference".

 

Static-VI-Ref.PNG

Message 26 of 29
(1,846 Views)

dan_u wrote:

Just like Ben said, if you wire only the VI name to "Open VI Reference" it will only find it if it is already in memory. I don't know why it doesn't work if you provide the full path. This is strange.

Anyway, what Ben meant is to just place a static VI reference somewhere in your code (not wired to anything) to make sure the VI is in memory. I use this method often and it works nicely. If the VI is in memory already you can also just wire a string constant (instead of a path constant) to "Open VI Reference".

 

Static-VI-Ref.PNG


AAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHh that was an important piece of information that I didn't know. I thought he meant I needed to wire it somewhere so I was all the time trying to wire it somewhere but of course I failed at this. Anyway it works now 😄 I'm glad!

 

0 Kudos
Message 27 of 29
(1,841 Views)

I'm glad it works now.

And that's nice code imho, I just don't like the name of your SubVI (Untitled 5.vi) Smiley Wink Smiley Very Happy

 

0 Kudos
Message 28 of 29
(1,832 Views)

dan_u wrote:

I'm glad it works now.

And that's nice code imho, I just don't like the name of your SubVI (Untitled 5.vi) Smiley Wink Smiley Very Happy

 


Thats just for the test VI 😛 the real has of course another name ^^ 

 

0 Kudos
Message 29 of 29
(1,825 Views)