07-07-2010 10:57 PM
Hi all,
I am currently developing an application to accquire and display truck weights off a weighbridge. The weight data will be passed over a serial port. Currently I have 2 VIs, a 'StartUp VI' and a 'UserInterface VI'.
The StartUp VI launches the application, establishes a connection to a SQL database where the weight data will be stored, launches the serial driver to accquire weight data from the weighbridge and finally launches the 'UserInterface VI'.
The UserInterface VI is the main window from where the user can perform tasks. Thus it will be handling all user generated events.
When the UserInterface VI is called, the StartUp VI is hidden and it continues to run transparently. It needs to keep running because it handles communication with the weighbridge over a serial port.
This is where things get difficult for me.
My application needs to send the data to the SQL database everytime it detects a stable weight and display it on the UserInterface VI. In other words, initially there will be fluctuating readings coming in over the serial port. But overtime the reading will become stable. The StartUp VI needs to receive the full range of readings and generate a dynamic event when the reading becomes stable. This dynamic event then needs to trigger a particular case in the UserInterface VI and run it. Also I want to be able to do the reverse i.e, have a user event in the UserInterface VI trigger a dynamic event in the StartUp VI.
Further more, at runtime I am calling the UserInterface VI using a static VI reference and the RunVI invoke method.
I have never used dynamic events before. I am not even sure if it is possible to trigger dynamic events across 2 separate VIs the way I want to. If someone could help me out with this, I'd really appreciate it.
Regards.
07-08-2010 03:32 AM
hi tdog,
Suppose if you are calling userinterface vi from startup vi,then you can use the userinterface vi as an vi reference.For that VI reference you can very few events if you want to use those as userdefined events....Also there is no compulsion to use event structures if you want data transfer between those two vis,where you can accomplish using global variables ....
Thanks and regards,
srikrishnaNF