如何使用串行连接将指令从主机PC传送到plc [英] How to communicate instructions from a host pc to a plc using serial connection

查看:76
本文介绍了如何使用串行连接将指令从主机PC传送到plc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开始一个涉及通过RS 232电缆在主机和机器plc之间进行通信的项目。



机器:Lauyans&Co。的High Cube II(这是一个小型零件存储和检索系统,用于在垂直大型库存单元内存储物体,形状为立方体内部有多个搁架单元。



功能:由操作员用户界面控制,机器在立方体内挑选和抓取存储架并降低它们以供用户使用检索并放置单元中的部件。货架已分配编号,以便用户可以在操作员的用户界面中键入所需的货架编号。该界面的形状类似于小键盘,其显示屏显示指令和用户输入的任何内容。接口连接到机器本身并连接到逻辑控制器。



我的目标是删除在操作员界面中输入位置编号的手动步骤相反,从主机命令存储系统并从那里发送货架编号。由于对串行通信和软件开发知之甚少,我应该采取哪些步骤来创建一个应用程序,允许我从我的主机计算机发送所需的货架输入并操作机器?



机器逻辑板上有一个RS 232输入标记为主机连接,所以我打算在那里建立连接。看起来将架号的键击直接发送到用户界面似乎更容易,但设备上没有可用的输入选项。如何打开端口进行通信并使用文本框开发一个简单的应用程序来输入一个架子并将其传输到plc?它会取决于plc的品牌吗?感谢您的任何建议。

I am currently beginning a project that involves communication between a host computer and a machine plc by means of a RS 232 cable.

Machine: High Cube II by Lauyans & Co. (It is a small parts storage and retrieval system used to store objects within a vertically large inventory unit shaped as a cube with multiple shelving units inside).

Capabilities: Controlled by a operator user interface, the machine picks and grabs storage shelves within the cube and lowers them down for the user to retrieve and place parts in the unit. The shelves have assigned numbers so that the user can type the desired shelf number into the operator's user interface. This interface is shaped like a small keyboard with a display screen showing instructions and whatever is input by the user. The interface is attached to the machine itself and wired to the logic controller.

My goal is to remove the manual step of typing in the location number into the operator interface and instead, command the storage system from a host computer and send the shelf number from there. With very little knowledge on serial communication and developing software, what steps should I take to create an application that will allow me to send the desired shelf input from my hosting computer and operate the machine?

There is a RS 232 input on the machines logic board for what is labeled as "host connection" so I plan on making the connection there. It seems like it would be easier to send keystrokes of the shelf number directly to the user interface but there in no available input option on the device. How do I open the ports for communication and develop a simple application with a text box to input a shelf and transmit it to the plc? Will it depend on the make of the plc? Thanks for any suggestions.

推荐答案

首先要看的是套件本身,看看它内置了哪些通信功能,以及如何使用它们 - 这可能意味着查看制造商的网站和/或他们的技术支持。串行通信不一定是通用规范,除非您可以直接对机器本身进行编程(不太可能但可能),您必须在它们提供的任何框架内工作。大多数制造商提供文件(但质量可能会有很多不足之处!)



一旦你知道你必须发送/接收哪些数据以及如何做到这一点PC端应该相对简单,如果你已经熟悉串口通信。这应该有很大帮助: C#中的串口通信初学者 [< a href =http://www.codeproject.com/Articles/678025/Serial-Comms-in-Csharp-for-Beginnerstarget =_ blanktitle =New Window> ^ ] - 格伦是一名电子工程师,也负责编码,并通过实例很好地介绍了这一点。
The first thing to do is look at the kit itself and see what communications capabilities are built into it, and how you can use them - this probably means a look at the manufacturer's site and / or their technical support. There isn't necessarily a "common specification" for serial comms and unless you can program the machine itself directly (unlikely but possible) you will have to work within whatever framework they provide. Most manufactures provide documentation (but the quality can leave a lot to be desired!)

Once you know what data you have to send / receive and how to do it the PC side should be relatively simple, if you are familiar with serial comms already. This should help a lot: Serial Comms in C# for Beginners[^] - Glen is an electronics engineer who also does coding, and it covers it all pretty well with examples.


这篇关于如何使用串行连接将指令从主机PC传送到plc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆