FileWriteFields Question for WonderWare InTouch

Join Date
Nov 2018
Location
Michigan
Posts
8
Hello all,

I'm using WonderWare Intouch at my factory for the HMI. Here is what I'm trying to accomplish:
Save data values (27 of them) into one CSV. file, increment the rows instead of creating new file name each time the data is ready to save.
- Currently a new CSV. file is saved each time into row 1 in Excel. However, I prefer to have all the data in one CSV. file for easier maintenance. Is there a way to increment the rows such as:
row 1
data 1, data 2 , data 3, data 4
row 2
data 1, data 2, data 3, data 4
etc.

Here is what I have as my script:
FileWriteFields( DATAPATHNAME + "\" + DATAFILENAME, 0, "Data1", 2506 );

Thank you, I hope I explained this thoroughly.
 
Thank you for the link, there is helpful information on that post however, I didn't find what I'm looking for. I understand Excel knows .csv format based on the comma. Is there a way for it to recognize a new row. Another option is to open the .csv file as .txt. How to create a new line in notepad? See image for what I am trying to achieve.
6e0271f2bfa67277f321308c9858c6e9
 
on WindowMaker I have for example:

(Quick function)
Data1= Product
Data2= 11
Data3= 20
Data4= 2018

CALL CSVWRITEDATAqs( );


CSVWRITEDATAqs
FileWriteFields( DATAPATHNAME + "\" + DATAFILENAME, 0, "Data1", 2506 );


Image is result:
3713b3d18969610164cd22d53e0d1c05
 
on WindowMaker I have for example:

(Quick function)
Data1= Product
Data2= 11
Data3= 20
Data4= 2018

CALL CSVWRITEDATAqs( );


CSVWRITEDATAqs
FileWriteFields( DATAPATHNAME + "\" + DATAFILENAME, 0, "Data1", 2506 );


Image is result:
3713b3d18969610164cd22d53e0d1c05

I don't think you are calling the function FileWriteFields correctly. Try:

FileWriteFields (DATAPATHNAME + "\" + DATAFILENAME, -1, "Data1", 27);

The second parameter "-1" tells the function to write to end of file meaning a new line. You have a "0", which just overwrites the first line. The last parameter is the total number of fields to write to the file. A 27 indicates you will write Data1, Data2,...,Data27 to the csv file. What is 2506?
 
I don't think you are calling the function FileWriteFields correctly. Try:

FileWriteFields (DATAPATHNAME + "\" + DATAFILENAME, -1, "Data1", 27);

The second parameter "-1" tells the function to write to end of file meaning a new line. You have a "0", which just overwrites the first line. The last parameter is the total number of fields to write to the file. A 27 indicates you will write Data1, Data2,...,Data27 to the csv file. What is 2506?

Thank you, Dave. I will give this a shot today! The 2506 was used when I was recording profile data buckets of 2500, I only need 27 now you are correct.
 
Hi everyone
i am new just like a beginner in WW. the problem i am facing is i am generating one csv file but i am unable to add date and time in it.also the new new data is replacing the old one.i want the data to be stored in sequence 1, 2, 3 so on ... with date and time.
can anyone write a quick function script for me so i will copy and paste it .
currently i am using the filewritefields script.

thanks in advance
 
Hi everyone
i am new just like a beginner in WW. the problem i am facing is i am generating one csv file but i am unable to add date and time in it.also the new new data is replacing the old one.i want the data to be stored in sequence 1, 2, 3 so on ... with date and time.
can anyone write a quick function script for me so i will copy and paste it .
currently i am using the filewritefields script.

thanks in advance

Did you see all my posts at http://www.plctalk.net/qanda/showthread.php?t=84424
Also check...
http://www.plctalk.net/qanda/showthread.php?t=84472

It does very close to what you want to do.

Check these links
 
Check these links

i have checked the same but its not clear to me . i write the below script in quick function and just want to add date and time in the script in order to get it in csv.

FileWriteFields( "D:\logfile\test.csv",-1,"CPU21_BZ90_DSP_R112",1 );

Note: CPU21_BZ90_DSP_R112 is real tag billet weight which i want to record.i have done it so far .the problem is only date and time.plz help me with that.

regards,
 
i have checked the same but its not clear to me . i write the below script in quick function and just want to add date and time in the script in order to get it in csv.

FileWriteFields( "D:\logfile\test.csv",-1,"CPU21_BZ90_DSP_R112",1 );

Note: CPU21_BZ90_DSP_R112 is real tag billet weight which i want to record.i have done it so far .the problem is only date and time.plz help me with that.

regards,

See post 7 and 8, just remove or add what you do not need...
http://www.plctalk.net/qanda/showthread.php?t=84472

Also..... read the help explanation of FileWriteFields in Intouch script box.
 
Last edited:
See post 7 and 8, just remove or add what you do not need...
http://www.plctalk.net/qanda/showthread.php?t=84472

Also..... read the help explanation of FileWriteFields in Intouch script box.

Thanks for being so kind..would you help me with one more thing, now the CSV file I generated all data is saving in one file. I just want to create separate file everytime . What changes to be done in script to create new file every time by numbers 1.2,3 so on .Could you help me out Please.
 

Similar Topics

How can i get the value, suppose I have a slider and # (analog value display). I want to use the filewritefields and filewritemessage to see the...
Replies
0
Views
1,501
I have an HMI 2711R - T4T Series B, and I want to know which PLCs, besides Micro 820, can communicate with it.
Replies
2
Views
52
HI i would like to know how to get a variable that will store the amount of times a program has been executed. The issue is I have 3 DBs for 1 FB...
Replies
2
Views
56
I'm working with a project that contains some routines in ST but mostly in ladder. Am I correct in assuming this 'rung': DB1001DO._01AV55_OPEN :=...
Replies
4
Views
94
Is there a way to reset the count on the RS Logix BackUp?? XXXXX PROGRAM IN PROGRESS_BAK445.RSS XXXXX PROGRAM IN PROGRESS_BAK446.RSS XXXXX...
Replies
8
Views
247
Back
Top Bottom