LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Script the Removal of a Block Diagram in Memory


@paul_cardinale wrote:

The attached files illustrate my problem.  Run Main.vi.  Why do I get error 1073?


Oops.  There were some mistakes in the code to convert from regular to express.  Here's the fixed version.

Still haven't figured out why error 1073 is happening.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 11 of 22
(858 Views)

I think this is impossible.  It appears that when LV converts a regular VI back into an Express VI, it needs to do some edits; but that is impossible if the BD is gone.

An alternate solution could be just to lock the Express VI so it can't be converted into a regular VI.  Might be possible with Basic Object Flags, but I'm afraid of those.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 12 of 22
(851 Views)

Couldn't you just put the authorization VI into a PPL so it's pre-compiled and thus has no BD?

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 13 of 22
(847 Views)

@FireFist-Redhawk wrote:

Couldn't you just put the authorization VI into a PPL so it's pre-compiled and thus has no BD?


No.  That would be equivalent to what I started with.  The options would be on the FP, and thus exposed to hacking.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 14 of 22
(841 Views)

An XNode might provide more options then an Express VI.

 

I'm still not exactly sure what your plan is.

 

I think you want to put a VI on the BD, so that when the calling VI is loaded, the BD is removed or not, depending on some authorization criterium? 

0 Kudos
Message 15 of 22
(826 Views)

wiebe@CARYA wrote:

An XNode might provide more options then an Express VI.

 

I'm still not exactly sure what your plan is.

 

I think you want to put a VI on the BD, so that when the calling VI is loaded, the BD is removed or not, depending on some authorization criterium? 


Here's my plan:  The underlying code checks the authorization and allows the top level VI to run or not (closes the top FP if not authorized).    That code is in a VI without a BD.  But it is wrapped in code that has 3 boolean options that affect the applicability of authorization.  I want to protect those booleans from hacking, thus I don't want them on the conpane or even on the FP.  Making that wrapper VI an Express VI allows me to have those booleans be constants that are set when the developer drops the VI on the BD.  This is pretty good security, but still leaves open a possible hole: If a developer converts the Express VI into a regular VI, it becomes hackable (if it still has it's BD).  Since I can't expunge the BD from the instance of an Express VI, my next idea was just to make it impossible to convert the Express VI into a regular VI.  I've now created a special purpose XControl that detects when its owner has been converted from an Express VI to a regular VI, the converts it back; but I'm not sure I want to go that route.  I'm thinking of a run-time approach instead of an edit-time approach: Just have the low level authorizing VI check whether it's been called by an instance VI, and if not, decline permission to run.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 16 of 22
(821 Views)
The 3rd party licensing toolkit does something similar (break VI execution based on some parameters).

Perhaps studying that mechanism will reveal some tricks? Perhaps it's just a WoT though...
0 Kudos
Message 17 of 22
(799 Views)

Here's what I ended up with.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 18 of 22
(749 Views)

@paul_cardinale wrote:

Here's what I ended up with.


Note the Save:ToBuffer method... Saves you a save.

 

(QD "Save:To Buffer", CTRL+SHIFT+B on a VI method)

0 Kudos
Message 19 of 22
(732 Views)

wiebe@CARYA wrote:

@paul_cardinale wrote:

Here's what I ended up with.


Note the Save:ToBuffer method... Saves you a save.

 

(QD "Save:To Buffer", CTRL+SHIFT+B on a VI method)


Yes, but since this will go in deployable code, I try to minimize my use of brown.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 20 of 22
(720 Views)