SCADA system

User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
faq21 [2016/08/31 04:35]
scadalaquis created
faq21 [2018/10/05 08:46] (current)
Line 1: Line 1:
-[[:start|SCADA software ​LAquis FAQ]] | [[http://​|SCADA ​software]]+[[:​start|LAquis FAQ]] | [[http://​|SCADA ​system]]
-**Question**:​ How to record just one register to the database?+**Question**:​ How to customize reports via script?
 **Answer**: **Answer**:
-Normally database data are recorded automatically ​by intervals of time in Recording column when a database is defined.+Reports can be customized ​by script.
-When its needed the record just one register: +Example in OnAfterCalculation ​event:
-1 - Define a database at the tag sheet. +
-{{:​wiki:​image40.png}} +
-2 - Erase Recording column data of the database tags. +
-3 - In a script, for example inside an OnClick button ​event, type:+
-<​code>​ +<​code ​vbscript
-Tags.RecordNow +n=ldbcount ' Returns number of registers listed on report from database
-if you want to specify just one group of tags type Tags.RecordNow ( "​groupname"​ ) +if n>0 then 
-If there is more than one database, to record just one of them independently of groups, choose a tag from that database and type Tags.RecordNow ( "​tagname"​ )+
-If you want to record when an tag is triggered:+ ​c=ColumnName("​fieldname"​) ​  '​ get column number from tag / field name
-<​code>​ + for i=1 to n
-if Tag1 = 1 then +
- ​Tags.RecordNow +
- Tag1 = 0 +
-end if +
 +  l=LdbThisLine(i)
 +  x=cellsn(c,​l)
 +  ​
 +  ....
 +  ​
 +  x=LdbCellN("​fieldname",​i)
 +  ​
-To prevent from repeating:+ next
-if Tag1 = 1 then 
-if Tag1.ValueChanged = 1 then 
- ​Tags.RecordNow 
- ​Tag1.ValueChanged = 0 
-end if 
 end if end if
 </​code>​ </​code>​
-SCADA software+SCADA system
faq21.txt · Last modified: 2018/10/05 08:46 (external edit)

Tags: SCADA system , SCADA software