继续学习入门手册第三章。
Defined Variables
定义变量
The
photocell has two states, active and inactive, typically
represented by a Boolean variable. In this project, a Boolean
variable named Photo_Cell (true = active, false = inactive) is
used.
光电开关有两个状态,活动和非活动,通常使用布尔量表示。在本项目中,使用名字叫做Photo_Cell
(真表示活动,假表示非活动)变量表示。
The
entrance itself consists of two doors facing each other. Each door
is opened by a motor controlled by Boolean signals (Motor_1 and
Motor_2). The time the doors should remain open is declared in a
variable DoorsOpen_Time of type Time.
入口本身由两山相对的门组成。每一扇门通过布尔量(Motor_1
和Motor_2 )控制其电机打开。门保持打开状态时间使用Time类型变量DoorsOpen_Time来声明。
Each time
the photocell is activated, a counter representing the total number
of customers entering the shop should be incremented. The counter,
Customers_Qty, is of type Integer.
光电开关每活动一次,代表进入商场的客人数量的计数器递增一次。计数器
Customers_Qty属于整型。
- Reset the counter on certain dates 在某个日期重置计数器
On certain dates, the shop manager records the
total number of customers up to that date, and resets the counter.
Consequently, a Boolean variable Reset_Counter is declared, which
resets the counter.
在某些日期,商店经理记录截至该日总的顾客数量,重置计数器。因此,声明布尔变量Reset_Counter,重置计数器。
- Door service intervals 门维修时间
The doors should have regular service intervals,
approximately after every 10,000 openings; you also need to keep a
record of the number of openings from the previous service. The
record is represented as the variable Openings_Freq of type
Dint.
门有定期保养时间,大约每10000次打开之后;你同时需要保存从上一次维修之后的打开次数。该记录表示为双整型变量Openings_Freq。
When the
counter reaches the upper limit defined by Openings_Total of type
Dint, a flag (Service_Req of type Boolean) is set, indicating that
service is required. This flag can be accessed by all controllers
in the network. Manual reset of the service counter is activated
using a Boolean variable Serviced. The doors should continue to
work even if service is not performed.
当计数器达到双整型变量Openings_Total定义的上限,置位标志(布尔型Service_Req),指示需要维修。此标志可以被网络上所有的控制器访问。使用布尔型变量Serviced手动复位此标志。即使没有进行维修,此门也可以继续工作。
加载中,请稍候......