Ping, FTP and other

I was wondering. I recently saw a post where there was a ping add in for PMI. Now I do not know a lot about TCP/IP, PING, and FTP. I can tell you what they mean but dont necessarily understand the underlying things that go on. So my question is can a script, similar to the ping script, be written that when a certain signal goes high it will goto a specified IP address, retrieve a .CSV file and store it somewhere, then signal that it obtained the file so it can deleted at the remote end.

It is setup to use authentication to log into the remote directory.

Hopefully this is clear. Have a great day.

If you have networking (file share) access to the files, you can probably use the functions in fpmi.file to achieve this. If you need FTP, you’ll have to use some Python FTP implementation. Possible, but I’ve never done it.

I beleive I have file share enabled. Would the be similar to FTP? I know in Internet Explorer I can type the IP address and it will take me to the folder on the PLC device. The folder is actually a compact flash card on the PLC device. It is accessable from just about anything, or so the manufaturer say. So I am going to do some research on the fpmi command you mention and see what I can come up with. If you can maybe you could provide some code that would do something so I have a starting point. Have a great day.

Windows file sharing uses netbios over TCP/IP (port 139). You get to a path with a URL (like \computer\share_name), a username, and a password. Files can then be dealt with like local folders in Windows. FTP can feel similar, but is a different protocol. It connects with URL, username, pass, port (usually 21) and has commands to browse the file structure and get/put files. The FactoryPMI Jython builtin functions support Windows file sharing.

As of FPMI version 3.1.5, the FTP Python Library, ftplib, is bundled with FactoryPMI. Example script to follow.