JPrevost Posted January 30, 2006 Report Share Posted January 30, 2006 Is there a way to fire an event programmatically? Ex; I open a file from a config file and put that data into an array indicator. From there I write and read using a local variable (don't worry, no chance of race condition). During the vi's running a user might change the file they want to use and so as an event I have a "value changed" event driven off of the file path change. This then fires code to load the array and do some work with it. The problem is I have that same code that does some work going on at the start of the program if there is a file found in the config file! There is now 2 repeats and no, this isn't something I can put into a subvi. The binary file data is read to a 3D chart and another loop with indicators on the main VI. My only other idea is to add another event for this case. So at the start if the binary file path is found in the config file it'll change a boolean indicator which will then fire that event of code. The only trouble with this is the location. I have the config file code as the first frame of a sequence structure with the main program loops (including event loop) running in the frame after. So this wont' work :headbang: . AAAAHHHHHHH No wonder there are programming teams. Teams being the key word. Quote Link to comment
yonatan.tidhar Posted January 30, 2006 Report Share Posted January 30, 2006 If i get you right what you need is state machine withe "load data from file" state. this state should be called at program start up (initialize) and then call it again when from your "value change event". look at the Standard State Machine template from the New.. menu. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.