EasyManuals Logo

Omron CX-Supervisor Getting Started Guide

Omron CX-Supervisor
46 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #36 background imageLoading...
Page #36 background image
Coffee Machine scenario SECTION 3 Advanced Tutorial
35
You should now have a template Access database (or other) to use. The next
step is to add the database connections in the Developer.
1, 2, 3… 1. Open CX-Supervisor Developer and load the project.
2. Open the Workspace and switch to the Database tab
3. Right click and add a new connection called Connection1 and specify the
new template file C:\Coffee\coffee.mdb as the Data Source.
4. Right click the Connection and select Connect. The icon will change to
indicate the connection is live.
5. Add a new Recordset for adding records, called Recordset1 to the
connection and ensure Ingredients is selected as the table name for the
Source. To allow writing to the database make sure Pessimistic (or
Optimistic) lock is selected.
6. Add a Field called selection linked to point selection_made and Field
Selection. Change the Field Property to Add.
7. Repeat to add coffee linked to point coffee_amount and Field coffee
with the Field Property Add and repeat for milk, sugar, tea, and water.
8. Add a new Recordset for reading records, called Recordset2 to the
connection and ensure Ingredients is selected as the table name for the
Source.
9. Copy each field from Recordset1 and Paste to Recordset2. Change all the
Field Properties from Add to Value.
With the template of the database now defined, it is very to easy write the data
to the database.
1, 2, 3… 1. At the Project level, add a subroutine script called WriteToDatabase
2. Add code to write to the database, requery the table so that the latest data
can be seen, and navigate back to the original record:
DBAddNew( "Connection1.Recordset1" )
DBExecute( "Connection1.Recordset2", "Requery" )
DBMove( "Connection1.Recordset2", "Position", record_index)
3. Add script code to Make the Drink script to call the new subroutine
Written database records can now be viewed:
1, 2, 3… 1. At the Project level, add a subroutine script called ReadFromDatabase.
2. Add code to read to the database:
DBRead( "Connection1.Recordset2" )
record_index = DBProperty( "Connection1.Recordset2",
"CurrentRecord" )
3. Make a new page with the following properties
Page Title = Database
Border Style = THICK
Display Mode = POPUP
Top = 0
Left = 505
Height = 582
Sugar Number Integer
Field Name Field Data Type Field Size

Other manuals for Omron CX-Supervisor

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron CX-Supervisor and is the answer not in the manual?

Omron CX-Supervisor Specifications

General IconGeneral
BrandOmron
ModelCX-Supervisor
CategorySoftware
LanguageEnglish

Related product manuals