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’.
Image 1- Data Set1

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.

Image 3- Data Set Row Method part 1

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.

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.

Image 6- Modified Cell Expression
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’.
Image 1- Data Set1
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.
Image 3- Data Set Row Method part 1
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.
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.
Image 6- Modified Cell Expression
게시 대상: 슈나이더 일렉트릭 Korea


도움이 필요하신가요?
제품 선택기
애플리케이션에 적합한 제품과 액세서리를 빠르고 쉽게 찾을 수 있습니다.
견적 받기
영업 관련하여 온라인으로 문의하시면 전문가가 연락드립니다.
구매처
해당 지역의 가장 가까운 슈나이더 일렉트릭 대리점을 쉽게 찾을 수 있습니다.
지원 센터
한 곳에서 모든 요구 사항에 대한 지원 리소스를 찾아보십시오.