Instructions for waterslide
This set of instructions refers to sending someone through my slide on the paper version. However it will not work in visual control.
- Person A enters slide and activates the first movement sensor, which turns on the red light.
- Person A travels to corner 1 and then onto corner 2.
- When Person A activates movement sensor 2 the counter goes up by 1.
- Then when Person A activates and deactivates the pressure pad, the light will go green.
- Person B can then enter the ride, If Person B tried to enter the ride before the light was green then when the pressure pad is activated the speaker will tell Person B not to enter the ride.
These instructions will not work on visual control, because the instructions are not in a form that the computer can understand. They are not precise and instructions are not linked to the sensors and outputs and so are irrelevant pieces of information to the computer. The instructions need to be in a specific order so that the ride functions properly, if there is no order then there will be safety concerns.
After deciding upon the instructions for the slide, I designed it on a piece of paper before drawing my final design on paint. (see enclosed sheet)
Precision
My water ride must be precise for the following reasons:
- Firstly, the computer will not understand sentences, because it works on a numerical basis not a logical basis like a human mind. For this reason it is important that precise computer language is used so that my program functions correctly.
- Secondly, my slide relies on the use of components, which are related to specific commands, if the commands are not correct, then the components will not function correctly. Each command sends a signal (input) to a sensor, an output then enables the slide system to set up a procedure and the system is repeated.
This is an example of precision in my program:
I am using an output component, output 0 (a red light). In order for the output to function properly I had to use the command:
Switch on output 0
Wait 5
Switch off output 0
End
This commands are precise, if I try to control the red light with full sentences there is no result and the program fails to function, as can be seen from the following example.
When full sentences are used the computer does not understand and so the program fails to function. An error message occurred because the sentences do not send the correct signal to the components.
Order
Order in my program is important because a computer program must have a clear beginning and end. If this is does not happen then the system will fail. To enable a system to repeat a procedure then the components must receive signals in a particular order, if they weren’t received at the right stages then the system would fail.
Below is an example from my program:
I combined components and commands to create a fully functioning program.
In the above screenshot I was combining the green and red light components to create traffic lights to control the flow of people through the ride. In order to achieve this I had to change the order to make the components function properly. This was one of the hardest part of the program to write.
Implementation
First I designed the waterslide in paint, I made use of many of the design tools:
Stage 2
I then transferred the image into visual control, using file, load scene:
Stage 3 I tested my program, there was a problem, when the green light went out the red light did too. I wanted them to be alternate.
I then solved the problem and now have a fully functioning waterslide.
I will now explain which parts of the program control each component.
SWITCH ON OUTPUT 1
REPEAT FOREVER
WAIT UNTIL INPUT 0 IS ON
SWITCH ON OUTPUT 0
SWITCH OFF OUTPUT 1
:CT = :CT + 1
WAIT 5
WHILE INPUT 1 IS OFF
IF OUTPUT 0 IS ON THEN
IF INPUT 0 IS ON THEN
SWITCH ON OUPUT 2
END IF
END IF
END WHILE
SWITCH ON INPUT 1
SWITCH ON OUTPUT 1
SWITCH OFF OUTPUT 0
SWITCH OFF OUTPUT 2
IF :CT > 0 THEN
WRITE 1
END IF
IF:CT > 4 THEN
WRITE 5
END IF
IF:CT > 9 THEN
WRITE 10
END IF
IF:CT > 14 THEN
WRITE 15
END IF
END REPEAT
END
I tried to refine my program but there was no obvious way of shortening it as all of the content is vital to the smooth running of my water ride.
Evaluation
I found paint easy to use to design my waterslide and also transferring my image. Finding and placing the inputs and outputs on the design was reasonably easy but moving them to the desired position was slightly more difficult because you had to be in the right mode, which was hard to find because I was unfamiliar with the program. Writing a program was reasonably easy also as long as the inputs/outputs match the numbers in the program.
However to correct the errors I found quite difficult because I could not find the part of the program that was effecting the green and red light but eventually I was able to correct the error. The only problem was refining my program; there was no obvious way to refine it.
I had no problems in designing my waterslide, because I find paint easy to use and I am familiar with its design tools and could create a design with ease. Also transferring the image to visual control 2 was relatively easy. The advantages of paint are that it supports a format that is compatible with visual control 2. The disadvantages are that it doesn’t have an advanced editing system to create an accurate and complex design.
However the actual writing of the program on visual control 2 was something I found particularly hard, I found it difficult to match numbers with the inputs and outputs in my program. I also found the write panel hard to control and that part of my program hard to write. The advantages of visual control are that it can be operated without much training and is relatively user friendly. However the disadvantage is that the program cannot help you to correct errors, or even tell you where the error is, it has to be done manually, which can be very difficult.
There is a command box that consists of the inputs (light sensors and pressure pads). These inputs control the outputs or the design box (lights, buzzers and write panels). The outputs then feedback to the inputs so that the program can continue, by this the inputs then now what the outputs are doing and can tell other outputs how to respond appropriately.
This diagram can show the process:
OUTPUT PROCESS INPUT
FEEDBACK