03-17-2020 12:40 AM
Hi all.
Running a new compiled version of my program (LV 2016) which appearred to be fine in testing.
However today it display these errors
this occurred at the write phase of the run followed by
This seems to indicate an issue with Windows 10 security. I have updated C drive security access to allow the application full rights (read/write etc).
I've also added the whole project so if the issue is mine please let me know.
Solved! Go to Solution.
03-17-2020 01:51 AM
Hi Greg,
there are file permission errors: the first check would be to make sure the file path you try to write to is correct!
Did you probe the file path?
You really should improve that program to use less global/local variables, more shift registers in your statemachine, avoid race conditions (like in ValveCntrlData), organize all VIs into the project, …
03-17-2020 02:09 AM - edited 03-17-2020 02:13 AM
(I agree with the comment about all the glaring race conditions due blatant local variable overuse. Also watch out for terminology. LabVIEW is always "compiled" even if you run your code inside the development system. I assume you probably mean "built as executable".)
You specific problem is the following code:
03-17-2020 04:45 PM
thanks Gird,
Not sure what probing the file path means.
The directory does exist on the C drive at "C:\Valve_Controller_v4\Result".
I'm assuming that it has been written with variables and is pointing somewhere else.
I will dig deeper as in the following email and see what it means.
thanks
Greg
03-17-2020 05:11 PM
thanks Knight,
makes sense, yes it is an executable.
Can't find anything as you have displayed "Data" but this
"Logfilepath", how can I read it or set it as a constant eg "C:\valve_controller_v4\results" just to get things running.
My main issue is I work 3 days a week, and have no formal coding training in this software and am unlikely to get any training.
So I'm flying blind.
All the comments about structural issues are correct but I can't fix them.
sorry a little stressed.
Greg
03-17-2020 05:18 PM
A probe is a basic troubleshooting technique in LabVIEW. Right click the wire that contains your path and select "probe". A window will appear that will show you its actual value during execution.
As the others have said, its a file permission error; here are a few options.
1) the file path is incorrect ( a probe helps check this here)
2) your trying to create a new file but you have "open" wired to the "operation" terminal of the open/create/replace file vi
This requires that it already exists. right-click the "operation" terminal and choose create constant. you'll get an enum constant that you can change to "create/replace"
3) "C:\Valve_Controller_v4\Result" is a folder path, not a file so make sure you are including a file extension like .txt or .csv
03-17-2020 05:30 PM
Hi,
As the others have said, its a file permission error; here are a few options.
1) the file path is incorrect - understand this ( a probe helps check this here) don't understand this comment
2) your trying to create a new file but you have "open" wired to the "operation" terminal of the open/create/replace file vi
This requires that it already exists. right-click the "operation" terminal and choose create constant. you'll get an enum constant that you can change to "create/replace"
Sorry don't understand your comment
3) "C:\Valve_Controller_v4\Result" is a folder path, not a file so make sure you are including a file extension like .txt or .csv
Yes I was hoping just to set the folder path to that
When you set it running, it asks you to name the storage data file which we do.
But once it gets to the end of the first data write it pops back up requesting a file name, and each subsequent data write does the same. At no stage does it appears to write a data file in any folder.
hope that helps
Greg
03-17-2020 06:45 PM - edited 03-17-2020 06:46 PM
@Greg1956 wrote:
Can't find anything as you have displayed "Data" but this
"Logfilepath", how can I read it or set it as a constant eg "C:\valve_controller_v4\results" just to get things running.
As my link clearly explains, you need to strip once or twice, based on the execution environment (exe or dev env.) or use the one of the other listed workarounds.
Did you read my link above? You log file is based on the current VI path, which changes once it is inside the excutable.
Look in the main program, case "1". There is a subVI called V_C_log_initialize, this sets the global variable for the log file path to:
"<current VI path location (i.e. vi path stripped of the VI name)>/data"
Once it's inside the executable, the VI path is "... xxx/application.exe/vi name" and after stripping the name, you are trying to create a path as "...xxx/application.exe/data", which is of course nonsense. you cannot build a folder inside or after the exe!
Also, please give your data file an extension (e.g. call it "data.dat" or whatever). It's less likely to collide with a folder name (Often, there is a "data" folder next to the executable!)
03-17-2020 06:52 PM
Also note that you have a potential race condition because you cannot guarantee that the global variable is written before it is read inside the subVI below.
03-17-2020 08:51 PM
thanks.
I have worked out how to set the default install folder on my Win10 PC.
It appears that the Universities security policy was the cause of the issue. It would not let me write any data to the C:\program data and C:\program data (x86) folders.
The security was set to Read only and the policy prevented the application from writing results to the folder.
Once I swapped to a specific folder (c:\valve_controller_v4) it was all good again.
thanks for your help, learnt more things today.
Greg