Jump to content

Example Project in LVOOP


Recommended Posts

Hello all,

I am programming with LabVIEW for around 2 years and was recently stumbled upon LVOOP.

I am required to write a communication protocol to work with a micro-controller, which later will be also used for ATP and debug purposes.
I want to build the program "correctly" from the beginning so it will be maintainable and flexible to additions and changes.

My natural way of building a program would have been a queued state machine, with several loops, each loop is in charge of a different module (one for GUI obviously), but as I stated in the beginning, I want to use LVOOP.

Does anyone have a LVOOP project I can use as reference? I've searched online and found some nice examples, but they are small and teach you the basic stuff.
For me it's important to see the how to use the project tree wisely, where to place the classes, see the managing loop and to learn as much as possible before I create one of my own.

Thanks in advance,
Voklaif

Link to comment
17 hours ago, Voklaif said:

I want to build the program "correctly" from the beginning so it will be maintainable and flexible to additions and changes.

...but as I stated in the beginning, I want to use LVOOP.

I feel like you are conflating OOP with "correct". OOP is a way to accomplish tasks, but it is not the only good way. More to the point, if you don't know much about how to implement it, it seems to be a better plan to code the way you know as a starting point, while simultaneously trying to learn from other example applications what problems OOP solves. Then if you reach one of those problems in your code you can just refactor the code enough to solve the problem. The alternative, deciding "I want to use oop" and then building your code can be successful, but it can just as easily end up in a big mess.

You also appear to consider a queued message handler and OOP as mutually exclusive, which they are not. Actor framework is a queued message handler solution with the message handling components implemented by OOP, but there is nothing stopping you from using a more traditional string-based approach with messages handled by an object, or somewhere in between a la http://sine.ni.com/nips/cds/view/p/lang/en/nid/213091 . In fact, outside of a library like actor framework where the object includes not only your code but also the control flow, you will still always need some sort of control flow structure to give activity to the object. I believe this is what delacor's qmh does although its been a while and I may be mis-remembering, and if you watch mikael's videos you'll see the same

If you want to learn actor framework a good go-to is this https://forums.ni.com/t5/LabVIEW-Development-Best/Measurement-Abstraction-Plugin-Framework-with-Optional-TestStand/ta-p/3531389 which also has various blog posts from Eli about how he built it: https://labviewguru.com/2013/03/28/designing-a-labview-measurement-system-with-multiple-abstraction-layers/

 

Edited by smithd
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.