Red Lion Data Station Plus directory listing and renaming

cookswim

Member
Join Date
Jan 2017
Location
Ohio
Posts
14
I have a large number of simultaneous logs being generated. One for each machine it's connected to. However, It seems that the log file naming scheme is fixed per the way it's setup with the logging intervals. Because we have so many different log files with the same name (but in different directories) it's been requested to modify the file names to insert an identifier. My decision is to make the 7th and 8th name characters the identifier. My assumption is that I can't change the name of the active log file.

I already have working code to extract the file name and build it back up with the identifier, but I'm not exactly sure how to sort through the logging directory and change all the right files, while not accidentally changing the active log file.

I figured that FindFileFirst and FindFileNext would spit everything out in alphabetical order, but it isn't doing that. It's mostly alphabetical, with some files jumbled around. Do any of you know what order it lists files in? Alternatively, is there a way to read back from the data station plus, what the active log file names are? Then I could scan through the whole directory and skip the active one.

I thought about just serially searching back in date order to find the files after the newest, but then how would I know when to stop without putting in some magic numbers.

It's a shame the system functions aren't documented that well in the function reference manual. Like what is OpenFile supposed to return if it's given a bad file name?
 

Similar Topics

I`m looking into using Red Lion Data Station, do someone have experience with limitation on number of tags and performance?
Replies
11
Views
1,742
Hi I have been using Red Lion products for some time, I had a thought over the bank holiday weekend, As you do. It would be nice if whenever a...
Replies
4
Views
1,030
Hi, I'm trying to get values from 8 encoders using a 2-wire bus RS485 connection to a Red Lion Data Station. These will ultimately write values to...
Replies
10
Views
2,376
Hey everyone! Pretty new to Red Lion, and am setting up a data logger on my HMI application. My boss is logging data on another HMI and I've...
Replies
7
Views
2,352
Hi All, I am hoping someone can help. I have setup a Red Lion Data Station (DA30D, Crimson 3.1 Build 3112) to log data from several Allen...
Replies
18
Views
7,378
Back
Top Bottom