0

I would like to insert documents into MongoDB(where the server is present) using Structured Text programming which collects the data from PLC. Since there is no driver available, how I can create a HTTP client function block and connect to the database?

Also, can I connect to MongoDB using ST as there is a REST API available?

Arjun
  • 9
  • 1
  • 7
  • I don't know. But my first guess is that it is not possible or hard to accomplish. I would suggest to write a little service program in a high level language like C# that collects the data from the plc and inserts to the database. You should also give more informatione which plc you are using. – Felix Keil Jan 07 '16 at 16:26
  • @FelixKeil The PLC I am using in Bosch IndraWorks MLC. My problem is I am able to send data from the PLC to MongoDB but I am not able to see it as the driver isn't available. So the idea you are suggesting is, I need to write a C# code or a Javascript to pull the data from the PLC and insert it into the database, right? – Arjun Jan 12 '16 at 08:07

1 Answers1

0

You will have to note the maker and model of the PLC as most vendors have their own interpretation of the IEC spec, and then have a look in their documentation. Some will have included function blocks to handle sockets and the like, and some will not. I believe that you will have a hard time getting this to work, and suggest as the comment above does, to create an application on the server that fetches the data from the PLC instead of trying to send it from the PLC. ST is pretty limited compared to high level languages, and chances are that you will be able to find a library that fits your PLC.

nettogrisen
  • 115
  • 2
  • 12