工业过程 [英] An Industrial Process

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

问题描述

你好,

我正在尝试编写一个程序,该程序会根据输入(A,B,C和D)和先前的输入生成不同的输出,尽管我的程序必须在一定的时间间隔内工作(一个单元到达工作站),这相当简单每个时间单位)具有以下参数:

机器1必须采用1个时间单位才能生成输出单位V.

如果输入为B,则机器2占用1个单位才能生成输出W.如果输入为BC,则它需要2个时间单位并生成输出X.

如果输入是D,则机器3占用3个时间单位,并生成输出Y;如果它是DBC,并且产生输出Z,则机器3占用7个时间单位.

机器4占用5个时间单位,并生成输出T.

该输出将排队,然后选择,以便机器输出单个单元流.

程序启动后,必须在每个时间单位生成此输出单位.

我不太确定如何处理这种类型的过程,是否应该减慢该过程以使其符合标准,或者我该如何影响使用C的时间?

谢谢

[邮件地址已删除]

Hello,

I am trying to write a program which generates different outputs depending on the inputs (A, B, C & D) and previous inputs, this is fairly straightforward although my program has to work within a time frame interval (one unit arrives at the station every time unit) with this parameters:

Machine 1 must take 1 time unit to generate an output unit V.

Machine 2 takes 1 unit to generate an output W if the input was B. If the input was BC, it takes 2 time units and produces an output X.

Machine 3 takes 3 time units if the input was a D and generates an output Y, but 7 if it was DBC and it produces an output Z.

Machine 4 takes 5 time units and generates an output T.

This outputs will be queued and then selected so that the machine delivers a single stream of units.

This outputs unit must be generated every time unit after the program has started.

I am not quite sure how to approach this type of procedure, should I slow down the process so it meets the criteria or how could I affect time with C?

Thank you

[mail address removed]

推荐答案

mariormp写道:
mariormp wrote:

我不太确定如何处理这种类型的过程,我应该减慢过程的速度,使其符合标准吗?或者我会如何影响使用C的时间?

I am not quite sure how to approach this type of procedure, should I slow down the process so it meets the criteria or how could I affect time with C?


看起来您只需要正确定义这样的状态机:输出流仅仅是一个结果(并且,您不能"用C影响时间" -if我知道你了-).


It looks you just have to define properly such states machines: the output flow will be a mere consequence (and no, you cannot ''affect time with C'' -if I got you-).


这是理论上的问题还是来自现实世界的问题?您的系统是基于PC还是嵌入式处理器?您使用的是C还是C ++?

因为听起来很复杂,所以如果我要解决的话,我将制定出我想使用流程图执行的操作.如果需要在特定时间执行事件,则PC可以使用C ++中的计时器功能,但是在多任务系统的PC上,实时事件比较棘手.如果您使用的是嵌入式系统,那么它可能不适合您,因为它主要是基于PC的,但是如果我想在关键时刻控制工业过程,那么我将不使用PC,而是选择微处理器.我希望这会有所帮助.

祝你好运:)
Is this a theoretical (college) problem or one from the real world? Is you system based on a PC or an embedded processor? Are you using C or C++?

Since it sounds fairly complicated, if I was tackling it, I would work out what I wanted to do with a flow chart. If you need to perform events at particular times there are timer functions available in C++ for the PC, but real time events are tricky on a PC which is a multi tasking system. If you are using an embedded system this may not be the right forum for you as it is largely PC based, but if I wanted to control an Industrial process with critical timing I would not use a PC, I would choose a microprocessor. I hope this helps a little.

Best of Luck :)


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

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