0 evaluări0% au considerat acest document util (0 voturi)
18 vizualizări3 pagini
The document discusses how to keep track of the number of cars in a parking lot using a data register and flags. When a car enters, the data register is incremented by 1. When a car leaves, the data register is decremented by 1. The data register is continuously compared to the maximum capacity, and a lamp turns on when full. Another lamp encourages entry when spaces are available.
The document discusses how to keep track of the number of cars in a parking lot using a data register and flags. When a car enters, the data register is incremented by 1. When a car leaves, the data register is decremented by 1. The data register is continuously compared to the maximum capacity, and a lamp turns on when full. Another lamp encourages entry when spaces are available.
The document discusses how to keep track of the number of cars in a parking lot using a data register and flags. When a car enters, the data register is incremented by 1. When a car leaves, the data register is decremented by 1. The data register is continuously compared to the maximum capacity, and a lamp turns on when full. Another lamp encourages entry when spaces are available.
The control and manipulation of data allows the actual status of an action to be reported for example; How many cars are currently in the car park?
Keep Control of a Value
Keep Control of a Value
From a previous section of user program a car can be detected entering or leaving the car park. This information could be passed on to another section of program through the use of internal coils and flags. In this example the flags M070 and M071 represent the car entering or leaving the car park. When ever a car enters the car park the current record of the number of cars in the car park is incremented by 1, i.e. the contents of data register D030 has an INC instruction performed on it. Register D030 is continuously compared against the known maximum number of cars that can be accommodated; The CMP instruction is driven by special M coil M8000. When the values equal each other the car park is full, hence the compare instruction turns on lamp, LP1 (Y004) announcing the car park is full. If however, a car leaves the DEC instruction (driven by the flag M071 when the car leaves) decreases the data register D030 by 1 unit. While the number of cars in the car park are less than the maximum the lamp, LP2 (Y003) is driven encouraging drivers to enter.
Learn Python Programming for Beginners: Best Step-by-Step Guide for Coding with Python, Great for Kids and Adults. Includes Practical Exercises on Data Analysis, Machine Learning and More.
ChatGPT Side Hustles 2024 - Unlock the Digital Goldmine and Get AI Working for You Fast with More Than 85 Side Hustle Ideas to Boost Passive Income, Create New Cash Flow, and Get Ahead of the Curve
Microsoft 365 Guide to Success: 10 Books in 1 | Kick-start Your Career Learning the Key Information to Master Your Microsoft Office Files to Optimize Your Tasks & Surprise Your Colleagues | Access, Excel, OneDrive, Outlook, PowerPoint, Word, Teams, etc.
Microsoft PowerPoint Guide for Success: Learn in a Guided Way to Create, Edit & Format Your Presentations Documents to Visual Explain Your Projects & Surprise Your Bosses And Colleagues | Big Four Consulting Firms Method
Microsoft OneDrive Guide to Success: Learn in a Guided Way to Archive and Organize Your Files in the Microsoft Cloud Storage | OneDrive to Your Documents from any Device