Trang chủ Liên hệ

Cách sử dụng “USER Log Database”?

CÔNG TY TNHH THIẾT BỊ ĐO LƯỜNG VÀ ĐIỀU KHIỂN 21/06/2023

Cách sử dụng “USER Log Database”?

USER LOG DB overview

1) USER LOG Database is used for simple data search or data insert in CIMON-SCADA instead of using commercial database.

2) The data will show on “List Control”

3) The data can be printed out as PDF or Excel format. Therefore, user cannot modify PDF format.

4) This manual is made under assuming that user is able to use CIMON-SCADA basic  functions.

1. DB Model Editor

Open CimonD and click [Tools]  [User LOG DB]

[DB Model Editor]

① Database Name – Write DB model name
② Save Path – Select Save Path which Log Data file will be saved
③ Save Days –Maximum days for data saving.
④ Add –Add new DB model.
⑤ Registry –Update property of DB model.
⑥ Delete – Delete selected DB model
⑦ Close – Close DB Model Editor
⑧ Item Add – Add new Items in DB model.
⑨ Item Delete – Delete Item in DB model.
⑩ Item Edit – Edit selected item.

[Item Edit window]

① Name – Write Item name
② Data Type – Select Data type of Item
③ Data Size – If “String” is selected as Data Type, you can assign string data size maximum 80 letters in case of English letter.
④ Tag – Select tag name which is designated to Item. Tag value is updated to this item.

2. Calendar setting

[Making Tag]
Make String tag which will receive date or time
This tag must be String and virtual tag.

[Making Calendar on the page]

Make page and click [Draw]  [Library]
Select Window Control and click the Calendar

Drag the Calendar to the page and double click “Calendar control”

Write the String tag name or select string tag after click “Finder

If you select “Date” at [Display Type], February 20, 2013 will be saved at tag as 20130220.

If you select “Time” at [Display Type], 1:36:27PM will be saved at tag as 133627

[Check Calendar operation]

Run “CimonX” and click [View]  [Database].
Check the tag value when you change calendar value

This Database shows Data and Time tag values when Calendar is changed.

3. List Control Setting

[Making List Control on the page]
Click [Draw]  [Library]  [Window Control]

“List Control” shows Log DB value. In order to operate Log DB, Script must be used

[Display Setting]
Double click “List Control” on the page.

① Log DB Use – In order to make column name and size on “List Control”, do not select “Log DB Use”.
In order to make column by “Import Log Model” automatically, click “Log DB Use”
② ADD – It is used to add Column name and Column size on the “List Control”
③ EDIT – It is used to edit the added column name and size.
④ DEL – It is used to delete the added column name and size.

[Import Log Model]
Double click “List Control” on the page.

① Log DB Use – If you already made “Log DB Model” at the first step and want to import Log Model, select “Log DB Use”

② Log DB Model – Select one of Log DB Models that you already made.

③ Import Log Model – After select DB model, click it to import log models
to show on the “List Control”

After importing Log Models, you can only edit column name and size.

[Extra Setting]

① Col Tag – It is used to save column’s location when you click items on the “List Control”. Select Analog tag here.
② Row Tag – It is used to save row’s location when you click items on the “List Control”. Select Analog tag here.
③ Pattern Path –Make Excel form in folder. List Control data will be saved in this format and print out to Excel or PDF format.
④ Password – It is used to make password on Excel file.
⑤ Data Start Pos – Assign the column and row which data will be saved from this position.
⑥ Sheet Num – Assign sheet number which data will be saved. Sheet number starts from 0.

4. Summary for Sample project

-There are Basic sample and Advanced sample projects.
-If Product (String tag) value is changed, related TC, ALERT and PRESS’ value is saved.
-First of all, make tags as following picture.

Make “PRODUCT” Group and 4 virtual tags as below.
CODE – Product Code (String tag)
TC – Temperature value (Analog tag)
ALERT – Alarm tag (Digital tag)
PRESS – Pressure value (Analog tag)

-Make Log DB Model as below.

-Make the page as below.

- Make 2 Calendars as Date Types and 2 Time Types as above.

Make 4 String tags as SDATE, STIME, EDATE and ETIME under PRODUCT group. Match those tags to Calendar date and time.

-Set up “List Control” as below.

Click “Log DB Use” and select Log DB Model. After click “Import Log Model”, change the Column size and then Click “EDIT”.

-The final result is as below.

1. Tag name : PRODUCT.SDATE, Display Type : Date
2. Tag name : PRODUCT.STIME, Display Type : Time
3. Tag name : PRODUCT.EDATE, Display Type : Date
4. Tag name : PRODUCT.ETIME, Display Type : Time

5. Script for Basic sample

-Data Insert
① Use DbInsert(“LogDB model name”) for adding data.
② Make script as below.

③ Click “Database” and select PRODUCT.CODE. Select “Run Tag Action for tag value change” in General and write below script at Tag Action.
RunScript(“PrInsert”)

If PRODUCT.CODE is changed, tag value is save at Log DB Model.

④ Run CimonX
⑤ Open Database and write value to PRODUCT.TC , PRODUCT.PRESS,

PRODUCT.ALERT and then change the value of PRODUCT.CODE.
As value is changed, PrInsert runs and data is saved at Log DB.

-Data Finder

① Make script as below.

Make “FIND” button and write script as below.

Script is RunScript(“PrTimeFind”)

② Run CimonX and set up the date and time and then click “FIND”

-Data Print

① Make Excel file and below and save it in folder.

② Double click “List Control” in CimonD.

③ Make script as below.

④ In order to run script, make a button and write RunScript(“PrOutput”) as Command.
⑤ After Click FIND, click FILE to print out.

⑥ If you check Pattern path folder, you can find out excel or PDF file that you assigned.

<CSV file format>

<Excel format>

<PDF format>

-List Control Event

① Make two Analog tags (COL and ROW) in PRODUCT Group.
② Double click List Control in CimonD and select Col Tag and Row Tag as below.

③ Make String Tag( SEL_STR) in PRODUCK Group.
④ Make the script as below.

⑤ As row and column are changed, RunScript(“PrListChange”) runs automatically.
⑥ If you click different rows and columns after running CimonX, the tag value of PRODUCT.SEL_STR is changing

USER LOG DB Manual1

Bài viết liên quan