Crimson 3 FindFirstFile command not working

mjggjm12

Member
Join Date
Jul 2013
Location
NH
Posts
92
I am trying to open a file in a user program using the FindFileFirst() command.
It will not find the file. I will find the file if I point to a specific file using this command:
hFile := OpenFile("/LOGS/LOG1/07251200.CSV", 0);

but if I try this:
Name := FindFileFirst("/LOGS/LOG1"); it will not put a file name into the Name variable. Name is set to a cstring type.

Any help would be greatly appreciated.
 
I have not tried this on Crimson 3 but have you tried a wildcard?
Name := FindFileFirst("/LOGS/LOG1/*.CSV");

Just a thought.

Regards,
 
I tried it without the asterisk. I will try it with and see if that works. Although, the way I did it is exactly how the manual shows it.
 
I tried it without the asterisk. I will try it with and see if that works. Although, the way I did it is exactly how the manual shows it.

The copy of the reference I have shows a trailing slash:

Code:
Name := FindFileFirst(“/LOGS/LOG1/”)
 
Yes I do have the trailing slash in there. I must have forgot the last slash when I typed it into the post.
Here it is again copied from my code: Name := FindFileFirst("/logs/Log1/");
 
Last edited:
Probably faster to just email support... support at redlion.net. They're pretty fast with responses. I don't know if they charge for more complicated support requests, but I know they don't charge for asking simple questions about functions and whatnot. Love Red Lion.
 
I talked to Red Lion Support on the phone and he e-mailed me some code to convert the year month day and hour into a string because the files in the data logger are named YYMMDDHH. Since each one of my log file are 24 hours long using this will always give me the most recent file. I just use 00 for the hour instead of the current hour because the files all start at midnight.
 
This is an old thread but I had the same problem and couldn't find a solution.

Answer is that FindFileFirst returns a '.' a following FindFileNext gets you '..' and then another FindFileNext finally gets you the name of the first file in the folder. It doesn't seem to matter if you use C:/Foldername/ or /Foldername/ as pathname, both get the same result. You must have the trailing '/' or you will get the names of the folders in the root folder.
 

Similar Topics

Hey guys, hoping someone here could give me a little advice. I'm working with a CR1000-04000 in Crimson 3.1 and I was interested in adding the...
Replies
4
Views
148
Hi, I'm having an issue in crimson 3.0 when I create a programme using a case statement referencing a fault word that each bit needs to change the...
Replies
5
Views
297
How do you install update on Red Lion Crimson ver 3.1. Do I just need to run the exe file on the host server?
Replies
1
Views
128
Has anyone found a way to convert/replace/update the firmware on old Parker TS80xx series HMIs (i.e. TS8010, TS8006, etc) to accept Crimson...
Replies
0
Views
105
Has anyone setup communications with Red Lion 3.0 MODBUS to Baker Hughes Centrilift GCS VFD? Thanks
Replies
0
Views
97
Back
Top Bottom