EcoStruxure Geo SCADA Expert Forum
Schneider Electric support forum about installation, configuration, integration and troubleshooting of EcoStruxure Geo SCADA Expert (ClearSCADA, ViewX, WebX).
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-06-21 08:41 AM . Last Modified: 2023-05-02 11:55 PM
Hi Experts,
I need some help with Modifying an existing data table.
What I need help with is creating a visual basic script to read in the confifuration of an existing data table, do a string replace on specific cell configuration and then write the information into a new data table.
For example my Data is
'GASWELL' | FORMATVAL('yyyyMMdd',"Canbriam.~Config.Logic.ProductionDate") | Canbriam.SCADA.b-72-A Field.c-07-H_94-B-8.Well 1.Gas Meter.Meter Parameters.Meter ID | FORMATVAL('0.00',"Canbriam.SCADA.b-72-A Field.c-07-H_94-B-8.Well 1.Gas Meter.Daily Values.PDay Hrs Ydy.CurrentValue") | FORMATVAL('0.00',"Canbriam.SCADA.b-72-A Field.c-07-H_94-B-8.Well 1.Wellhead.Casing;Average;D-16H;1D") | FORMATVAL('0.00',"Canbriam.SCADA.b-72-A Field.c-07-H_94-B-8.Well 1.Wellhead.Tubing;Average;D-16H;1D") | FORMATVAL('0.00',"Canbriam.SCADA.b-72-A Field.c-07-H_94-B-8.Well 1.Sand Separator.Sand Pressure;Average;D-16H;1D") | FORMATVAL('0.00',"Canbriam.SCADA.b-72-A Field.c-07-H_94-B-8.Well 1.Gas Meter.Daily Values.PDay Temp.CurrentValue") | FORMATVAL('0.00',"Canbriam.SCADA.b-72-A Field.c-07-H_94-B-8.Well 1.Gas Meter.Daily Values.PDay Static Press.CurrentValue") | FORMATVAL('0.00',"Canbriam.SCADA.b-72-A Field.c-07-H_94-B-8.Well 1.Gas Meter.Daily Values.PDay Diff Press.CurrentValue") |
Which I need to Change to
'GASWELL' | '20220614' | "Canbriam.SCADA.b-72-A Field.c-07-H_94-B-8.Well 1.Gas Meter.Meter Parameters.Meter ID" | FORMATVAL('0.00',"Canbriam.SCADA.b-72-A Field.c-07-H_94-B-8.Well 1.Gas Meter.Daily Values.PDay Hrs Ydy;Start;D+7H59M59S-5D;1H") | FORMATVAL('0.00',"Canbriam.SCADA.b-72-A Field.c-07-H_94-B-8.Well 1.Wellhead.Casing;Average;D-5D16H;1D") | FORMATVAL('0.00',"Canbriam.SCADA.b-72-A Field.c-07-H_94-B-8.Well 1.Wellhead.Tubing;Average;D-5D16H;1D") | FORMATVAL('0.00',"Canbriam.SCADA.b-72-A Field.c-07-H_94-B-8.Well 1.Sand Separator.Sand Pressure;Average;D-5D16H;1D") | FORMATVAL('0.00',"Canbriam.SCADA.b-72-A Field.c-07-H_94-B-8.Well 1.Gas Meter.Daily Values.PDay Temp;Start;D+7H59M59S-5D;1H") | FORMATVAL('0.00',"Canbriam.SCADA.b-72-A Field.c-07-H_94-B-8.Well 1.Gas Meter.Daily Values.PDay Static Press;Start;D+7H59M59S-5D;1H") | FORMATVAL('0.00',"Canbriam.SCADA.b-72-A Field.c-07-H_94-B-8.Well 1.Gas Meter.Daily Values.PDay Diff Press;Start;D+7H59M59S-5D;1H") |
My D- Offset will change depending on a variable I enter elsewhere.
I can't seem to figure out how to read in the CDataTable Object into VBA where I can modifiy it.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-06-23 08:35 PM
For Anyone that may come across this in the future the commands are
DataSet.Interface.GetCellExpr(r,c)
DataSet.Interface.SetCellExpr r,c,string
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-06-21 09:59 AM
Are you sure you're using a data table and not a data grid?
The example shown above shows cells containing expressions, but data tables store values (numbers, strings, dates etc.) not expressions in each cell.
Both tables (CDataTable and CDataGrid) have database methods that can modify them, see the database schema for details of the available methods. For data grids the GetCellExpr() and SetCellExpr() methods can be used to get/set the expression in an individual cell of the grid.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-06-21 02:03 PM
You are correct. It is a DataGrid, not a table. Sorry for my error.
If the DataGrids are labelled
DataGrid1
DataGrid2
Could you provide an example on a VBscript to:
Load DataGrid1
Read 0,0 from DataGrid1 into Array of string
Load DataGrid2
Write 0,0 from ArrayofString to DataGrid2
I'm unsure of the syntax
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-06-23 08:35 PM
For Anyone that may come across this in the future the commands are
DataSet.Interface.GetCellExpr(r,c)
DataSet.Interface.SetCellExpr r,c,string
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.