WW: filereadfields & csv?

I have quite a bit of data in an excel file that I'm wanting to display pieces of throughout various windows in Windowviewer. I know that I can save the .xls to a .csv but the part I'm not understanding at all is when using the script funtion in WW called filereadfields to send that data to a message, I can't get the formatting correct. For instance I used a Window script for Station 1 Tooling window that reads on true
filereadfields "c:\temp\tools.csv", X, "Tool_List_1", 6

X is the part that's confusing me. I understand that the "c:\temp\tools.csv" is where the file to be read is located, the X is where in the file to look, the "Tool_List_1" is the Memory Message tagname to put it into, and the 6 is how many sequential tagnames to continue this.

If I open the CSV in Excel and see that the data I want is in cell B5, how do I know what to enter into X? I played around with the file and the X number, but I'm not really seeing anything obvious. Can anyone shed some light on this for me?

I hope this makes sense because I've got about 6 people in the office talking to me (some at the same time).:sick:
 
Looks like that function is dependent upon how many data items are in a line, ie, how many columns across there are. There is no way to specify the cell.

In fact, perish from your mind that a .CSV file is only for Excel data and that data is arranged by cells. But by lines and inside each line, data items separated by comma.

X is offset in bytes. Looking at the function, you would start at zero, give enough fields to read all the data you want, at a wack. Then use the returned offset, if you want to read more.

how do I know what to enter into X?
You don't / can't as it is a byte offset. The best you can do is start at zero and do a loop, reading one field at a time.

The function returns the new byte position after the read. You can use this return value as the FileOffset for the next read.


Or make enough tags to read all the data at once.
 

Similar Topics

i have a UDT named "Repository" that has a few dints and reals for a small database inside the L72. It has 4 data types: ID, length, width...
2
Replies
283
Views
Hi all, I'm working on a data logging setup using a Siemens 1510SP PLC and a Unified Comfort Panel MTP1000 (TIA V19). The system logs multiple...
10
Replies
587
Views
Hi We have an older OMRON PLC, CS1G CPU43, Developer software CX-Programmer v9.4 We want to update a CSV file with a few tag values each hour...
5
Replies
721
Views
New to Crimson here. Does anyone have any idea/reference on what these columns are? I am trying to import an array from Allen Bradley Studio 5000...
4
Replies
1,106
Views
Dear experts, I have configured the alarm log as a segmented circular log, and it is working fine. When the number of records reaches 500, it...
2
Replies
2,391
Views
Top