7/7/2014 1:02 PM | |
Posts: 7 Rating:
|
Good morinig to All, I'm working with S7-1200 Web Server. I created a DB containg some values and an FC that combine valus into a Array [0..1000] of Char called EXCHANGE_STRING. Then I want to show this string in a web page: <h1>DATA:</h1> :="MYDB".EXCHANGE_STRING: But obviusly this doesent work because is not a single variable but is an array of variables. So, i can't use something like Ajax because i want to read data from PLC like a webservice, using file_get_content() method in my PHP application ad import data into the Database. In other words, the user of this application isn't a web browser but a script. Is there a way to do this? Thank you for your help! |
7/7/2014 2:46 PM | |
Joined: 7/7/2010 Last visit: 3/10/2025 Posts: 15721 Rating:
|
If you want to create a large string or set of strings that you update in an FB/FC using the array of data, you could then just read the string and parse it in your php app during import - especially if you build the string as a CSV. Or, you could create 100 data points rather than try to read all 100 in a single tag. Me, I think it would be faster to have as few tags as possible for the web server to render and update. You might even consider opening 2 or 3 custom web pages with a single string tag per page. The simpler, the more efficient your tiny web server will be at updating, with the least performance loss to your running plc program. Does any of this help? |
science guy |
|
7/7/2014 3:28 PM | |
Posts: 7 Rating:
|
Thank you for your answer. Performance loss is not a problem because this is the only work that this PLC have to do. In my system i have an Automation PLC (S7-317F) and the "Data Exchange PLC" (S7-1200) that exchange a DB via Profinet. So, I have something like 500 / 700 plc sensor values and variables in my Automation PLC, and in the S7-1200 PLC i want to read these values and generate some "special" error messages and send some of these data to a PC, to store as historical data, "splitting" the work between 2 PLCs. Then I Tried to use the S7-1200 FTP component (provided by Siemens) but doesent work properly because i need a "real time" communication. Then i think that i can create someting like a Web Service in my S7-1200 and read strings in my PC with PHP scripting (all the PC platform is also made in PHP and MySQL database). But I'm pretty new to the PLC world and i'm looking for the right way to do this. Thank you! |
7/7/2014 3:37 PM | |
Joined: 7/7/2010 Last visit: 3/10/2025 Posts: 15721 Rating:
|
You might want to look at an open source solution, snap7 [google] for your php application and instead let the PC application read directly from the plc just like the s7-300 logic is pushing data to the s7-1200, your PC would simply PULL data from the PLC. A prior thread about snap7 : https://www.automation.siemens.com/US/tf/WW/en/Posts/96987 |
science guy |
|
7/7/2014 3:48 PM | |
Posts: 7 Rating:
|
Ok, I will try to follow this way and post some comment about the results. Thank you very much!
|
This contribution was helpful to
1 thankful Users |
10/5/2017 7:18 AM | |
Joined: 6/19/2017 Last visit: 9/6/2024 Posts: 8175 Rating:
|
New question published by Mz007 is split to a separate thread with the subject How can connect cpu1212c with MySQL database to send data in both ways?. Best regards |
Follow us on