09-09-2005 05:36 AM - edited 09-09-2005 05:36 AM
메시지가 09-09-2005 05:39 AM에 labmaster에 의해 편집되었음
09-09-2005 06:32 AM
First of all, yes event structures are not only in the "base" version of LV. But given the number of other things that NI excludes from that package I can't imagine anyone doing any sort of serious work with it. I've always seen the base version as a very high-priced demo package...
Second, if you structured a real program like that example, there would not be much reason for using events. However, most real applications would typically only have just the one loop to handle the event. The event would be triggered in either other VIs (by passing the event reference to them as a parameter) or in other events in the same VI. The attached shows one such possibility... With this you type characters into the input string until you press the return key. The code detects this character and generates the user event to transfer the data to the output display. Replace the output string indicator with a VI that sends a command string to an instrument, and you can see why you might want to do this.
Third, never forget to incorporate error handling in event structures, other wise you can be left in a situation where you can't exit the event loop because an error prevents you from generating the event required to exit.
Mike...