Advanced Tutorial
1, 2, 3...
When the coin is inserted, we want to make a sound and change the displayed command.
1, 2, 3...
Include a script for displaying the user selection in the Selection Display and assign this selection to the
selection variable. Use the variables selection to store the number typed, pressed to note when the first digit
has been entered and selection_made to determine when the second digit has been entered therefore the
selection is complete.
Page 32
1.
Open the Workspace editor
2.
Right click on Project Script to add a new Project Script
3.
Set Trigger Event of Subroutine named Reset with the following script
code to reset variables:
credit = 0
selection = 0
ready = TRUE
pressed = false
selection_made = false
main.coffee.visible(0)
main.cup.visible(0)
displaytext = "Insert Coin"
main.Text_2.blink( black )
4.
On Main.pag add a Page Script with a Trigger Event of On Initialisation
to execute every time the page is loaded with the following code:
CALL Reset( )
1.
Copy the sound file cashreg.wav from the folder of the sample programs to
the project folder C:\Coffee
2.
Create a Page Script with Trigger Event of On Condition with an
Expression of credit == 1 and script code of :
displaytext = "Make a Selection"
PlaySound("c:\coffee\cashreg.wav")
OMRON
Revision 2.0
Need help?
Do you have a question about the CX-SUPERVISIOR - GETTING STARTED V2.0 and is the answer not in the manual?