I have built a large queued state machine (>100 cases). In each state, I run a VI that I have created. These VIs are usually not very different from one another. In many cases, I could simply use the same VI over and over again. There is only one problem with that. None of these VIs know which case to send the program to next. I have to change the value of the "NEXT_CASE" constants in the VI and save it under a new name to be inserted into each new case. Now my program consists of hundreds of VIs whose only difference is the value of their "NEXT_CASE" constants. This causes all kind of headaches when I have to insert new cases into the state machine, and it is just too much for me to deal with.
I need to be able to use a global variable to keep track of the current case within my VIs. I could change it from a string to a number and add or subtract from it to determine which case the program should go to next. Since I'm usually only skipping from one case to the next (or the previous) I could use the exact same VI in most cases. Can anyone tell me how to create a global variable that contains the value of the case in my case structure that I could use within my VIs to keep track of the current case? Let me know if you have any questions.