You are on page 1of 20

TECHNOTES - QuickStart Note September 2007

Setting up Data Logging on CX-Supervisor

Objective:

Set up CX-Supervisor to log data to:


• Data Log Viewer
• Microsoft Excel
• Microsoft Access

Software used:
• CX-Supervisor ME
• Microsoft Access
• Microsoft Excel
Procedure for using Data Log Viewer:

1 Open CX-Supervisor developer and start a


new project

2
Add a Boolean and
a Real point – this
can be on a PLC or
a memory point
3 Open up project workspace

4 Choose the ‘Logging’ tab


5 Right click and ‘Add Data Set’

6 Give the Data Set a name and choose how


often a new log is created.

In this example, a new log will be created


after each hour, and all old logs will be stored
7 Add a ‘group’ to this Data Set and
give it a name
8 Add an ‘item’ to this group

9 Choose the real point you created earlier

The Data type is ‘Real’


Ignore ‘Deadband’ for now – set to 0%

Choose to Sample this ‘on change’ – the


point will be logged whenever its value
changes.

The maximum and minimum values should


be set to what you expect the data range to
be – these will take on the same value as
those when you created the point.
10 This point will now log whenever
its data changes

11 Now add your Boolean point to a second


group in the same way
12 Add some items to your page to enable you
to change the value of the points

13 Now run the project and play change the values a few times

14 Right click and choose to


see Data Log Viewer
15 When Data Log Viewer has started, choose
file and open a file in the ‘Data Logging’
folder of your project directory – a new one
will be added each hour (or week/month if
you selected a different option).

16
In the dialog,
choose group 1
and the item you
want to view.

You must select


the item before
pressing OK.
17
You can now view
the trace for this
item

18 Now choose to add some more items


19
You can select
multiple items
within a group or
you can choose
to select from all
items in the
dataset.
Multiple items are
selected by clicking
with the shift key
pressed

20
Now you can view
the boolean point
trace alongside the
real point trace

21 Further items can be added to a group using developer, data log viewer can display many items in graphical form
Further Experimenting
Data Log Viewer can be opened with the script command OpenLogView the wizard for this command will
help you view the right data file and data.

There are a number of other script commands that can be used for Data Logging, the wizards in the script
editor will help you use the commands correctly:
Procedure for Exporting Datalog to Microsoft Excel

1 Set up Data Logging

2 From Data Log Viewer choose to export the data:

3
Select the items you wish to
export in the same way you
choose the items to display.

Choose the export type


(CSV can be read by Excel)
4 Press the export Data button

5 You can choose to export and


view to open in the default
viewer for your chosen file type
(Probably Excel)
Further Experimenting

There are script commands to export


the log and to export and view

Procedure for Logging to a database

1 Choose the database tab from the project


workspace
2 Right click and ‘Add Connection’.

3 Choose a database to log


your data to. This must be a
Microsoft Access database in
Machine Edition.
Plus Edition supports some
other databases.
4 Once the connection is added you can
connect to the database so you can see
the tables you have set up

5 Right click and choose ‘Add Recordset’

6 Choose the table in your database you wish


to log to and set it to not be read only –
you can choose between optimistic or
pessimistic depending on if someone is
likely to edit the log from the database
while you are writing it

7 Right click the recordset and Add field

8 Set field up with the float value used earlier

Uncheck the read field on open as we intend


to write this value as a log
9 Now you have a field defined in a database
ready for your real number

10 Now go to the Logging tab, right click and


choose ‘Add DB Link’

11 On the Add Database Link window, choose


the recordset and you wish to log. You can
choose whether you want to log when the
value changes or at intervals.

12 Right click the new database link and


choose ‘Add DB field’

13 Again, choose the point you wish to log and


select a sensible minimum and maximum
value for it
14 You will now log the value of your point to
the selected database

Further Experimenting
For each point you wish to log, you must add the field to the
database and to the Database Logging.
You can add system point fields to a database log such as $date and $time.
Using CX-Supervisor Plus you can log to alternative databases such as
MySQL.
Microsoft also supply a database driver for Excel, this will work with
CX-Supervisor Plus but we would not recommend use of this as the way
Excel works as a ‘database’ can cause problems for novice users.

You might also like