Crimson 3.1 Data Logger

heyheyron

Member
Join Date
Sep 2019
Location
Norfolk, Va
Posts
19
Hello,

I am back at again with another Crimson 3.0/3.1 question.

Do you guys know if it is possible to open .csv file on the CF or SD card, and
use the file commands. I would like to add a header or comment at the start of every .csv. I know about the log comment/header but it appears that they can be placed anywhere in the .csv. Have you guys tried to do something like this?

Any and all help is greatly appreciated!!!
 
When I try to open the files using a the file find commands, my script is returning a System Volume Information or the image.ci3 of the program. It can not seem to get it to see the log folder. The pathway I am trying is /LOGS/Flags. I named the data logger path Flags.
 
After the find files you need a dummy find next before you get to the data you want. This is from a program:
Code:
cstring dummy; //holds the first two results of FindFile which are . and ..



dummy := FindFileFirst (targetPath);
dummy := FindFileNext ();
 
What does the .. mean? That is what my code is returning.

From what I read in the reference Manuel it should return the file name? Or did I misunderstand?
 
If I remember my c days
MySearch = FindFileFirst (targetPath); returns -1 if no files found matching
Target path should be "directory(s) *.*" for example "C:\My_Directory\*.csv"
MyFileName = FindFileNext (MySearch);
 
What does the .. mean? That is what my code is returning.
That is a question for Red Lion, I just found that I needed two dummy reads before I started getting file names. So FindFileFirst gets you '.', then FindFileNext gets you '..', then the next FindFileNext will give you the first filename. It seems to be something to do with the root of the device and then the folders.
 
Following your guy's helpful advice.
I am able to find the files at their location.
Thank you very much!

Do you guys know a way to automatically address the latest file as oppose to a specific position? If not no worries you guys have helped me plenty

Since the name of the file would constantly be changing
 
Nevermind, I figured it out with your help and suggestions.

The ultimate solution was to take the time and use that as a string to find the log file that I should look for.
 

Similar Topics

Hello, I am attempting to use the data logger in Crimson 3.1, it successfully logs the data and writes it to the SD card. For some reason I am...
Replies
3
Views
2,506
I have been stumbling my way through setting up our red lion displays from 3.0 to 3.1. As well as cleaning the looks up a bit. I have absolutely...
Replies
5
Views
3,521
Hi all, I was wondering if anyone could shed some light on how I would go about controlling a data log with a primitive. I am using a G306 HMI and...
Replies
2
Views
2,222
Hello all. I have my data logger set up and it is recording data to my compact flash card. As of right now, I must remove the card and plug it...
Replies
6
Views
4,477
Hi, I have a complex database in Crimson 3.0 and in one of the display pages I am trying to get a tag to show the sum of several other tags. The...
Replies
3
Views
168
Back
Top Bottom