01-25-2011 02:28 AM
8.6 version.
/Y
01-26-2011 03:17 AM
Yamaeda
The file is now opening into my Labview but since this is my first time working with registered events (passing data from one VI to another) I am not able to pass the data from the GUI VI to CODE VI and send it back to GUI VI. Could you elaborate the example a little bit more? Just create two GUI VIs that "send" events to a CODE VI, and get data back (to feed indicators, for example).
Thanks a lot for helping me.
Dan07.
01-26-2011 04:48 AM
I'll do it when i get home. 🙂
/Y
01-26-2011 07:31 AM
Sepearting the logic from the GUI is the aproach I would take.
The top level VI can be very simple just gathering up the control refs and calling the sub-VI that does all of the work.
The sub-VI will register for the events they want and handle all of the GUI stuff.
So if you need to make code changes, you make the change in one VI.
If you need to add to the GUI, then of course you will have to add it to every version of your GUI and wire-up the refs but if you check your refs
You will know at run time that you forgot something.
Note:
Thos images used;
Action Engines - to allow data sharing while avoiding race conditions.
type-definitions - to keep my data structures consistant
dynamic event registration - to be able to use events structures in a sub-VI to handle GUI stuff.
Ben
01-29-2011 01:17 PM - edited 01-29-2011 01:17 PM
Probably a slightly simpler solution, the GUI VI is fed with information to show and sends events, the 'server' VI controls it all.
/Y
01-29-2011 03:20 PM
Yamaeda
Please save files in 8.6 version.
Thanks.
Dan07
01-29-2011 10:49 PM
Man, Ben. Those screenshots have gotten a lot of mileage on these forums!
01-30-2011 10:25 AM
LV 8.6
/Y
01-31-2011 07:24 AM
@for(imstuck) wrote:
Man, Ben. Those screenshots have gotten a lot of mileage on these forums!
The look and feel of large apps (1000+ VI or 1500+ LVOOP) is an area of LV that has scarce few examples for people to look at. Try to express it a different way...
Looking at LV as if it was English...
There are many examples that will show us how to construct sentances and some that explore how to assemble paragraphs but sadly the "good" novels are all locked up behind priprietary walls.
Large scale application architectures and design and implementation has been one of my interests going back to before the forums were started and has remained one to this day. The flying spagetti monster is what results when many (not all) people approach LV coming from other languages. By repeatedly showing that LV code can be clean and easy to understand I hope to encounter less LV code that tells me more about what the developer did not know and more about what the app does.
Another thought...
When control references were introduced, we were givien the ability to interact with the GUI from sub-VIs. This was a radical change since previously attribute node HAD to be on the diagram of the VI that owned the control. For the most part they were not recognized for the impact they had on code structure and implementation. When the dynamic event registration was introduced, NI allowed us to cut the strings coupling the code from the GUI. This change let us "turn on/off" events when and where we needed them. With static events we had to code the events that only applied to specific modes such that they only acted if in the right mode (or if the code was less that optimal "mood").
So the song I am trying to sing when I break out those images repeatedly is one that does not come from the NI course or many of the examples.
Sorry if I read like a broken record. Should I grab similar screen shots from other projects to vary the images a bit?
Ben
(Previously known as the LabVIEW Evanglist )
01-31-2011 10:41 AM
Ben wrote:
Sorry if I read like a broken record. Should I grab similar screen shots from other projects to vary the images a bit?
If it gets the point across (which it does), why change it? Then again, new examples are always fun to look at!