I am attempting to test this system in order to determine if I am able to log information to a log file which I’d like to be a txt file.
I am eventually going to be using this as an event handler for scan information and time stamps but for the time being I am just using the even script and the script playground to input my code.
sandtype = ‘coarse’
target = ‘concenation?’
for i in range(5):
print (‘open seasame\n’)
filename = system.file.saveFile(“C:\Users\AJ\MyDownloadedFile.txt”)
if filename != None:
system.file.writeFile(filename, ‘\r\nIT’S’ + ’ %s’ %(sandtype) + ’ ’ + target, 1)
This is the sample code i’ve written into the playground in order to see if I can log information.
It prompts me to save the file at every iteration of the for loop, I will need this to work without prompting me.
Additionally, when I put this code into a timer event script, it does not even create a file and I’m pretty sure there is something wrong with the code recognition by the software.
Is this something that can be done and how can I debug my code in Ignition?