Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

We Value Your Feedback!
Could you please spare a few minutes to share your thoughts on Cloud Connected vs On-Premise Services. Your feedback can help us shape the future of services.
Learn more about the survey or Click here to Launch the survey
Schneider Electric Services Innovation Team!

Read a DataTable Modify it and Save into a new Table from GeoScada VBscript

EcoStruxure Geo SCADA Expert Forum

Schneider Electric support forum about installation, configuration, integration and troubleshooting of EcoStruxure Geo SCADA Expert (ClearSCADA, ViewX, WebX).

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • Remote Operations
  • EcoStruxure Geo SCADA Expert Forum
  • Read a DataTable Modify it and Save into a new Table from GeoScada VBscript
Options
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
sbeadle
Kirk sbeadle Kirk
308
AndrewScott
Admiral AndrewScott
98
BevanWeiss
Spock BevanWeiss
91
AdamWoodlandToo
Lt. Commander AdamWoodlandToo
37
View All
Related Products
product field
Schneider Electric
EcoStruxure™ Geo SCADA Expert

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Solved Go to Solution
Back to EcoStruxure Geo SCADA Expert Forum
Solved
AFallows
Ensign AFallows
Ensign

Posted: ‎2022-06-21 08:41 AM . Last Modified: ‎2023-05-02 11:55 PM

0 Likes
3
1198
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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

Read a DataTable Modify it and Save into a new Table from GeoScada VBscript

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 IDFORMATVAL('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.

 

 

Labels
  • Labels:
  • Scripting
  • Tags:
  • english
  • scada
  • SCADA app
  • SCADA software
  • SCADA tutorial
  • Telemetry and SCADA
Reply
Contact Support

Link copied. Please paste this link to share this article on your social media post.

  • All forum topics
  • Previous Topic
  • Next Topic

Accepted Solutions
AFallows
Ensign AFallows
Ensign

Posted: ‎2022-06-23 08:35 PM

In response to AFallows
0 Likes
0
1122
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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

 

 

See Answer In Context

  • Tags:
  • english
  • scada
  • SCADA app
  • SCADA software
  • SCADA tutorial
  • Telemetry and SCADA
Reply
Contact Support

Link copied. Please paste this link to share this article on your social media post.

Replies 3
AndrewScott
Admiral AndrewScott
Admiral

Posted: ‎2022-06-21 09:59 AM

0 Likes
2
1184
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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.


Andrew Scott, R&D Principal Technologist, AVEVA
  • Tags:
  • english
  • scada
  • SCADA app
  • SCADA software
  • SCADA tutorial
  • Telemetry and SCADA
Reply
Contact Support

Link copied. Please paste this link to share this article on your social media post.

AFallows
Ensign AFallows
Ensign

Posted: ‎2022-06-21 02:03 PM

In response to AndrewScott
0 Likes
1
1171
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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 

  • Tags:
  • english
  • scada
  • SCADA app
  • SCADA software
  • SCADA tutorial
  • Telemetry and SCADA
Reply
Contact Support

Link copied. Please paste this link to share this article on your social media post.

AFallows
Ensign AFallows
Ensign

Posted: ‎2022-06-23 08:35 PM

In response to AFallows
0 Likes
0
1123
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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

 

 

  • Tags:
  • english
  • scada
  • SCADA app
  • SCADA software
  • SCADA tutorial
  • Telemetry and SCADA
Reply
Contact Support

Link copied. Please paste this link to share this article on your social media post.

Preview Exit Preview

never-displayed

You must be signed in to add attachments

never-displayed

 
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

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.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of