我們的品牌

Impact-Company-Logo-English Black-01-177x54

歡迎造訪施耐德電機全球網站

歡迎訪問我們的網站
		
我们今天能为您提供什么帮助?
Use script code in Geo SCADA to read and modify DataSetRows Cell Expressions
Use script code in Geo SCADA to read and modify DataSetRows Cell Expressions

In Geo SCADA, there are various methods for defining the Data Set Rows expression. There is a detailed instruction in the Geo SCADA Expert Guide on how to manually set the expression in the Data Set Rows. In this article, I'll go over how the script codes in Geo SCADA can be used to read and write expressions in the Data Set Rows.
Initially, as you observe in the screenshot, I created a Data Set Row called DataSetRow 1 and connected it to Data Set 1, which has four different fields.  I have manually created the expression of the fields of DataSetRow 1 and the "InsName" expression is set to ‘Reservoir’.

Data Set1

Image 1- Data Set1



DataSetRow 1 initial Values

Image 2-  DataSetRow 1  initial Values


Therefore, we must have access to the Data Set Rows’ methods, which is this article's primary objective.
Following the Database Schema reference (https://tprojects.schneider-electric.com/GeoSCADAHelp/Geo SCADA 2020/Content/DatabaseGuide/WorkingwiththeDatabaseSchema.htm), there are two distinct methods to obtain and modify the cell expression in Data Set Row objects: GetCellExpr and SetCellExpr. The preview of the table in the database schema is displayed in the following screenshot.

Data Set Row Method part 1
Image 3-  Data Set Row Method part 1

Data Set Row Method part 2

Image 4-  Data Set Row Method part 2

The sample code I have provided will instruct you how to obtain and modify the field "InsName" expression from/to "DataSetRow 1."

Sub SetDataSetRow()

Set ObjDataSetRow = Server.FindObject(Server.ThisObject.Parent.FullName & ".DataSetRow 1")
MsgBox (ObjDataSetRow.Interface.GetCellExpr("InsName"))
ObjDataSetRow.Interface.SetCellExpr "InsName","'Valve'"

End Sub

The Data Set Row location within the database can be found using the first line, Server.FindObject(Server.ThisObject.Parent.FullName & ".DataSetRow 1"). The object's location within the same Mimic group is indicated by the usage of "Server.ThisObject.Parent.FullName." The "FindObject" method retrieves the variable of "Serverobject" and stores it in the "ObjDataSetRow".
We need to implement the interface method in order provide access to the Data Set Row's Methods. Therefore, when the second line is executed, a message box displaying the "InsName" field's expression appears.

Retrieved Cell Expression

Image 5- Retrieved Cell Expression

Lastly, as you can see in the screen shot below, the third line change the "InsName" cell expression to the "Valve" and stores it in the DataSetRow 1 object.
Modified Cell Expression

Image 6- Modified Cell Expression


施耐德電機Taiwan

探索更多
系列:
探索更多
系列:

需要協助?

  • 產品選型工具

    快速輕鬆地為您的應用找到合適的產品和附件。

  • 取得報價

    立即線上提交您的銷售需求,專業團隊將主動聯繫您。

  • 購買地點

    輕鬆在您所在地區找到最近的施耐德電機經銷商。

  • 支援中心

    在同一位置找到滿足您所有需求的支援資源。

  • 產品文檔
  • 軟體下載
  • 產品選型工具
  • 產品替代和替換
  • 幫助和聯絡中心
  • 尋找我們的辦公室
  • 取得報價
  • 人才招募
  • 公司簡介
  • 舉報不當行為
  • 無障礙
  • 新聞中心
  • 投資者
  • 專業洞察
  • 台灣施耐德電機學院
  • 綠色影響力落差調查
  • Schneider Go Green 2025
  • 隱私政策
  • Cookie通告
  • 使用條款
  • Change your cookie settings