Jump to content

Parallel Running VI's


Recommended Posts

Hy there....

I'm new here......i'm from Switzerland!

I tell you, because my English isn't very good.... :wacko:

So i have a question:

It's possible to use 2 Vi's parallel.

I programming a Test-Process-VI, who give "go" to the 2nd VI, the desktop of the Test-Process.

And no i will running this 2 VI's parallel.

The data's from the Test-Process-VI give it with Global-Variables to the Desktop, who runs parallel to the Process....

Is this possible to programm in LabView?

I programming on the LV 6.0.2 on windows2K.

I hope that someone can help me about my problem....

Greetings

MWS

Link to comment

Hello!

I think I have an idea about what you're asking, I'll give it a shot and hopefully it's what you're looking for.

1. You are creating a VI that will start a test process and return the results.

2. You are creating a VI used solely for interface functions (display and control).

You have to be careful with globals sometimes when it comes to reading and writing to them from different (simultaneous) processes. Globals can become hard to keep track of if you use them liberally. If you have a scenario where you get 2 processes writing to the same global at the same time, you'll end up with a race condition and the value of the global will not be reliable.

If you're exclusively reading from a global in one process, and writing to it in the other, then you should be okay.

As far as telling the test process to "go", you can use occurrences for that, and then have the process update the global values which you can then read from your user interface routine. If you haven't used occurrences before, check in the 'Examples' provided with LabVIEW 6, they should give you a good idea on how they work.

Using queues is another good method for communication between running parallel VIs, but gets a little more involved if you're not familiar with their use.

If you need any further clarification, or maybe an example, just let me know.

EDIT: I had updated an example LLB, but remembered that you're using 6.0 (I'm using 7 Express).

Here's a screen capture of an example I put together for you. I hope it helps. It shows multi-loop control using notifiers. The red sequence node represents your "process" VI and the bottom while loop represents your interface update routine.

Link to comment

Ok, being the picky bastard that I am, I decided to post a slightly modified version of your example. It is functionally the same however it's slightly improved on code clarity. Feel free to attack my design...

The major change is that I stop the top loop by destroying the notifier Refnum. I check for errors on the wait on notification . Any error (such as a bad Refnum) stops the loop. Another change is that I use the timeout output of the same function to determine if there is a new message. This adds a bit of flexibility since you can easily expand this configuration to decode a number of datatypes (not just a Boolean out). So if there is no timeout that means there is something there... decode it.

I'm not saying that your version does not work, it works well. I always like to program-in inherent flexibility (no matter how small) to accommodate system expansion.

post-10-1088045045.png?width=400

Link to comment

Thanks for your help!!

I have this Ideas during my sleep last night.... :D

So i will make this Procces with two parallel runnig loops and will give the data from the Process to the Desktop with Global Variables.

In the Process i will write the Global Variables and in the desktop-VI i will read the variables...

When i have any Problems during my programming i will write the question in this Forum!!

You are great.....i hope i can learn more about labview in this community...:-)

Greetings from Switzerland

post-10-1088152808.jpg?width=400

Link to comment
Ok, being the picky bastard that I am, I decided to post a slightly modified version of your example. It is functionally the same however it's slightly improved on code clarity. Feel free to attack my design...

The major change is that I stop the top loop by destroying the notifier Refnum. I check for errors on the wait on notification . Any error (such as a bad Refnum) stops the loop. Another change is that I use the timeout output of the same function to determine if there is a new message. This adds a bit of flexibility since you can easily expand this configuration to decode a number of datatypes (not just a Boolean out). So if there is no timeout that means there is something there... decode it.

I'm not saying that your version does not work, it works well. I always like to program-in inherent flexibility (no matter how small) to accommodate system expansion.

You 'picky bastard'. :P

I actually don't use notifiers much and normally do the same, stop loops by destroying the reference, but for something I put together quickly for an example I just did it that way. In my actual programming I would have done it much better. ;)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.