RSView32 File write, corrupts data

Rickmmmmm

Member
Join Date
Aug 2007
Location
Indiana
Posts
2
PLC Experts,

I have written an RSView32 application that generates a CSV file based on a trigger from the PLC. Each day a new file is created and data is logged to that file after each test cycle of the machine (about once every 5 minutes). The majority of the time all works well.

However, after reviewing the data files 1 out of every 10 or 12 files is filled with corrupt data. Opening with Notepad reveals gibberish characters.

Here is a section of the code that appends to the file.

Sub AppendtoIndivRejectFile()
Open ATDFile For Append Access Write As #1
Print #1, gTagDb.GetTag("JULIAN_DATE"); ",";

etc.......
Print #1, gTagDb.GetTag("IND_C_5_SEL"); ","
Close #1
End Sub


ATDFile is a string containing the filename.

Has anyone run across something like this?

Thanks in advance for your help.

Rickmmmmm
 
Don't quite know why you are writing to a csv, except to import it into an excel spreadsheet, wouldn't it make sense to log to a Access db using a datalog setup then use excel or access to read the data based on date & time?

I do this all the time however I have never tried writing to a csv so cannot help you with that problem, suggest you open another file within the same routine & write some text into it & see if this also gets corrupt data at the same time
 
This is a retrofit job. The customer already has a system in place that uses the CSV file. The CSV file is a text file. Just with data seperated by commas.
 

Similar Topics

A client is running an RSView32 station strictly for trending and reports, but the station hung up the other day and had to be ctrl+alt+del \end...
Replies
0
Views
1,456
I have a customer that had a power outage which resulted in the PC having a corrupted user profile. He resolved that issue by repairing the...
Replies
1
Views
2,324
hi I feel like this should be easy but i cant figure it out. I want to take my alarm log history and save it to a folder so I can look at later...
Replies
2
Views
1,418
Greetings all,I have an existing RSVIEW32 project that is running on a computer which is connected to our "production network". The production...
Replies
7
Views
3,345
One of my team members is working on a rather large RSView32 project. He has about 50 tags on a template page that will be updated via a parameter...
Replies
2
Views
1,518
Back
Top Bottom