![]() InputStream = urlConnection. For anyone use who is curious, here’s a chunk of what I came up with: import osĭef getInputStream(robotController, path):įtpUrl = % (robotController, robotController, robotController, path) Using PGriffith’s suggestion I was able to use the java libraries and reduce the time to download a batch of files from 4.5 minutes to 11.5 seconds. Try the following to get to support at IA : Thanks in advance for telling the rest of us what the result was and therefore we may learn something also. I recommend you read the support policies first, because voice support is generally best if you have an account. If you need a ‘faster answer’ to your quest for better response time, other users have suggested that you visit the support page ( which also includes the knowledgebase as a menu choice at entry ). FTP is also far away from Assembly Language or Machine Language. That said, a script file is using what experts call a ‘high-level’ or ‘more complex’ language to access the inner workings ( hardware ). It is oriented toward that error message folks receive if they are not using the correct Time Server parameters. Much of it has to do with the type of storage that you are using ( physical storage, as in things that you point to- RAM and or Hard Disk and or Solid State Disk Drive ) and various cache settings. There is a knowledgebase article which goes into PC performance parameters as a solution for problems in the timing. Print("Error downloading %s : %s" % (fileName, str(ex))) ftputil has convenience functions for conditional uploads and downloads, and handles FTP. The library supports many functions similar to those in the os, os.path and shutil modules. ftputil implements a virtual file system for accessing FTP servers, that is, it can generate file-like objects for remote files. SaveFilePath = os.path.join(folder, fileName)įtp.retrlines('RETR ' + fileName, writeLine) ftputil is a high-level FTP client library for the Python programming language. # Save the file specified by fileName in the specified folder # Get the list of files of each file type thenįileTypes = įiles = files.replace(files, '') Print("Error connecting to %s : %s" % (robotIp, str(ex))) Here’s an example of my functions for connecting, getting the list of files, and downloading: # Create the ftp connection to the robotĭef createConnection(robotIp, robotUsername, robotPassword):įtp = ftplib.FTP(robotIp, robotUsername, robotPassword) Is there something I can do to improve the performance? If I run it as a python script outside Ignition, one of these operations takes less than 300ms. The problem I have is it takes about 4.5 seconds per ftp request whether that is connecting, getting a list of files, or downloading a file. ![]() The files are typically less than 10KB, the biggest is about 150KB. I am connecting to HMI’s and robots using python ftplib. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |