Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

write in a text file saved on computer and not in the datalogger


Branzahm Aug 19, 2015 12:13 PM

Hi guys,

I want to write in a .txt file with my datalogger.
I know that is possible with "FileOpen" then "FileWrite" for a file stored in the datalogger memory.
But is it possible to do the same thing for a file being on the hard drive of my computer connected to the CR3000 by RS232?

In the case of it is impossible, is it possible to copy a file from the memory of the datalogger to my hard drive ?

Thanks a lot !

David.


jtrauntvein Aug 19, 2015 02:51 PM

The LoggerNet setup screen provides a "File Retrieval" tab that allows you to set up a process where LoggerNet will check the dataloggers for a new or updated set of files and transfer those files to the host computer's file system. This can be set up to work as a part of scheduled data collection or it can be set up to work on its own schedule.


jra Aug 19, 2015 03:02 PM

David,
Do you want your data file stored with a .txt extension (instead of the default .dat)? Or, are you storing something else in the txt file?
Janet


Branzahm Aug 20, 2015 08:52 AM

Hi, thanks for your fast answers.

In fact, i interact with a gaz analyzer writing command lines in a .txt file.

Few times during my main program i would like to write command lines on a .txt file which the analyzer read every second.

Here my program :
BeginProg
Scan (1,Min,0,0)
PanelTemp (PTemp,250)
Battery (batt_volt)

file_cmd = FileOpen ("CPU:test.txt","a",-1)

FileWrite (file_cmd,"Hi, How are you ?" & CHR(10),0)
FileWrite (file_cmd,"Yeahhhhh, Good !" & CHR(10) ,0)
FileClose (file_cmd)

NextScan
EndProg


My file_cmd return 7999 if i sample it.
I know that is possible to save it in .txt file instead of .dat file.
But i want to save my text and not the value of file_cmd.
By the way, when i retrieve my test.txt file it is perfectly what i want :
" Hi how are you ?
Yeahhhh, Good ! "

Is it possible to retrieve my file from CPU automatically ?

Thanks a lot.
David.

* Last updated by: Branzahm on 8/20/2015 @ 3:02 AM *


aps Aug 20, 2015 09:29 AM

You should setup a small USR drive on the logger and not try to use the CPU memory for this purpose. The reason is that the CPU memory is non-volatile memory that has limited write cycles, i.e. you risk wearing it out if writing every few seconds. The CPU drive is there to be used for storing programs or calibration files that change infrequently.

If you write your txt file to the USR drive you should then be able to retrieve it with Loggernet.

With regards to the filehandle variable you should declare this and sample it as a Long Integer to see the valid number.


Branzahm Aug 20, 2015 01:06 PM

Hey aps, thanks for your advice.
I set up a small USR like you advised me.

But i still do not find the way to retrieve my file .txt automatically.That is my main problem. I need this file on my computer to send it to my analyzer(on his own computer) which is in LAN.

The filehandle variable is always a number and not the file that i want to take back with my command lines.

David.


jra Aug 20, 2015 01:24 PM

In LoggerNet's Setup screen, select your datalogger. Select the File Retrieval Tab.


Branzahm Aug 24, 2015 11:42 AM

Hi, thanks a lot, it's working.

I never see this "file retrieval" tab before ... :)

* Last updated by: Branzahm on 8/24/2015 @ 6:36 AM *

Log in or register to post/reply in the forum.