LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

messing up block diagram code

Dear Labview Programmers,
                                                I have a querry regarding block diagram. Suppose I developed a code in labview, my aim is when somebody sees my code they should not able to make out how I did the programming, In the sense that it should be in a messed up condition. But I want to work with the program I have to get back my program in a crystal-clear way, if somebody sees they should not. I should not use password protection to my block diagram, because they have to see my block diagram but difficult to understand.
 
                Any solution to this querry will be invited.
 
Labview Lovers
0 Kudos
Message 1 of 19
(4,262 Views)
You can turn off "auto grow" on some structures and then hide your code inside case statements, etc. This is one of the nastiest things you can do.
0 Kudos
Message 2 of 19
(4,243 Views)

I don't understand your reasoning for not using password protection. What's the point of someone being able to see your code if they're not supposed to be able to understand it?

I can think of some reasons to do this, but I don't like any of them. For the valid reasons I can think of, password protection should work.

You probably could write some code (using VI scripting for removing comments and inlining the hierarchy) which will create an obfuscated copy of an existing VI or VIs, but I really don't see the point.


___________________
Try to take over the world!
0 Kudos
Message 3 of 19
(4,241 Views)
Hi Shivkumar,
 
In accordance to what you are asking for, how would LabVIEW know if it is you or someone else looking at the code without using a password? Without it, LabVIEW would not be able to distinguish between users.
 
And regarding the code being in a "messed up condition", we generally advise programmers to make their code scalable, readable and maintainable and it is a feature which has not been considered.
 
Best Regards,
0 Kudos
Message 4 of 19
(4,237 Views)
You can put a sequence structure that covers your code. And you can then add some "fake" code in this structure. If somebody looks the code, they won't see the real code, and if you want to modify your code, just move the structure...
 
But the easiest (and best) way to protect a block diagram is password protection and i dont understand why not use it.
0 Kudos
Message 5 of 19
(4,235 Views)


 


@Shivkumar wrote:
I want to work with the program I have to get back my program in a crystal-clear way, if somebody sees they should not.


To me, the question itself seems to be absurd. Smiley Mad

The purpose of LV itself is to tell the programmer "Seeing is believing". Smiley Wink

Whoever sees the code can understand the whole process even without a proper project document.

If for any sake you want to achieve the above thing, there are always the Password protection & the Remove diagram features. Smiley Happy

 

- Partha ( CLD until Oct 2027 🙂 )
Message 6 of 19
(4,236 Views)
You could throw quite a bit of bogus and long-winded "Rube Goldberg" code down on your block diagram and using the "set color" tool color, change the color of the diagrams to say red, then get yourself some red tinted glasses for when you want to work on the code...
 
Or you could just take a screen capture of some code (I reccomend any ActiveX code from the Dev Zone) then paste the image on your block diagram. Of course, if somebody goes to modify any of it, they might realize it's a picture and you are hosed.
 
Or lastly, you could setup really powerful and ever-changing magnetic field around your monitor to make the picture all wavy. Hide a secret "power off" switch in your copy of LabVIEW for Everyone. Your CRT might exploded however.
 
 
Message 7 of 19
(4,209 Views)
The whole idea of messing up the block diagram is really, really, dumb idea. Any experienced LabVIEW programmer will be able to undo whatever you attempt anyway.
Message 8 of 19
(4,204 Views)

I agree that messing up your code on purpose is an odd request but if you really want to do this...

Scripting can be used to first locate all of the objects on a diagram and record thier postions.

Then (still using scripting) select all and do an allign right followed by an allign at top.

When you want to edit the code, run the inverse scripting code to put everything back where it was.

I still thenk the password or phoney code image are better ideas.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 19
(4,183 Views)

This has got to be the silliest request in a while. 😮

Are they allowed to look at the code? Are they allowed to run the VI? Are they allowed to use execution highlighting?

 

Long ago, we discussed "obfuscated code" and got a nice collection of examples. Here is a link to the old thread:

http://forums.ni.com/ni/board/message?board.id=BreakPoint&message.id=5

For example, have a look at JeanPierre's HelloWorldJP.vi example. Can you tell what it does by looking at the code? Probably not!

 

Here's an idea: search the forum for the ugliest oversized diagram and take a screenshot. Place it as background image behind your code in the diagram (don't place it in front or you violate your requirements to have the code visible).

 

In general, the code should be undestandable. If certain aspects consist of some proprietary algorithm, they should be isolated in a passworded subVI or even made into a dll.

0 Kudos
Message 10 of 19
(4,150 Views)