05-04-2015 01:00 PM
Raghunathan wrote:1. The Black Sub Vi just returns the current path based on the situation - whether in Design mode or Run time system.
I would recommend throwing that VI away. Instead, use the Application Directory function. That functon returns the folder of the project file when in the development environment or the folder of the executable in the RTE.
@Raghunathan wrote:
2. File I/O inside a Timed is a true concern. But then my acquistion rate is rather slow at once per minute. And the user needs the plot to reflect only once per hour intervals. So I thought its simpler to do what I did even if it means opening and closing the Spread Sheet file 1440 times a day. Not much ?? Anyway I do agree the overhead of the Timed Loop and have since changed to a simple while loop.
A timed loop slated to loop once a minute?! What if the user needs to abort or do some other function? A minute is an eternity to a user. Instead of the timed loop, use a state machine. This way you can check for users trying to do something. Just have a state to check how much time has elapsed. Once your minute is up, you can take another measurement.
05-04-2015 09:16 PM
Hi Crossrulz,
Thanks for your post. A few clarifications :
1. To call VIs dynamically, when in Design mode I should get a path to the folder where the VIs reside. And when in Run mode as an EXE , I must get the path to the EXE itself, since the VI to be called is wrapped inside it. I have tried using the "Application Directory" function but this fails in the EXE mode as it returns the path to the folder where the EXE resides and not the EXE itself. This is the behaviour I have seen. So i continue to use the "Black Sub VI" that i built using this as a guide HERE (I always use LabVIEW 8.x file layout when building EXEs and the "Black Sub VI" resides in a folder called SUBVIS within the main App folder. )
2. My timed loop is not set for 1 minute !! Its set for 500ms and I call the Spread Sheet write function once every 120 iterations and that makes it a minute.
05-05-2015 04:47 AM
@Dennis_Knutson wrote:
You still have not done any basic troubleshooting. You still have not looked at the path being created. If it's not valid, you WILL be prompted for one. Basic stuff. It's your exe on your deployed computer.
I am sorry I was able to do that only lately as the client was busy...
So it transpires that the file name generated from the Date / Time stamp of the PC varies form one PC to other.
On my Laptop it is : C:\Users\RaghunathanR\Desktop\UF_DataLogger\RESULTS\125-05-05-2015.txt ( All well )
On my client desktop it is : F:\UF_DataLogger\APP FOLDER\Results\125-05/05/2015.txt ( Problem is the two forward slashes)
Never imagined that it will vary like this. So I guess I will have to do some work to form the File Name myself instead of directly using the output from the FORMAT DATE / TIME STRING function.
Any other ideas ?
05-05-2015 06:55 AM - edited 05-05-2015 07:06 AM
Use Format into String and set the format codes in whatever way you want for the time. Format into string would allow you to eliminate about half the functions and wires you have. Things like the backslash and hyphen would be placed into the format string rather than concatenating them into all the various parts.
Basically %c uses the system's format for time and is not very robust for handling all the different ways people would show time. For instance on my system, trimming it to 10 characters leaves it at "5/5/15 7:5".
Like this:
05-05-2015 07:00 AM
Raghunathan wrote: (I always use LabVIEW 8.x file layout when building EXEs and the "Black Sub VI" resides in a folder called SUBVIS within the main App folder. )
Stop doing that. Especially if you are calling VIs dynamically. By using the "new" format, you do not need to distinguish between running inside of an exe or the development environment. The relative folders will be maintained.