BH2114 Posted January 24, 2018 Share Posted January 24, 2018 I have a sequence as below which works: while(1) private st = systime() while(systime() - st < logInterval*60) delay(.2) if (logFlag==0) break endif endwhile if (logFlag==0) break delay(.1) endif FileHandle = File.Open(NewFileName,0,1,1,1) private string out= ChannelData File.Write(FileHandle,out) File.Close(FileHandle) wait(.1) endwhile This sequence writes (channelData) to a file every (loggingInterval*60). When (logFlag =0), the while loop breaks and the sequence continues to other tasks. I have one additional variable (step) that starts at 0 and increments by (1) to the value (8). when logFlag =0, step is reset to =0 I would like to write (channelData) once each time (step) increments, in addition to the normal file writes that take place as a result of (logInterval*60). Just cant figure out how to nest the if statement (if thats what should be used) and updating step in the same manner that (st) is being updated also does not seem to work. Note: this appends to a file that was previously created. Link to comment Share on other sites More sharing options...
This topic is now archived and is closed to further replies.