工程灯继电器 [英] Project Lights Relay

查看:80
本文介绍了工程灯继电器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在印刷公司工作.我们有高速运转的大型印刷机.运营经理希望有一个系统,可以将机器的实际运行速度与正在打印的特定作业的最佳运行速度进行比较.这存储在具有工作编号字段和运行速度字段的excel电子表格中.

该项目由一组红色和绿色指示灯组成,这些指示灯连接到PC中的APCI-RELAY8/IN8卡,另一端连接到计算机上发送高脉冲的传感器.

最终,我需要在短时间内(可能是10秒)从传感器读取一个计数并将其转换为每小时脉冲数.然后,需要将其与从表中选择的作业号进行比较,该表具有相应的运行速度(以每小时脉冲数为单位).如果传感器的读数高于表中的值,那么我们需要向输出寄存器输出1以产生绿灯,而如果降低0则产生红色.

几件事...

问题是我不确定卡是否可以读取计数,就像我使用传感器从光电隔离输入中读取时一样,它给出一个值表示开,一个值表示关,而不是计数.

该解决方案在MS Access中是否可行,或者它是VB可执行文件?







这是我到目前为止所拥有的

.zip文件,包含驱动程序,示例代码和中继卡的有用帮助文件.

包含数据的Excel电子表格

中继卡手册



谢谢

Jeff McKee

I am currently on placement in a print company. We have large printing presses that run at high speeds. The operations manager would like a system that compares the actual run speed of the machine to an optimum run speed for the particular job they are printing. This is stored in an excel spreadsheet with job number fields and a run speed field.

The project consists of a set of red and green lights connected to an APCI-RELAY8/IN8 Card in a PC and the other end to a sensor on the machine that sends a high pulse.

Ultimately what I need is to read a count from the sensor in a short amount of time (possibly 10 seconds) and convert that into a pulse per hour value. This then needs compared to a selected job number from a table which has a corresponding run speed in pulses per hour. If the reading from the sensor is higher than the value in the table then we need to output a 1 to the output register to produce a green light and if lower a 0 to produce a red one

A few things…

The problem is that I am not sure if the card can read a count as when I read from the opto - isolated input using the sensor it gives one value for on and one for off, not a count.

Is the solution workable in MS Access or would it be a VB executable?







This is what I have so far

.zip file containing drivers, sample code and a useful help file for the Relay card

Excel spreadsheet containing data

Manual of the relay card



Thanks

Jeff McKee

推荐答案

答案不简单:访问"或"VB"-您需要考虑许多因素:
1)这些脉冲多快到达?
2)这些脉冲有多宽?
3)您可以为中断配置卡吗?如果是这样,您可以指定上升沿或下降沿检测中断吗?
4)可以将卡配置为计数脉冲吗?
5)您需要多精确?

这是实时数据:您正在尝试使用非实时代码对其进行处理.如果您需要准确或脉冲宽度很窄,则可能是失败者.检查手册:您甚至想开始考虑使用哪种前端软件,就想将尽可能多的处理工作转移到卡或其驱动程序软件上.


最大值为每小时130000个脉冲.这有帮助吗?
我是菜鸟."



每秒约有37个脉冲:这意味着假设脉冲波形为1:1(即只要其处于下降状态,就保持上升)
It''s not a straightforward answer: "Access" or "VB" - there are a number of factors you need to consider:
1) How fast are these pulses coming?
2) How wide are these pulses?
3) Can you configure the card for interrupts? If so, can you specify rising or falling edge detect interrupts?
4) Can the card be configured to count pulses?
5) How accurate do you need to be?

This is realtime data: you are trying to process it with non-realtime code. If you need to be accurate, or the pulse width is narrow, then you may be on a loser. Check the manual: you want to offload as much of the processing to the card or it''s driver software as possible, before you even start to think what kind of front end software to use!


"The max is 130000 pulses per hour. does this help?
I am a rookie."



That''s ~37 pulses per second: that means that assuming the pulse waveform is 1:1 (i.e. up as long as it is down)
_____       _____       _____       
     |     |     |     |
      -----       -----

然后每个脉冲的持续时间为0.01秒:您必须至少每0.01秒(或者更安全的是0.005秒)轮询一次液位检测器.不幸的是,检测器往往不是1:1的-波形通常看起来像这样:

Then every pulse has a duration of 0.01 seconds: you have to poll the level detector at a minimum every 0.01 seconds (or 0.005 seconds to be safer). Unfortunately, detectors tend to not be 1:1 - waveforms normally look like this:

_________   __________   ______
         | |          | |
          -            -

这意味着您要检测的脉冲为低电平且非常短.非常非常短.因此,为了在某个级别上使用轮询来准确地捕获它,您必须在每个低脉冲持续时间内至少轮询两次.在非实时环境中不容易做到! (在Windows中,当您要检查电平时,它可能会更新屏幕,因此您会被延迟而错过它)

查看您的主板文档:查看驱动程序是否可以为您进行检测,如果可以,则进行哪种检测.它很有可能检测到上升/下降沿,并可能还对脉冲进行计数或计时.

Which means that the pulse you are trying to detect is a low level and very short. Very, very short. So to catch it accurately using polling on a level, you have to poll at least twice during the duration of each low pulse. Not easy to do in a non-real time environmment! (With Windows, it could be updating the screen when you want to check the level, so you get delayed and miss it)

Check your board documentation: see if the driver can do the detection for you, and if so, what kind. There is a good chance it can detect rising/falling edge and possibly count or time the pulses as well.


这篇关于工程灯继电器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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