Windows Networking

After doing some research I found that the PLC units we have do not support Windows File Sharing. So that leads to a series of quesions:

What would you recommend to take 2 small files and globally send them to each and every compact flash of the PLC’s that are oline? We were thinking an FTP client of sorts but was unsure what ones have been tested and/or recommended.
What would be involved here is during an update two files are created. These files are also on the compact flash of the PLC. Once these new files have been created something would send these two files. That is what we are looking for some way to send the files.

Then we have the retrieve function.
We are not even sure if it would be possible to send information from FPMI down to an FTP client. Somethings that we might want to send is maybe the last octect of the IP address and some command that tells it to attach, retrieve a file with a particular name, save said file to a particular location, delete that file from the directory you are currently connected, and then close the connection.

Any suggestions greatly appreciated. Have a great day.

Huh? I’m confused here. I don’t think you have your FTP terminology correct. You could only interface with a compact flash card on a PLC using FTP if the plc is running an ftp server. Is this the case?

You said you want to “send information from FPMI douwn to an FTP client”. This doesn’t make sense. You don’t send things to an FTP client. FTP clients send things to FTP servers.

Please clarify. Better yet - talk to the manufacturers of the PLC - they’ll know how to put files on the CF cards in their devices.

There is a compact flash card on each PLC that will be on our network/project. Total count will be around 99. Each will have its own IP address. The compact flash directory is accessable thru FTP and I think it is also available thru web surfer.

There are two distinct things we want to do here. First off there are two lists of employee ID numbers. The one list is Mechanics and the Other is SUpervisors. This lists are stored on the compact flash of the PLC and are loaded on startup or demand. This was done in the event that the connection between the PLC (shopfloor) and the SCADA server was severed and no tech was around. This would allow the supervisors to still log on the plc and do some employee assignments and it would still allow the mechanics to log in and all this time it will still be collecting the data. If we would have done a validation against an SQL table and the connection went down between the PLC and the PC no one would be able to log into that box. SO it was deceided that to put the important people on the local level to still keep control. Hopefully that makes sence. So as our personell change jobs or leave and new ones come in these two files have a chance to change. It might be once a month, it might be every 6 months, it might be a year, one never knows. So I am building a routine that will, when an event occurs, created these two files, then send them to the PLC devices. This is the one refered to as global sending.

The next one is more of a when the operator logs off the machine. Do a data collect. You see as the machine is running it is not only reporting the data back the SQL table via your software, but it is also storing that information locally on the compact flash. This was done for two reason. 1. again if the connection is severed and 2. As a validation for data. Since this file is writen so fast we can use it to go against the SQL data table to keep an eye on how well things are working. Also since I was unable to write a routine that in the PLC would do a store and forward should the IP connection go down this will provide a back up that can be acquired at any time thru the day. Our Data Dept staff has started writing a small program that will load this .CSV file which is on the compact flash of the PLC and will populate an SQL table then another routine will check that table against what is actually there. If a discrepancy exist it will raise a flag and it will then be the data dept that looks over the files finds the issues and creates a report.

But anyway we want a 2 way street. One to place files on the compact flash of each PLC, then another to take a file off it but only when the operator logs out.

Hopefully this clears things up. If not maybe we can do a phone chat

Have a great day.

[quote=“Carl.Gould”]Huh? I’m confused here. I don’t think you have your FTP terminology correct. You could only interface with a compact flash card on a PLC using FTP if the plc is running an ftp server. Is this the case?

You said you want to “send information from FPMI douwn to an FTP client”. This doesn’t make sense. You don’t send things to an FTP client. FTP clients send things to FTP servers.

Please clarify. Better yet - talk to the manufacturers of the PLC - they’ll know how to put files on the CF cards in their devices.[/quote]

Wow, ok, that was a lot of info. Sounds like you have a few integration issues to work out as to exactly what you want to do, and what protocols are available to you.

If you end up needing to do an FTP file transfer from FactoryPMI, you could import the “ftplib” library from the standard python library into FactoryPMI, basically by cutting-and-pasting it into your own project global module.

Good luck,

Yes that is is a lot of information. And of course my limited ability to properly put into words what I want and of course sometime knowning what I want but not knowing the exact terminology leaves me in a slight bind at times. SO that is my achiles heel in this realm of doing things. For that I appologize. But I do try my best. And I am hoping that my last explaination is more informative.

Now as for you answer your saying that Python has ftp capability? In a library file? So what I am understanding then is if I download Python and install it then do an import into a global script then I can use the Python commands to do such. Or could you clarify this a little bit. Forgive me for not knowning alot, when I went to college the only computer course I studied was Assembler thought that would be the way of the future but I was wrong and short sighted and should have taken more languages. Oh well hind site is 20/20. So thanks for the responce. Have a great day.

[quote=“Carl.Gould”]Wow, ok, that was a lot of info. Sounds like you have a few integration issues to work out as to exactly what you want to do, and what protocols are available to you.

If you end up needing to do an FTP file transfer from FactoryPMI, you could import the “ftplib” library from the standard python library into FactoryPMI, basically by cutting-and-pasting it into your own project global module.

Good luck,[/quote]

I was wondering I downloaded Python, I was able with the help of google to write a python code that would take and do an FTP and retrieve a file. So that much is working. All I need to know now is how to bring this library from Python over into FPMI. When I try to execute the same commands in FPMI that I used in Python I get the no module present. So I am getting close.

[quote=“Carl.Gould”]Wow, ok, that was a lot of info. Sounds like you have a few integration issues to work out as to exactly what you want to do, and what protocols are available to you.

If you end up needing to do an FTP file transfer from FactoryPMI, you could import the “ftplib” library from the standard python library into FactoryPMI, basically by cutting-and-pasting it into your own project global module.

Good luck,[/quote]

You need to import the “ftplib.py” file found under the “Lib” folder of your Python installation into your FactoryPMI project’s global script modules, and then do “import app.ftplib”

It may not be as simple as cut-and-paste (I’ve never imported this specific library), you may need to massage it a bit in order to get it to work with FactoryPMI.