jasauno1
Member
I am writing an array into a csv file of string type. The problem I am running into is that the old string value seems to "hang around" once I change it.
For example:
W_WO_Data: ARRAY [1..20] OF STRING(12);
WO_Data[1]:='test12345';
(*Now I write to the csv file using the function blocks shown below, and test12345 appears as expected*)
(*Now I change string value*)
WO_Data[1]:='abcdef';
(*Now I write to the csv file a second time using the same function blocks shown below, and now abcdef345 appears*)
I am using the following function blocks:
fb_FileOpen (*using FOPEN_MODEwrite as my mode*)
fb_FileWrite
fb_FileClose
Anyone have any idea how to overwrite the entire string value?
The only way I can get the string value to "reset" is by re-downloading the program.
Please let me know if more information is needed.
Thank you very much in advance for taking time to look at this.
For example:
W_WO_Data: ARRAY [1..20] OF STRING(12);
WO_Data[1]:='test12345';
(*Now I write to the csv file using the function blocks shown below, and test12345 appears as expected*)
(*Now I change string value*)
WO_Data[1]:='abcdef';
(*Now I write to the csv file a second time using the same function blocks shown below, and now abcdef345 appears*)
I am using the following function blocks:
fb_FileOpen (*using FOPEN_MODEwrite as my mode*)
fb_FileWrite
fb_FileClose
Anyone have any idea how to overwrite the entire string value?
The only way I can get the string value to "reset" is by re-downloading the program.
Please let me know if more information is needed.
Thank you very much in advance for taking time to look at this.