0

How do I stream a string (hello world, for example) from a PLC by Structured Text programming (IEC 61131-3) to MongoDB using sockets? I heard that function blocks like SysLibSockets have to be used but I am not sure how.

It would be great if you could help me with this as I am relatively new to ST and want to learn the language.

Thanks.

cryptic_star
  • 1,863
  • 3
  • 26
  • 47
Arjun
  • 9
  • 1
  • 7
  • First you should figure out basic usage of sockets. When you understood the basics of sending bytes to a server, try to familiarize yourself with the MongoDB binary protocol. – Philipp Sep 21 '15 at 19:30
  • @Philipp Yes, I have read stuff about sockets. But, I am unable to find any documentation as to how to insert data into MongoDB using Structured Text. Could you help me out? – Arjun Sep 22 '15 at 09:40
  • @Philipp any help, mate? – Arjun Oct 16 '15 at 13:57

1 Answers1

0

Your question does not have sufficient information.

Structured text is a variation on Pascal. As such similar to "C" WITHOUT any of the standard libraries such as the BSD sockets library, it has no inherent communication capabilities of its own. Communication capabilities are defined by the "system" level details of the PLC itself.

Furthermore, many PLC's don't have a "generic" UDP or TCP interface so if that is the case then you have to implement the correct protocol on the PC side.

  • Thank you for the reply. I have managed to resolve the problem by sending the data from PLC over sockets and wrote a C# code to read it and later insert it into MongoDB. I used Asynchronous TCP function blocks at the PLC side. – Arjun Mar 07 '16 at 15:23