Copy files Intouch scripting

JCTECH

Member
Join Date
Nov 2015
Location
MASON, OH
Posts
6
Im trying to allow the user to take a span of dates and copy log files from one folder to another so they can view them without disturbing the log process to the original files.

first do you have to create the destination file or will it create one if it DNE. Right now my code ensures the file exists by creating one before trying to copy to it.
second the documentation says filecopy() will run in multiple stages and after it begins the code will continue to execute. i think my code is running too fast to allow all the files to copy properly.(right now i dont even get the first file in the sequence to copy).
im wondering if there is a way to halt the execution of the script while i await a result of the of the filecopy() function.

DIM i AS INTEGER;
DIM ii AS MESSAGE;
DIM FirstSpace AS INTEGER;
DIM FileDate AS MESSAGE;
DIM monitor AS MESSAGE;
DIM result AS INTEGER;

IF DataLoggerDateNotValid==0 THEN

FOR i=0 TO DataLogSpan STEP 1

ii=StringFromIntg(i,10);
DataLoggerIndirectDate.Name="DataLoggerDate"+ii;
FirstSpace= StringInString( DataLoggerIndirectDate," ",1,0);
FileDate=StringReplace(StringTrim(StringLeft(DataLoggerIndirectDate,FirstSpace - 1),2),"/","_",0,-1,0);
FileWriteMessage ("C:\Users\Josh\Desktop\WonderWareDataLogger\DISPATCH_SCANNER_DETAILS\DISPATCH_"+FileDate+".csv", 0 , "",1); {Header Of FIle}
result=FileCopy("C:\WWtestFolder\DISPATCH_"+FileDate+".csv","C:\Users\Josh\Desktop\WonderWareDataLogger\DISPATCH_SCANNER_DETAILS\DISPATCH_"+FileDate+".csv" ,monitor); {Header Of FIle}

NEXT;

ENDIF;
 

Similar Topics

Does anybody have any experience with manually copying the logs directory from the SD card to USB drive? I've successfully used the...
Replies
4
Views
1,991
Hi, I am setting up a technical manual display page on a PANELVIEW PLUS 1250 HMI, and the page references .pdf files held on an SD card on the...
Replies
0
Views
1,656
Hi Everyone. I am trying to copy my Data store plus files that are logging to my SD Card (Storage Card2) to my USB that I have plugged in. I have...
Replies
2
Views
1,947
Hey, I'm looking for easy and fast way to copy data files from different data tables. for example: All F8 (255 elements) to F9 (same size of 255...
Replies
2
Views
2,092
Greetings all, I have an 5104TH HMI set up to log data to an SD card on an interval. It's hooked up to the network with a certain IP. We are...
Replies
3
Views
4,160
Back
Top Bottom