02-15-2016 07:34 PM
I would like to create a wrapper for a VI where a user will have contol over certain inputs and access to certain outputs, but not be able to see how the VI is actually implemented. What is the best way to do this?
Solved! Go to Solution.
02-15-2016 08:06 PM
02-15-2016 08:22 PM
You can password protect the diagram, but that can potentially be cracked
You can built the code into a dll using the application builder and place that insde a subVI.
You can remove the diagram. Removing the diagram will not allow the VI to be edited or upgraded to a new version.
HOWEVER:
It is better to keep code public so everybody has a chance to debug and potentially improve it. Secret code is typically much less trustworthy.
Most often, code is kept secret out of embarassment and to hide ugly code from sight.
A better LabVIEW programmer will not be fooled. We know better than to judge a VI by its shiny front panel. 😄
02-15-2016 09:07 PM
Is there a way that I can pass a variable between a sub vi and the main vi. For example I want a while loop to control something in the sub vi and I want a user to be able to stop it by clicking a stop button on the main vi.
02-15-2016 09:21 PM
Yes, there are plenty of ways.
Maybe start by explaining what you have in mind in general. What is the purposse of all this? What are you trying to achieve?
02-15-2016 09:27 PM
I use two method for what you want in this vi
I hope it could help you
but I am strongly agree with what altenbach told to you
02-15-2016 09:32 PM
I have a function inside a sub vi that needs to be in a while loop in order to get data from a device. I cannot have the while loop on the main vi because certain functions inside the sub vi should only execute once. The function inside the while loop will continuously read frames from a device until a user input (pressing stop).
I have thought of two ways to potentially solve the issue:
1. To create a boolean variable that can be changed in the main vi and will control the while loop.
2. Use a while loop in the main vi and use a case statement or state machine to make certain functions only execute once.
02-15-2016 09:37 PM
The problem with that code is the while loop is in the main vi and I think I want it in the sub vi
02-15-2016 09:38 PM
The problem with that code is the while loop is in the main vi and I think I want it in the sub vi
02-15-2016 09:57 PM - edited 02-15-2016 10:13 PM
if you want have while loop inside the subvi you have to make more complicate code I present you two method why you just not use both of them to hide loop too?
just copy and paste white image in diagram and hide that loop behind it insert some other vi code inside the loop for backtrack like timing vis
and if that person again find the subvi
he is cleaver and could write that vi his self and no need that vi 🙂