X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 67312D1B550 for ; Fri, 7 Nov 2003 14:17:55 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 22696-04 for ; Fri, 7 Nov 2003 10:17:27 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id D650CD1B543 for ; Fri, 7 Nov 2003 10:17:23 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id hA7EHNNu018427 for ; Fri, 7 Nov 2003 14:17:23 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id hA7DqM2o013693 for pgsql-sql@postgresql.org; Fri, 7 Nov 2003 13:52:22 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.sql Subject: Re: SQL to PLC to diverter gate, can this be done? Date: Fri, 07 Nov 2003 08:47:45 -0500 Organization: cbbrowne Computing Inc Lines: 37 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org X-message-flag: Outlook is rather hackable, isn't it? X-Home-Page: http://www.cbbrowne.com/info/ X-Affero: http://svcs.affero.net/rm.php?r=cbbrowne User-Agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Reasonable Discussion, linux) Cancel-Lock: sha1:46OS6AmRHcQKCYTQhd61K1Ll5gE= To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/43 X-Sequence-Number: 15858 Centuries ago, Nostradamus foresaw when razorbak71@yahoo.com (Razorbak71) would write: > First, I know nothing about PLC's, but I was wondering is there a > way to extract data from a SQL database file, feed that to a PLC is > some manner, and then have the PLC trigger a diverter gate based on > the value in the table exceeding a certain value, to divert parts to > another location. > > Am I off base, or is there something out there that will allow or > help me to do this. Any help would be greatly appreciated. It all depends on how you are able to program the PLC. They tend to have pretty proprietary tools that are very much dependent on the vendor. My little brother works for Omron, and does some pretty fancy things with their PLCs. But since the languages Omron uses aren't the same as are used with similar products from (say) Siemens, knowing one platform doesn't necessarily help with the other. (They commonly use languages resembling BASIC...) I think you need to know a LOT more about the PLC system in question, and that knowledge is not likely to be found here. What you want is probably feasible in some sense, although it's likely to be rather fiddly. And your use of the term "SQL database file" suggests some confusion on your part as to how the SQL side would work. While PostgreSQL implements tables in files, you don't read data from the files, but instead ask the "postmaster" to give it to you. You might need to drop the data into a separate file outside the database in order to get it into a form that the PLC can get at... -- If this was helpful, rate me http://www3.sympatico.ca/cbbrowne/linux.html "Microsoft is a cross between the Borg and the Ferengi. Unfortunately, they use Borg to do their marketing and Ferengi to do their programming." -- Simon Slavin in asr