03-21-2016 01:50 PM - edited 03-21-2016 01:52 PM
Hi all.
I've been using LabVIEW a lot since 8.6 (using 2015 now though) and I'm finding myself reinventing the wheel a lot. The more comfortable I get with LabVIEW, the more I start looking into how get the job "done right" versus just getting the job "done." Unfortunately I cannot access LabVIEW on my networked machine, so screencaps aren't possible. So here's my scenario (simplified down a bit):
=============================================================
My Situation
=============================================================
Let's say I have 6 Setups:
-Varying numbers of Relays, AI, AO, DIO, etc.
-Each Setup can be PXI w/ MXI, PXI w/ Internal Controller, cDAQ, or cRIO w/Network Streams.
For the sake of simplicity, let's act like the front panel for all 6 systems contains:
-An array of Boolean Controls for the Relays
-A Multiplot for the AI
-An array of Cluster [ Boolean (DIO Output), Boolean (DIO Input) ]
=============================================================
What I do now
=============================================================
For each of these systems, I have a "System_XX_Relay" "System_XX_AI" and "System_XX_DIO" vi, where XX is unique for each system.
For each Relay in the system, I manually hard-code map each Boolean Button to its SPECIFIC Relay (IE: Power on NI XXXX Slot 1, Relay 0.)
For each AI in the system, I manually hard-code map each line on the graph to an AI (IE: PowerMonitor on NI XXXX, Slot 1, Ch 0 )
For each DIO in the system, I manually hard-code map each item on the cluster to a line on its SPECIFIC DIO card (IE: Start Test on NI XXXX, Slot 2, DIO 3.)
If I copy System_XX_Relay from 1A to 1C, it won't work. It's looking for a card that isn't there, and it isn't using Network Streams. Etc.
=============================================================
What I WANT to do
=============================================================
1) Universal UI and "Host" Program between all 6 devices.
2) Reads in .xml to map Controls/Indicators to its respective interface
3) Uses updatable Libraries for each singal type with an identical interface in "Host."
4) Allows libraries to be updated across all Setups even if they aren't using the new modules
---- Ex: Relay V1.0 may only provide support for 2 Relay Cards. If I have a system that needs a new Relay Card, I can update to Relay V1.1 then I can deploy V1.1 to my existing systems even if they aren't using the new devices
=============================================================
Why I want to do it
=============================================================
1) Portablility, obviously. But Portability with traceable CM.
2) Reduce production time for the next device/setup combination.
=============================================================
Where I've made it thus far
=============================================================
My first thought is to use LVOOP.
1) Have a Library containing a Class of "Relay" which will contain Daughter Classes for each Type/Topography I support and translate the agnostic input (say, String) to the appropriate driver.
2) Have a plaform-agnostic "Control" Program that will use the Methods of the Classes to control the hardware
3) Have a platform-agnostic "Mapping" Routine that will use the Methods of the Classes to map Front Panel objects to their respective hardware
(future)
4) Implement a "Record" feature using a FGV within the Method calls.
5) Implement a "Playback" feature that will use the Recording to Automate a Recording.
=============================================================
Where I need help
=============================================================
Still with me? You're awesome. Gold star.
1) Will this accomplish what I want? Am I headed in the right direction?
2) If I support a device that isn't present on the system, will it be runnable so long as I don't use that daughter device's Methods?
3) Would xml be the best program-external way to configure device mapping? I've never used LVM, should I try using that instead?
(future)
4 & 5) Is there a way this can be added after-the-fact allowing my V1.x "Control" program to use the V2.x class libraries just without Recording/Playback feature WITHOUT any changes to "Control.vi"?
ALL) Are there any NI courses that covers this kind of instrumentation and higher level architecture program design?
WOW. That was a marathon, but thank you for reading this. Any help would be greatly appreciated. If clarification is needed let me know and I'll.... draw something up in MS Paint or something. (I hate not having LV on my networked machines.)
03-22-2016 10:49 AM
I'll admit to not reading your post thoroughly, as it was more than I feel like handling at the moment, so I'll be somewhat general:
03-22-2016 11:03 AM
It sounds approximately right at first glance.
Obviously, when instantiating your specific relay objects, yous string input should not only select the driver but also the specific hardware address so that you only need to maintain a single class for all relays of a single type. Same for the AI and others.
So:
1) Yeah, should definitely be doable
2) Depends. If the driver depends on a driver which whose absence will break any methods, then you at least need to have the driver installed. this is only a problem if the class in question is hard-linked to your program (factory method via object constants for example).
3) Personal preference. Go with whatever you're comfortable with. This is perhaps the least important part of the design. To be even smarter, wrap the save and load routines in a class of its own so that you can change it at a whim's notice if need be.
4&5) I dunno, it depends on your Control.vi. Without change is probably not doable. Your objects need to come from somewhere..... Unless you wrap your concrete VIs around the new objects.
Shane