Wonderware intouch log function

Yes, but you really need to break out that manual I linked to.

Use the FileReadMessage function to get the number of bytes offset to your line #5:
FileReadMessage ("c:\Data\File.txt",0,MsgTag, 0);

This will start reading at the beginning of the file (1st '0' specified 0 offset), into MsgTag, and read until line feed (LF).

The return value is the new offset position after the read.

Do this 4 times (using each new offset) to get to the offset to line #5, then do a FileWriteMessage using the offset into the file.

This will only work if the lines are of the same length - if your Date / Time stamp vary in length you will have a problem.

 
ok thanks for answering but this will write me a full line...

lets say i have the situation in the attached file.. and the place i want to write a single value is the one in RED

Doing what you are saying will write a hole new line in line 5 ,overwriting the existing values, and i just want a single value in the red cell..

do u have any other suggestion ?

thnks

WRITE.jpg
 
Regrettably....
You are building a csv file NOT an excel file. Just because Excel can open a csv, does not mean the csv is set up with rows and cells.

When Excel opens the csv, it places the data in rows and cells depending on where the comma separator is located in the csv.

During the write, you can set up where the data will show up in Excel, but not after the file is built.
 
Last edited:
Again, if the data alignment is incorrect, you will trash your data - if you store the value 99 where you used to have a 5, something is going to get overwritten (probably the comma - unless you already have some whitespace where you can put the larger number into).

If you change your data field writing by formatting the data using the Stringspace() function, you could allow for larger numbers to be overwritten over top of a smaller number.

You can use the StringInString function to find the comma repeatedly and finally get the byte offset to write the new data. There are a number of ways that cat can be skinned. You need to play around with the functions available (RTFM, please).

I, personally, would read repeatedly through the file, writing each line out to a new file (and changing the data as required) - but then, I'm sometime prone to the brute force methodology.

Seriously, sometimes you just have to mess with the tools provided in the environment you're in and some up with the solution - I can't do it all for you since I already have a full time job.
 
Last edited:

Similar Topics

Hi, this wonderware application handles 6 batching tanks, I'm recording historical trending of temperature in the tanks, my question is if I can...
Replies
1
Views
3,418
Hello, I was wondering if there is a utility to view alarm log files from InTouch 7.1. I found that the system writes a new alarm log file...
Replies
1
Views
5,671
Hi guys, I have experience with PLC to Excel etc...just starting on using intouch scada screens. I have an Excel sheet that uses mainly...
Replies
1
Views
168
Hola chicos. Tengo un problema con el driver de comucicacion dasabcip 5, y un plc controllogix v34, ya realice la comunicacion pero en ciertos...
Replies
2
Views
173
Hi, I am upgrading a Wonderware SCADA form version 9.5 to version 23. I am able to migrate all the graphic, but when to activate the runtime this...
Replies
8
Views
436
Back
Top Bottom