I have a need to write out a text file with some comma delimited information, so that my ERP system can grab that text file and process it.
I am using:
import fileinput
filename = system.file.saveFile("D:\BERRY\Test.txt")
#####
## Some Code to create the text file ##
#####
system.file.writeFile(filename,adjScanRead,1)
When I activated this as a button on the client I got a pop up asking me to basically confirm filename and location, and when I did that was able to see the file on my client without issue.
My problem is when I put this in as a gateway script to execute on an OPC tag change, nothing at all seems to happen. the test.txt file stays empty, I get no alerts on the screen.
Am I going about this the wrong way? The idea is to have this text file continually appended to and put into a directory on the gateway so that my ERP system can grab it every 15 minutes and process it.
Thanks for any assistance.