WW: filereadfields & csv?

Duranthas

Lifetime Supporting Member
Join Date
Jul 2008
Location
Southeast Missouri
Posts
132
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

Good morning, I have a Emerson/GE PLC with Cimplicity SCADA. I need to export data of a specific point/object to a CSV file and load the CSV file...
Replies
7
Views
207
I am trying to import addresses and symbols from a PanelBuilder32 application into the RSLogix 5 Address/Symbol database - however each time I...
Replies
5
Views
503
Hello guys, Im using a siemens with WINCC in a computer and need to import to tag´s data fom a specific row in a SCV file, i have a working...
Replies
15
Views
1,558
Hi. About 18 months ago a did a CODESYS project using the CSV Utils from the IIoT libraries. I am trying to reuse what I did and it does not...
Replies
1
Views
362
Hi Everyone, I am hoping a Red Lion Expert can point me in the right direction. I am experimenting with data logging on a CR3000 10" screen...
Replies
4
Views
572
Back
Top Bottom