From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-22-2020 11:35 AM
So I was working on a project where I used LabVIEW to communicate with a device and wrote a bunch of commands in a Functional Global and used Test Stand to select the Action of the FG and so forth... And I got to thinking, is this really the best option?
Here's my thoughts:
LabVIEW is my native language, so I would prefer to code in LabVIEW. But loading a FG into Test Stand has its limitations/faults. Really the biggest flaw/fault is that your data inputs are static. I put a detailed How-To in the description to explain which data types are required for which actions. But at the end of the day, a FG is not the same as a DLL where I can create a massive DLL, load it into Test Stand and I now have access to every function and its related data types. I won't have some Double that's meaningless for some actions. Now, no, I would never compare a FG to a DLL, but I was thinking, in LabVIEW, what's the equivalent?
How can I write a complete driver for a device in LabVIEW and be able to load a single item into Test Stand? I don't want to load individual VIs and be sure to carry them around. Would I load a LLB? I've been trying but Test Stand is giving me issues with LLBs and from what I'm reading, they're frowned upon anyways. Would a Polymorphic VI complete this task? That seems like a lot of tedious work. Any thoughts? Is the answer pretty simple?
09-22-2020 12:21 PM
What I do is build my drivers, libraries, etc. into Packed Project Libraries. This is a built library, so it cannot be edited by the user.
Now for your FGVs, you need to make a library for the FGV and make the FGV private. The idea here is that nobody outside of the library can directly access that FGV. You then have a bunch of wrapper VIs to perform whatever actions on the FGV. For example, you have a power supply driver based on a FGV. The tasks include Initialize, Set Voltage, Set Current, and Set Output. So you should have a VI called Initialize that only brings out the controls and indicators required for that task. Similar for all of the other tasks. So your TestStand sequence accesses these VIs and doesn't care that there is a FGV under the hood.
09-22-2020 12:52 PM
Hey, so I've never heard of a Packed Project Library. I was reading on it and it looks exactly like something I've wanted to use for years. Unfortunately, this project requires 2009. Is a PPL something new? Like LV 2018 new?
09-22-2020 01:17 PM
@DailyDose wrote:
Hey, so I've never heard of a Packed Project Library. I was reading on it and it looks exactly like something I've wanted to use for years. Unfortunately, this project requires 2009. Is a PPL something new? Like LV 2018 new?
PPLs have been around for awhile, but I don't think for 11 years. But my advice on libraries and a private FGV are still quite valid.
09-22-2020 02:49 PM
@crossrulz wrote:
PPLs have been around for awhile, but I don't think for 11 years. But my advice on libraries and a private FGV are still quite valid.
So I get what you're saying about the FGVs, but it still leaves me loading individual VIs. Could I throw them into an LLB and load that into Test Stand and pick from there? Cuz I don't think I can do the PPL. Or is it at all extreme to use Polymorphic.
09-22-2020 03:30 PM
Just dawned on me...... A Variant! Is that farfetched? And then depending on the action, it'll modify the variant to the appropriate data type!
Is that ridiculous?
09-23-2020 05:33 AM
@DailyDose wrote:
Just dawned on me...... A Variant! Is that farfetched? And then depending on the action, it'll modify the variant to the appropriate data type!
Is that ridiculous?
Yes it is ridiculous. From an API standpoint, a variant does nothing but confuse the user. I can tell you from experience, you do not want to do this.