Hello,
So I am trying to log more than one cycle to a data file.
Here is what I have so far:
MODULE WriteToFile
VAR iodev datalog;
VAR string stDate;
VAR string stTime;
PROC rCycleTimes()
IF DInput(JoeyTry)=1 THEN
stDate:=CDate();
stTime:=CTime();
Open “HOME:”\File:=“SawPart1CT.csv”,datalog\Write;
Write datalog,stDate+“,”+stTime+“,”+“Cycle Time =”\Num:=ClkRead(CycleClock);
Close datalog;
ENDIF
IF DInput(JoeyTry)=0 THEN
stDate:=CDate();
stTime:=CTime();
Open “HOME:”\File:=“SawPart2CT.csv”,datalog\Write;
Write datalog,stDate+“,”+stTime+“,”+“Cycle Time =”\Num:=ClkRead(CycleClock);
Close datalog;
ENDIF
ENDPROC
ENDMODULE
For some reason I can only log one instance then nothing else gets logged in the CSV file.
Only one instance logged and there seems to be no way to have it go to the next line in the CSV file as well.
I honestly feel like I am missing something simple. Please help and thank you ahead of time
HAPPY THANKSGIVING AND GOD BLESS
Joey