LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timed loop vs While loop in time critial VI

The compilation error (broken arrow) was for subVI 'Cm Process Events'.  So I changed the priority of this subVI to 'normal' and I no longer have the compilation error. 

 

But I still get the deployment error "... loaded with errors on the target and was closed" for another subVI, 'CmTime Init.'  This subVI is somehow, via the project, connected to a third subVI 'CmTime Handler.'  'CmTime Init' does not call 'CmTime Handler' and I can't delete 'CmTime Handler' from the project.  'CmTime Handler' is not called by any other VI.  I'm thinking that if I can delete this 'CmTime Handler' it will cut the connection with 'CmTime Init' and it will deploy.  How do I delete 'CmTime Handler?'

0 Kudos
Message 11 of 19
(1,797 Views)

Zip it and attach.  as a *.zip file   Again, you are at the computer-  We can't see your code


"Should be" isn't "Is" -Jay
0 Kudos
Message 12 of 19
(1,789 Views)
Message 13 of 19
(1,770 Views)

I will look at it tomorrow.

 

Im at a Hojo this evening.  None of us wants me to go through their unsecured wifi.  

 

With that said,. I want to question why.you would use a timed structure AND. Change execution of a VI?  Really, it makes no sense to apply a new execution system that is single threaded AND try.to force.that single.thread to be at a priority other than " between atomic and time critical"

 

This is coming up frequently lately..  some prof needs to message the board


"Should be" isn't "Is" -Jay
0 Kudos
Message 14 of 19
(1,756 Views)

I have created a new project with just the VI causing the deployment error.  It deploys and runs just fine.  Please notice that the missing VI remains missing in the new project.

0 Kudos
Message 15 of 19
(1,739 Views)

Not looking into the issue of the OP, but commenting on this:


crossrulz wrote:

Timed Loops have their own thread pool and execute at a higher priority than Time Critical.  [...]


That is not correct. Short story: Priority of timed structures is between "Above Normal" and "Time Critical" (see here).

 

Long story (in the link):

LV provides an extra scheduler for 'tasks' (officially called 'clumps') which assignes these tasks to different threads. LV spans multiple thread pools for "Preferred Execution System" and "Priority". The scheduler will distribute the clumps accordingly to the threads and forward the threads to the OS scheduler (Windows/Mac/Linux). For RT, the LV scheduler is the one and only scheduler as it is part of the OS.

 

EDIT: The content of one timed structure results in a single clump and that clump is executed in a thread spawned specifically for that timed structure. The content of a (normal) While Loop can be split up in multiple clumps and hence distribute to multiple threads to run in parallel but have to be synchronized accordingly. For large contents, While Loops therefore result in a better CPU usage (multiple cores) compared to timed loops.

 

That being said, having a VI configured for "Time Critical" containing a timed loop (TL) makes no sense, as the TL would reduce priority, not increase.

Personally, i would expect the compiler to NOT COMPILE VIs at Time Critical Priority which contain TLs. LV 2017 doesn't accept this (broken arrow), but previous LV releases might have had bugs regarding this specific item.....

 

Note that the help states: Having a timed structure placed on the same block diagram as a time critical subvi can lead to unexpected behavior. That is not the same as "placing a timed structure WITHIN a time critical vi....

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 16 of 19
(1,729 Views)

@Norbert_B wrote:

crossrulz wrote:

Timed Loops have their own thread pool and execute at a higher priority than Time Critical.  [...]


That is not correct. Short story: Priority of timed structures is between "Above Normal" and "Time Critical" (see here).


It must have been the Scan Engine I was thinking about.  Nobody's perfect.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 17 of 19
(1,719 Views)

enclosure for support

 

0 Kudos
Message 18 of 19
(1,691 Views)

let's try this attachment again

0 Kudos
Message 19 of 19
(1,669 Views)