GE Intelligent Platforms GEIP e-Forum


NOTICE: This forum is for users to exchange information about GE Intelligent Platforms products. While it is moderated by GE, each post may not be explicitly answered by GE Intelligent Platforms employees. If your case needs an immediate response, please call 1-800-433-2682.

Go Back   GE Intelligent Platforms e-Forum > Industrial Software > HMI/SCADA - iFIX

HMI/SCADA - iFIX Our second generation of HMI/SCADA technology. More secure, more powerful and more versatile than any other offering. Forum also includes WebSpace discussions.

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-28-2012, 12:29 PM
jasjohnson76 jasjohnson76 is offline
New Member
 
Join Date: Jan 2012
Posts: 14
jasjohnson76 is on a distinguished road
VB Picture Name passed into Form as reference object

Hello all,

I am not a VB programmer, but I am trying to use it to create a user friendly historical trending chart. I have copied someones form that allows the user to set the date/time/duration for the historical chart. In this form it has code the references the picture's name and chart object (example: Trendpic.Chart4.RefreshChartData) I would like to somehow pass the pictures name into that expression.

I tried creating a global string variable under the Global folder/User. I was able to get the pictures name into the form, but it is a string. So the code does not like the stringname.Chart4.RefreshChartData.

Picture Code
User.strCURPIC.CurrentValue = Me.Name

Form Code
Dim PicName As String

PicName = User.strCURPIC.CurrentValue

PicName.Chart4.RefreshChartData - Does not work any suggestions?
Reply With Quote
  #2  
Old 02-28-2012, 06:34 PM
granvil granvil is offline
Principal Member
 
Join Date: Feb 2007
Location: Auckland, New Zealand
Posts: 790
granvil is on a distinguished road
Try searching the iFIX VBA help for the FindObject function.
Reply With Quote
  #3  
Old 02-29-2012, 08:33 AM
jasjohnson76 jasjohnson76 is offline
New Member
 
Join Date: Jan 2012
Posts: 14
jasjohnson76 is on a distinguished road
@ granvil, Thank you for the reply. That did work, but it did not work. I was able to create a pointer object in the form of the picture object, but when I tried to change the values to the chart located in that picture I got an error "object doesn't support this property or method."

What I am trying to avoid is changing the name of the picture object in this form for every trending chart picture I create. I would just like to Save As new picture name and change the pens and the VB code remain the same. I just can't figure out how to reference the picture object in the form code.

Thanks again for your help.
Reply With Quote
  #4  
Old 02-29-2012, 06:44 PM
granvil granvil is offline
Principal Member
 
Join Date: Feb 2007
Location: Auckland, New Zealand
Posts: 790
granvil is on a distinguished road
Quick and dirty ...

Dim objPicture As Object
Dim objChart As Object
Dim strPictureName As String

strPictureName = "Chart_Main"

Set objPicture = System.FindObject(strPictureName)
Set objChart = findlocalobject(objPicture, "Chart")

objChart.Endtime = Now()
objChart.RefreshChartData
Reply With Quote
  #5  
Old 03-01-2012, 09:32 AM
jasjohnson76 jasjohnson76 is offline
New Member
 
Join Date: Jan 2012
Posts: 14
jasjohnson76 is on a distinguished road
Yes, Yes, Yes. That worked thank you granvil. I was close. I had everything except the objChart code and i was leaving the chart name in the expression. That is going to save me a lot of time. Thank you.

(Problem Solved!)
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:51 PM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

e-Forum Legal Notice





Contact Us     |     Privacy Policy     |     Terms & Conditions     2010 General Electric Company