PLC and http

O

Thread Starter

ogh

Have a saia PCD3 with ethernet adapter. Want the plc to call my webservice with a tcp message like this:

GET file.php?var1=1003

Anyone been into something like this?
 
> Have a saia PCD3 with ethernet adapter. Want the plc to call my webservice with a tcp message like this:

>GET file.php?var1=1003

Sure, now it is easy. Take a look here: http://www.sbc-support.ch/faq/restricted/item/item.detail.php?it_index=101789
FAQ Topic heading: "How it's possible to download files from a PCD web server over a web connection (without ftp) where the files are not stored in the standard web folder? "

If you do not have a login to the restricted section of the FAQ you need to ask your distributor or SBC support ([email protected])

I will post the contents o the FAQ 101789 here anyway:

<i>"How it's possible to download files from a PCD web server over a web connection (without ftp) where the files are not stored in the standard web folder?

FAQ #101789

In some cases a ftp connection isn't available (authorized), only a http web access is possible in order to access for example the log file created by the PCD. If there is no path indication on the url, then the web server of the PCD does only find files which are stored on the web folder of the filesystem. But in some cases it's useful, that also files which are stored in other folders of the filesystem could be accessed with the web browser.

Solution:

With standard http instruction you have to enter also the path where the file is stored in to the url.

Example for a file created by the S-Energy Manager where the file day001_2012_000.csv is stored on the folder:
SL0FLASH/Energylog/SBUS_P0/2012.

http://w1-vch-em1.pcd-demo.com/SL0FLASH:/ENERGYLOG/SBUS_P0/2012/DAY001_2012_000.CSV

With the help of the 'ftp over http' it's possible to access with the web browser to all files stored on the filesystem of the PCD and also to have a "dir" instruction.

Example to display a csv file in the browser where the file was created by the S-Energy Manager:

http://w1-vch-em1.pcd-demo.com/cgi-...H:/ENERGYLOG/SBUS_P0/2012&usr=root,rootpasswd

Example to store a csv file on the PC where the file was created by the S-Energy Manager:

http://w1-vch-em1.pcd-demo.com/cgi-...GYLOG/SBUS_P0/2012&usr=root,rootpasswd&save=1

Parameter:
get: File which should be loaded
pwd: Path to the file
usr: ftp user and ftp password
save: save the file

Example to display the content of a folder:
http://w1-vch-em1.pcd-demo.com/cgi-...H:/ENERGYLOG/SBUS_P0/2012&usr=root,rootpasswd

Parameter:
pwd: Path to the directory
usr: ftp user and ftp password

Example for the response shown on the browser:

f,DAY001_2012_000.CSV,9597,0
f,DAY002_2012_000.CSV,8621,0
f,DAY003_2012_000.CSV,12959,0
f,EM001_2012_000.CSV,9286948,0
f,EM002_2012_000.CSV,8581194,0
f,EM003_2012_000.CSV,8307185,0
d,Archiv,0,0

Where
f/d: File or directory
Name of the file
File size
Group access "</i>
 
> Have a saia PCD3 with ethernet adapter. Want the plc to call my webservice with a tcp message like this:

> GET file.php?var1=1003

Possibly I posted an incorrect answer to this already, about getting a file from the PCD....
I can not see the post yet.

But for sending messages to a Webservice you can open a connection using the PCDs "OPen Data Mode", craft your message and send it off to the webservice.

-Erik-
 
Top