LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bytestream File Refnum issue


Raghunathan wrote:

1. The Black Sub Vi just returns the current path based on the situation - whether in Design mode or Run time system.

Current Path String.PNG

 


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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 11 of 15
(1,206 Views)

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. 

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 12 of 15
(1,190 Views)

@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. 

 

Generated Path.PNG

 

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 ? 

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 13 of 15
(1,174 Views)

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:

Message 14 of 15
(1,163 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 15 of 15
(1,159 Views)