Jump to content

Parallel loop architecture random priority?


Recommended Posts

I made a simple vi that used 2 identical parallel while loops with shift registers doing an increment. Both loops were attached to local variables of a stop button. Did you know that there is no priority and the loops don't run even close to each other! One will run away fron the other :wacko: . The difference ranged from .5 to 1.4 of that of the other loop. Really weird. This is with no wait ms and with a wait ms of 0ms.

Link to comment
I made a simple vi that used 2 identical parallel while loops with shift registers doing an increment. Both loops were attached to local variables of a stop button. Did you know that there is no priority and the loops don't run even close to each other! One will run away fron the other :wacko: . The difference ranged from .5 to 1.4 of that of the other loop. Really weird. This is with no wait ms and with a wait ms of 0ms.
If you add a larger delay like 10ms, you will see they are much closer. Are you running this on LV RTOS?
Link to comment
If you add a larger delay like 10ms, you will see they are much closer. Are you running this on LV RTOS?

Actually with a delay of 1ms it was synced perfectly. What is LV RTOS? Real-time Operating System? If so, I don't know. Maybe this doesn't belong in the Real-Time forum. If that's the case, sorry for the mix up although it's still weird that parallel loops run away from each other with different priority of the same operation... yes/no?

Link to comment

You should never have loops inside your program which don't have some sort of delay mechanism (usually a wait primitive or a timeout). Even an empty loop with no wait can cause LV to get your CPU usage very high and there is definitely no telling what LV will do with 2 loops without a wait statement. If you wire 0 into the wait (tells the loop to iterate if no other process needs the CPU), you will probably see more or less identical times as well.

Real time systems are systems which run on RTOSs (you got that one right) and the special thing about such systems (if built correctly) is that they are always supposed to respond within a given a time period. Unlike OSs like windows which don't give you control, An RTOS will allow you to set your own priorities and be much more precise.

Link to comment
  • 3 years later...

Hi,

Currently, I am having the same problem with 2 parallel loops. One loop I got data from CAN and put data into the queue. The second loop will process data from the queue. One weird thing is if I put the breakpoint in the second loop, it runs. If I don't use the breakpoint, I will not run. Could you tell me what should I do?

Thang Nguyen

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.