LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Copy/Paste Event Strucutre

Solved!
Go to solution

8.6 version.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 11 of 20
(1,345 Views)

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.

0 Kudos
Message 12 of 20
(1,330 Views)

I'll do it when i get home. 🙂

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 13 of 20
(1,323 Views)

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.

 

2_Init_GUI_Controller.PNG

 

 

The sub-VI will register for the events they want and handle all of the GUI stuff.

 

7_Get_Refs_In_Use.PNG

 

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

 

3_Check_Valid.PNG

 

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

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 14 of 20
(1,313 Views)

Probably a slightly simpler solution, the GUI VI is fed with information to show and sends events, the 'server' VI controls it all.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Download All
0 Kudos
Message 15 of 20
(1,286 Views)

Yamaeda

 

Please save files in 8.6 version.

 

Thanks.

 

Dan07

0 Kudos
Message 16 of 20
(1,274 Views)

Man, Ben. Those screenshots have gotten a lot of mileage on these forums!

Message 17 of 20
(1,263 Views)
Solution
Accepted by dan07

LV 8.6

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Download All
0 Kudos
Message 18 of 20
(1,240 Views)

@for(imstuck) wrote:

Man, Ben. Those screenshots have gotten a lot of mileage on these forums!


Smiley Wink

 

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 )

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 19 of 20
(1,222 Views)


 

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!

0 Kudos
Message 20 of 20
(1,210 Views)