03-19-2009 12:04 PM
Hi!
Along these same ideas, are there any good examples of well written code that does all fit on one screen but still encompass really large projects?
The problem I have is that things start small, but then expload into code that gets larger and larger. I have to incorporate a lot of different activities on the same front panel interface. My front panels look great (IMHO) because I'm good at placing things in dialog boxes and utilizing tab controls, but the code behind the front panels tends to get messy.
Things that are typically in my programs:
* Several producer loops, a single consumer loop. I have to take data from multiple interfaces (NI Multifuncitonal DAQ, Thermocouple readers, O-Scopes, DMMs).
* State Machine user configuration and execution code. I've managed to get this all wrapped up in a VI, but still requires its "own loop."
* Temperature controllers
* Pressure controllers
* Switch and other hardware interfaces
* Software UI event-based code
* Networking code (I work with Datasockets a LOT)
Then I have to handle saving changes to the UI (export configuration clusters to XML files, read them at start up and set changes). IDK...I can get all of this working together, but might have 5 or 6 threads running on a single block diagram. All the examples I find are to the point and represent solutions to simple ideas... Yeah, that is easy to make a small VI for. I want to see a good example of a project that is on the same scale as the scope of projects I deal with.
Anyone care to share an example so that me and the OP can learn form that? What about good books?
03-19-2009 12:15 PM
Nickerbocker wrote:...
Then I have to handle saving changes to the UI (export configuration clusters to XML files, read them at start up and set changes). IDK...I can get all of this working together, but might have 5 or 6 threads running on a single block diagram. All the examples I find are to the point and represent solutions to simple ideas... Yeah, that is easy to make a small VI for. I want to see a good example of a project that is on the same scale as the scope of projects I deal with.
Anyone care to share an example so that me and the OP can learn form that? What about good books?
THe forums would not allow me to post a zip with a 1000 VIs even if my boss would allow it and you were willing to read the 80 page word document that discusses the design.
But if you take a look at the code I posted in the Control Reference Nugget you will find one of the re-use functions I use in my applicaitons.
The ideas are the same for larger apps.
One of the biggest suggestions I can offer for keeping your VI small and compact is to work a thorough design before you start coding.
This link has one of my aaps from a zillion years ago broken down so you can veiw the code and documentaion in a web browser.
Q:
Does that link work OK for people outside my domain?
I hope that help,
Ben
03-19-2009 12:25 PM
Ben,
Link works fine.
Lynn
03-19-2009 12:34 PM
http://www.dsautomation.com/doctool/
Didn't work for me.
03-19-2009 01:52 PM
Nickerbocker wrote:* State Machine user configuration and execution code. I've managed to get this all wrapped up in a VI, but still requires its "own loop."
One nice way of cleaning up this problem is by moving the loop itself into that VI. That way, you have a bunch of VIs in your diagram, each of which represents a process. You can place a standard glyph on them to represent this or color them in a specific color.