---
title: "Data Logging Exercise"
canonical: "https://manual.cimon.com/space/AUR/4495081473/Data%20Logging%20Exercise"
format: markdown
---
# <span style="color: #403294">**Exercise: Checking Data Logging with Object**</span>

## <span style="color: #4c9aff">**Data Logger Configuration**</span>

1. Create a Data Logger Model. Go to **Tools **>** Data Log Editor**. Click the **+ **to create the new Data Logger Model. Once created, name it “Counter.” Set the Logging Options to **Periodic** and 5 **Seconds**. Click **OK** to confirm the changes and exit the screen.

2. Go to **Insert **>** Data Log Table**. Click and Drag the Data Log table. Once the table is created, select it, and under **Data Logger Model**, select the Counter that was created. This will link it to the Data Logger table.

3. Create a new **Tag** named “Count.” Do this by going under Tag Editor and pressing the **Add Tag** button. Set the **Data Type** to **INT (INT16)**. Click **OK **to confirm the changes and create the new tag. Then, create a Bool Tag called “On.” Set the initial value to 0.
  

4. Go to **Tools **>** Data Log Editor**. Then select Counter. Click on the Tab **Tag List**, then click the **Add Tag** button. Once you do, click the **Add Tag** button on the new page, check “Count,” then click **Select**. This will save the Tags. Click **OK** to exit the Add Tags page, then click **OK** to exit the page.

5. Create a lamp on the page. To create a Switch/Lamp object, go to **Insert **>** Switch/Lamp** or left-click the **Insert Switch/Lamp** icon in the [Toolbar](https://cimon.atlassian.net/wiki/spaces/AUR/pages/4488265730). Then, click and drag on the screen to place the lamp. Once the Switch/Lamp object is created, drag the ON tag to the Lamp. This will bind the Value field to the Tag ON.

5. Click on **Tools > Script Editor**. Click the **+** icon to create a new script; on the popup window, under **Running Type**, select **Manual**; once selected, click **OK**. Copy and paste the following code into the new script:
  Once pasted in, right-click the script, click on **Script Properties, and** close the Script Editor by clicking OK. Select the lamp and go to the **Actions** tab. If **Actions** does not display, go to **View **>** Properties **>** Actions **and check the box. Under **On Press**, click the Action field and **Create New Command**. Click on **Add New Command** and select **Toggle Tag Value**. In the Tag field, select the ON tag. Then, in the top left of the Command Editor, click the **+ **icon to create a new command. Change the new command to **Call Script** and select the created script.

## <span style="color: #4c9aff">**Data Logger Runtime**</span>

1. Click** Tools** >**Launch Simulator** to launch the Canvas Simulator.

2. Click the lamp to toggle it On. The Count tag will update every 5 seconds when the lamp turns on. The Data Log will also reflect any changes made to the Count tag every 5 seconds.

3. Try changing the value of the count. Notice how the number will be correctly reflected in the following Data Log entry when you update the tag value.

##### <u><span style="color: #4c9aff">[Back to the top of Data Logging Exercise](https://cimon.atlassian.net/wiki/spaces/AUR/pages/4495081473/Data+Logging+Exercise#Exercise%3A-Checking-Data-Logging-with-Object)</span></u><u><span style="color: #4c9aff">.</span></u>