From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event structure vs case structure

Solved!
Go to solution

nkhoa wrote:

To further illustrate my previous point, please see the newly attached image. 


There is insufficient information, because we don't see what's in the other cases and we don't see what the other events are, e.g. what's in the timeout event? Running a "transparent" event (i.e. one with a fast, but empty, timeout") is completely pointless, it basically is just a glorified case structure.

 

Please answer the following questions:

Are the cases independent, i.e. can there be more than one boolean true at any give time (causing more than two cases containing crucial code to run in parallel? can action1 and action2 occur simultanously or can only one execute at any given time?

What's in the timeout case?

How long do the various actions take?

0 Kudos
Message 11 of 15
(991 Views)

@altenbach

 

Time-out event = polling position from a serires of motor encoders

 

Case-structure are indenpedent . Some of them cannot run in parralel. For example, two of the case structures will spin off another sub-vi that runs for 10 minutes during which nothing else can run. 

 

Thanks!

 

 

0 Kudos
Message 12 of 15
(951 Views)

nkhoa wrote:

Time-out event = polling position from a serires of motor encoders


So it should not occur of events constanty get triggered? Shouldn't that be on the main loop diagram instead so it is independent of events?


nkhoa wrote:

Case-structure are indenpedent . Some of them cannot run in parralel. For example, two of the case structures will spin off another sub-vi that runs for 10 minutes during which nothing else can run. 


Define "spin off". What is the meaning of "nothing else"? Not even the code shown? If this is true, you should NOT have an event structure, because it will not be able to react to events, will potentially lock up the front panel, or will potentially queue up millions of events without being able to service them.

 

It seems to me that your entire architecture is highly flawed.

 

 

0 Kudos
Message 13 of 15
(942 Views)

"spin-off" as open up a subVI running approximately 10 minutes during this time, I can't do anything on the main front panel. 

 

Yes, it seems flawed. 

 

I can't copy/paste the entire VI up here but I can make more detailed illustration. 

 

Thanks!

0 Kudos
Message 14 of 15
(936 Views)

@nkhoa wrote:

"spin-off" as open up a subVI running approximately 10 minutes during this time, I can't do anything on the main front panel. 

 Yes, it seems flawed. 


No program have I ever used, that will take control of the UI for 10 minutes, without causing me frustration.  Heck if my UI isn't responsive in 200ms users usually get agrivated.

 

I highly suggest you redeign your application to respond to the user in a way that is more intuitive.  It sounds like you need at least two loops running.  These can be Actors, or two actual while loops that communicate with some messaging scheme to get a status update, and command actions.

Message 15 of 15
(904 Views)