LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

transfering a case structure to event structure

Hi, I am trying to transfer case structures that are currently set up to a control that if on prompt the user where to save and then save all following files to that location till end of program and if off the do nothing. I would like to enable these to be switched on and off at any point and know to use an event structure. The problem is I am new to coding with an event structure and have been able to get the button to work but not continuously save. I attached a screen shot of the original case structure and was wondering if someone could show me how to change it to the event structure format with the same functionality. I'm getting a little lost and confused. Thanks!

0 Kudos
Message 1 of 12
(3,986 Views)

Please attach a simplified VI. A gigantic picture showing only a sliver of an event structure is not useful to describe the problem.

0 Kudos
Message 2 of 12
(3,984 Views)

By the way, you should try to follow the unwritten rule of keeping each VI within a single screen.  [Yes, there are varing monitor sizes/resolutions.  You should just be reasonable about it].  Or, at the very least, keep it such that it only needs scrolled in one direciton -- veritcal or horizontal.  Having it extend in all four cardinal directions will be nearly impossible to manage and will be impossible for anyone else to easily read/follow.

 

You can create subVIs for large segments of code - especially if it is reusable code.  You can highlight any segment of code and go to the "Edit" tab and select "Create SubVI".  Read more here.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
0 Kudos
Message 3 of 12
(3,980 Views)

I was given this code from another person and have since been trying to achive that. Also for the screan shot the 'sliver' of the event structure that you see does not pertain to my question. What I am interested in was the now highlighted in red case structures being turned into event structures with the previously mentioned functionality. 

0 Kudos
Message 4 of 12
(3,966 Views)

It is a really bad idea to bury event structures deep inside sequences. Event structures should be in a toplevel loop and always ready to react. I don't understand your question.

 

This entire thing needs to be recoded as a proper state machine instead.

Message 5 of 12
(3,955 Views)

I am fairly new to this style of coding (only been at it for a few months) can you give me some examples of how to do that or write the logic out a little? I know a state machine is a while loop with a case structure inside but I am just worried that something will get messed up with the other functionalities of the program if I try to recreate this.

0 Kudos
Message 6 of 12
(3,950 Views)

Could really use some help on this please.

0 Kudos
Message 7 of 12
(3,923 Views)

Since these buttons are polled anyway, an event structure seems incorrect for this scenario. It is too difficult to give more detailed advice by just looking at an image of a code fragment.

0 Kudos
Message 8 of 12
(3,918 Views)

I can't attach the vi due to the size and I do not think a simplified piece of code is going to help. I did however go through and stitch two jpegs together of the main two sequences. hopefully this gives a better idea of what I am trying to do and where to go from here. thank you.

Download All
0 Kudos
Message 9 of 12
(3,900 Views)

Any ideas would be extremely helpful. Thanks.

0 Kudos
Message 10 of 12
(3,876 Views)