LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do i code a txt file

within labview i produce a txt file.to make sure,nobody can change the data laterone, i like to code my data with a password.How?
0 Kudos
Message 1 of 5
(3,257 Views)
It depends...
- first, what OS are you using
- second, what is the requested level of protection
The operating system may allow you to restrict the access to that file (for example, just read permission). Maybe it's enough to set the read only attribute if you are using Win9x (and you want just to avoid accidentally change of the data).
Your idea sounds more like a cryptographic approach where the password is actually the KEY (do a search on the web and you'll find many details).
In addition, the CRC can be a solution too, as well as protected archives (with password).
Hope this helps … at least as a starting point
0 Kudos
Message 2 of 5
(3,257 Views)
How can I set the read only attribute from labview, when safeing a file?

What is the CRC?

Sorry I'm German and do not understand all the abriviation.
0 Kudos
Message 3 of 5
(3,257 Views)
1. In File I/O -> Advanced File function you have Access Rights. You have to pass the rights via first 8 bits of 'new permissions" input value. It uses UNIX format for file attributes (user/group/others). In windows, use just bit 7 for user WRITE - set this to 0 and that means Read Only. I don't know if you can find this VI in LV different from 6.
Another way to do it is to use a Shell Exec.VI with a shell command - in windows will be ATTRIB +R . You can find details in LV Help(Setting Permissions) and MS-DOS Prompt (ATTRIB /?)"

2. CRC (Cyclic Redundancy Check) is an algorithm used for error detection. You can apply it in your case in order to check any file content change. Anyway, this cannot prevent the modification of the file. Yo
u can find details here [http://www.relisoft.com/Science/CrcMath.html].

good luck!
0 Kudos
Message 4 of 5
(3,257 Views)
Well, if you will be accessing the data ONLY from within LabVIEW then there are some possibilities for prompting an operator to enter a password to open the file. You just match the password with one that is saved inside the file.

If someone can just launch explorer and open the file in notepad then you have to protect even further by using some form of encryption to scramble the file. Then you can force them to use LabVIEW to view your file.

You have to determine how devious your operators may be. Even if you make a file read-only, it can be changed to RW from explorer very easily.

Michael Aivaliotis


Michael Aivaliotis
VI Shots LLC
0 Kudos
Message 5 of 5
(3,257 Views)