LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Working with File Paths on Real-Time Targets

Hello together,

 

It's about starting the main VI and launching two Smart Cameras at the same time. The Smart Cameras run with the Phar Lap ETS real-time operating system. Until now they have to be started one after the other. Can someone help, how it could work that the Smart Cameras start with launching the main VI? All instructions and discussions do not help me any further.

 

What I tried so far is added as a picture below (sorry, it's in german but I hope you can see the problem). The main problem is to find or to build a path. Or can anyone figure out another problem?

 

Also these two documents were given me as a support but I didn't find a way to solve the problem.

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000PAhpSAG&l=de-DE

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P6xZSAS&l=de-DE

 

Also the file https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YH93CAG&l=en-US didn't help but maybe someone can handle with this one.

 

Tell me also, if someone has a totally different solution for the problem. The main issue is that it works like I described at the beginning.

 

Thanks in advance for any responses.

 

0 Kudos
Message 1 of 7
(2,559 Views)

I'm sure there are good reasons you're not doing this, but can you call the VIs directly? That would possibly simplify your problem.

 

It's not obvious what (if any) benefit you have with the While loop (it actually looks fundamentally flawed) - you're closing the references immediately, but either the loop's stop condition is true by default (in which case, no need for a loop) or it's not, in which case you'll only get errors after the first iteration, possibly at high speed.

 

What are you struggling with regarding the path? I don't understand the exact problem.


GCentral
0 Kudos
Message 2 of 7
(2,536 Views)

A couple of things.  The Tutorial you referenced gave you the specific format for the Path (depending on the RT OS) -- you chose to use a different format for the Path, and it is generating an error.  Try reading the Tutorial again and creating the correct path (trust me, it is very specific).

 

Are you intending to run the two sub-VIs as detached routines, displaying their Front Panels?  [Do they have "interactive" Front Panels?  How do you stop them?].  Do you have a method for communication between the Host routine and the RT Target routines?  I notice you have two different IPs -- are there two RT systems, or are those the IPs of the Cameras?  Looks a little strange to me.  I don't understand the architecture of your RT system, but I'm pretty sure I wouldn't do it that way (I "inherited" a large RT project that was a complete mess -- I rewrote it using something like a Queued Message Handler (State Machine) on both Host and Target, with a pair of Network Streams sending Messages between the two.  With this model, you could get both cameras "ready to go", and then simply run IMAQdx Grab on both in parallel, starting them as close to simultaneous as you can get.

 

Bob Schor

0 Kudos
Message 3 of 7
(2,531 Views)

Thanks for your answer.

 

Maybe I try to explain my problem once again ignoring what I did so far.

 

I got a program of a robot which pics up a component and puts it on a board. Now we have three different programs: on main VI that controls the robot, one program in the smart camera which figures out if there is a component and the second camera which figures out a free place on the board.

At the moment I have to first start the two cameras separately and they give their data to the main VI. If this is finished, I can start the main VI of the robot and everything works.

Now I want to build a "start-sequence" including the two smart cameras that I can start everything with one click in the main VI.

 

I hope this makes my problem a little more clear and you help me. It is possible that everything I did until now with the "start-sequence" is nonsense. Maybe you can give me other instructions how i can solve this problem.

 

Thanks. 

0 Kudos
Message 4 of 7
(2,520 Views)

Do you want to run these two VIs only once, each time your main VI starts?

In that case, ensure that when they finish running they output some result (perhaps a boolean value with "is good" or similar), and then just run them both, checking the values of the booleans before continuing.

 

If you want to iteratively call them throughout the program (once per component, for example) consider a State Machine with checking and placing states.

 

If they need to run at the same time as the placement (so that they are continuously checking, and notify when you're in the correct location, etc) then you might want to look into using Queues or Notifiers to pass data between simulataneously running VIs.

 

None of these require call by reference, which sounds like it might only add complexity to your problem.


GCentral
0 Kudos
Message 5 of 7
(2,516 Views)

Yes, I want to run these two VIs only once, each time I start my main VI.

 

Can I do this with the help of the following? 

https://www.ni.com/docs/en-US/bundle/labview/page/asynchronously-calling-a-vi-and-collecting-the-res...

 

Or is this way to complicated and can be done easier?

 

Thank you very much!

0 Kudos
Message 6 of 7
(2,507 Views)

That probably works, but I was thinking something much simpler.

Does this work for you (obviously it's only a demo, with no real functionality, but hopefully it's illustrative...)

 


GCentral
0 Kudos
Message 7 of 7
(2,498 Views)