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.
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.
09-10-2012 06:37 AM
In Event Structures, what is the recommended method for wiring the output of one event case to the input of another event case?
09-10-2012 07:01 AM
Use a shift register to hold the data.
09-10-2012 07:03 AM
Would using a local variable be acceptable?
09-10-2012 07:06 AM - edited 09-10-2012 07:07 AM
Logically it will work.
For every read and write( of Local variable) LabVIEW will allocate additional memory.
The Pros and Cons are many times discussed .A search in the forum will give you more info.
09-10-2012 07:12 AM
gufus wrote:
Would using a local variable be acceptable?
09-10-2012 07:23 AM
Yes, it would. It however depends on your data, if its is only to be used locally (in the same VI) I would use a local of shift register, if there is a chance that the data could be used globally I would select a different method (Functional global, Queue, etc) to pass the data, e.g. in case you decide to use it elsewhere or move some functionality.
09-10-2012 07:56 AM
@gufus wrote:
Would using a local variable be acceptable?
As has been said, locals should be shied away from. If you are using the local specifically for holding data, there are better ways. If you are using it to control GUI, that's a slightly different story. From your quick description, I was say the shift register is what you want.
09-10-2012 10:50 AM
andre.buurman@carya wrote:
Yes, it would. It however depends on your data, if its is only to be used locally (in the same VI) I would use a local of shift register, if there is a chance that the data could be used globally I would select a different method (Functional global, Queue, etc) to pass the data, e.g. in case you decide to use it elsewhere or move some functionality.
Locas have bene discussed quite a bit and there are countless threads which discuss why it is a good idea to avoid using them. While they may be easy to use they lead to race conditions if not used carefully. I would not recommend the advice I quoted above. Eveb within a single VI the use of locals can cause problems and should be avoided.
09-10-2012 11:36 AM
Let me clarify. The Event Structure has four event cases. Each event case is launched by pressing its own independent button on the front panel. There are four buttons on the front panel to handle the four event cases. However, the actions of the third event case depends upon inputs from the second event case.
Right clicking on the event case border does not provide the option to create a shift register. I am at a loss for how one can create a shift register for a Event Structure.
Thanks.
09-10-2012 11:39 AM
@gufus wrote:
Let me clarify. The Event Structure has four event cases. Each event case is launched by pressing its own independent button on the front panel. There are four buttons on the front panel to handle the four event cases. However, the actions of the third event case depends upon inputs from the second event case.
Right clicking on the event case border does not provide the option to create a shift register. I am at a loss for how one can create a shift register for a Event Structure.
Thanks.
Your event structure should be within a while loop. If it is not it is not a very useful event structure since it will only run once for the first event. The shift register would be on the while loop, not the event structure itself.