Page 1 of 2

Visible Property of TeeChart 8 in Wonderware InTouch 10.0

Posted: Thu Sep 11, 2008 5:26 pm
by 15049274
I'm using a bit of script to make a chart be visible at times and not visible at other times. The script works fine most of the time. when the screen is first loaded the graph is not visible dispite setting the visible property to true. In the lines of code just before setting the object visible among other things I set 36 data points on the same graph to a number (to draw a staight line) then set the graph visible "#ChartBottomRight.Visible = 1;" all the other code assoiated with this graph works, this is visible if i hard set the visible propertie (check the box in properties) but that also makes it so that you can not hide the graph. What gives. my customer is not happy and I have told them I would look into it further.

Posted: Mon Sep 15, 2008 11:05 am
by narcis
Hi buck2825,

Sorry but your message is a little bit confusing. Could you please confirm that you are using TeeChart, the version you are using and which kind of application are you having problems with?

Thanks in advance.

Posted: Thu Sep 18, 2008 3:05 pm
by 15049274
I am usinging the latest TeeChart Pro 8.0.0.4 inside of wonderware Intouch 10.0 with HotFix SP3. The script I have is called on the show event of the screen and on a 120 sec time intervale to refresh the data. the line

#ChartBottomRight.Visible = 1;

is never exicuted on the show event but is on the refresh.

any thoughts?



**********************************************

DIM SQL_QUERY_NORTH AS MESSAGE;
DIM SQL_QUERY_SOUTH AS MESSAGE;


DIM strBR_Title AS MESSAGE;
DIM blLabels AS DISCRETE;
DIM intI AS INTEGER;


DIM intAimBR AS REAL;
DIM intScaleBR_Min AS REAL;
DIM intScaleBR_Max AS REAL;

intScaleBR_Min = 900;
intScaleBR_Max = 1800;
intAimBR = 1500;


strBR_Title = "Oxygen Consumed (scf/ton)";

blLabels = 0;

SQL_QUERY_NORTH = "DSN=WW; User ID=l3; Password=l3; SQL=Select * From EAF_BIG_DISPLAY WHERE (C_HT_ID LIKE '2%') ORDER BY Q_TAP_TIME";
SQL_QUERY_SOUTH = "DSN=WW; User ID=l3; Password=l3; SQL=Select * From EAF_BIG_DISPLAY WHERE (C_HT_ID LIKE '1%') ORDER BY Q_TAP_TIME";


#ChartBottomRight.Axis.Left.Title.Caption = strBR_Title;
%ChartObject4 = #ChartBottomRight.Series(2);
%ChartObject4.DataSource = SQL_QUERY_NORTH;
%ChartObject4.YValues.ValueSource = "F_O2_SCF";
%ChartObject4.LabelsSource="C_CREW";
%ChartObject4.Color = 65535;
%ChartObject4.Marks.Visible = blLabels;
%ChartObject4.Pen.Visible = 1;
%ChartObject4.asLine.Pointer.Visible = 1;
%ChartObject4.asLine.Pointer.Style = 1;
%ChartObject4.CheckDataSource();

%ChartObject4a = #ChartBottomRight.Series(1);
%ChartObject4a.DataSource = SQL_QUERY_SOUTH;
%ChartObject4a.YValues.ValueSource = "F_O2_SCF";
%ChartObject4a.Color = 12632256;
%ChartObject4a.Marks.Visible = blLabels;
%ChartObject4a.Pen.Visible = 1;
%ChartObject4a.asLine.Pointer.Visible = 0;
%ChartObject4a.asLine.Pointer.Style = 1;
%ChartObject4a.CheckDataSource();

#ChartBottomRight.Axis.Left.Automatic = 0;
#ChartBottomRight.Axis.Left.Minimum = -100000;
#ChartBottomRight.Axis.Left.Maximum = 100000;
#ChartBottomRight.Axis.Left.Minimum = intScaleBR_Min;
#ChartBottomRight.Axis.Left.Maximum = intScaleBR_Max;

%ChartObject4b = #ChartBottomRight.Series(0);
%ChartObject4b.Clear();
FOR intI = 1 TO 36
%ChartObject4b.Add(intAimBR,"", 12632256);
NEXT;

#ChartBottomRight.Visible = 1;

CurrentDisplay_Text = "MELT";

Posted: Mon Sep 22, 2008 8:56 am
by Pep
Hello,

it's strange, where are you setting the chart visible to false ( before the on show event ) ?
Does it works fine by leaving it always as visible ? (for the first time window is oppened)
Could you please try to add the following line before to set visible = 1 ? :

ChartBottomRight.Environment.InternalRepaint

Posted: Mon Sep 22, 2008 1:03 pm
by 15049274
it's strange, where are you setting the chart visible to false ( before the on show event ) ?
****if you right click on the graph then go to properties there is a check box for visible. when this is clicked it locks the object to visible (unable to change the visible property), this works fine. when unchecked it allows the user to change the visible property of the object. *****

Does it works fine by leaving it always as visible ? (for the first time window is oppened)

****Yes, on my display i have four graphs, ChartTopLeft, ChartTopRight...ChartBottomRight. all other graphs display all the time it is just the one that I would like to toggle between visible and not visible. ****

Could you please try to add the following line before to set visible = 1 ? :
ChartBottomRight.Environment.InternalRepaint

****This line had no effect on the proformance of the script, it was as if it where never added. InTouch syntax is as follows

#ChartBottomRight.Environment.InternalRepaint();

this did not work before or after the line where I set visible = 1****

Posted: Mon Sep 22, 2008 1:07 pm
by narcis
Hi buck2825,

The image you posted is not visible. Could you please check it?

Thanks in advance.

bump

Posted: Wed Sep 24, 2008 4:28 pm
by 15049274
read last post

Still having problems

Posted: Mon Sep 29, 2008 2:38 pm
by 15049274
can someone please look into my issue

Posted: Mon Oct 06, 2008 12:05 pm
by Marc
Hello,

As of yet, we've been unable to source a version of Wonderware with which to test the issue you report. If you know of the whereabouts of an evaluation version we can download to test the Chart behaviour please let us know.

Is it possible that the environment requires to do a refresh after changing a control's visibility?

In other respects we see no unusual behaviour with the TChart.Visible property when tested in different development environments, we recommend you contact the Wonderware support for their advice.

Regards,
Marc Meumann

Posted: Mon Oct 06, 2008 2:42 pm
by 15049274
lets make things a little easier to understand.

new application
wonderware intouch 10.0 sp 3
TeeChart Pro Active X 8

one form
one graph
one button
two lables

on load

i set run the following

**********************************
box1 = "test before";
#TChart1.visible =1;
box2 = "test after";
**********************************
results: in the lable "box1" the text reads "test before"
in the lable "box2" the text reads "test after"
the graph is not visible

on the click event of the button I call the script below

***********************************
IF #TChart1.visible == 0 THEN
#TChart1.visible = 1;
ELSE
#TChart1.visible = 0;
ENDIF;
************************************

results: when I click the button the graph becomes visible and invisible as you would expect.

my customer is becoming impatient.

Posted: Mon Oct 06, 2008 3:11 pm
by 15049274
while talking with wonderware

800-WONDER1 (800-966-3371) in the U.S. & Canada
(7 a.m. to 5 p.m. Pacific Time)
949-639-8500 outside the U.S.

they stated the you will have to talk to them directly about a demo licence.

wonderware had me place one of there active X controls on my test form

on the show event with the code below

***********************************
box1 = "test before";
#tchart1.visible =1;
#chart2.visible=1;
box2 = "test after";
***********************************

there control worked and yours did not

then on the click event of the button on my test form

code
**************************************
IF #TChart1.visible == 0 THEN
#tchart1.visible = 1;
#chart2.visible =1;
ELSE
#tchart1.visible = 0;
#chart2.visible = 0;
ENDIF;
*************************************
both controls worked fine

Posted: Mon Oct 06, 2008 3:20 pm
by Marc
Hello,

I've just seen your new update. We'll contact Wonderware for a demo version.

Regards,
Marc

Posted: Mon Oct 06, 2008 4:06 pm
by Marc
Hello,

With your last latest description we've been able to reproduce the problem in an onload event in VB. The problem relates to how the 'Visible' keyword itself is handled within the COM control. We've added a fix for the next maintenance release. We're looking for a workaround that can give you a solution in the interim.

Regards,
Marc

Posted: Mon Oct 06, 2008 5:55 pm
by 15049274
thank you kindly. please let me know as soon as you have an intrum fix. also when is the next maintenance release scheduled.

Posted: Tue Oct 07, 2008 9:08 am
by Marc
Hello,

This is a workaround we've checked in VB, I can't confirm yet that it will function correctly in Wonderware. We'll check it in Wonderware too when we have the version ready to test.

If Chart is set as non-visible at design time and requires to be visible when run:

Code: Select all

Private Sub Form_Load()
 Firstload = False
 TChart1.Environment.InternalRepaint
End Sub

Private Sub TChart1_OnAfterDraw()
  If Firstload = False Then
    Firstload = True
    TChart1.Visible = True
  End If
End Sub
If Chart is set as visible at design time and requires to be non-visible when run:

Code: Select all

Private Sub Form_Load()
 Firstload = False
End Sub

Private Sub TChart1_OnAfterDraw()
  If Firstload = False Then
    Firstload = True
    TChart1.Visible = False
  End If
End Sub
The technique assumes that you have access in Wonderware to the TeeChart event OnAfterDraw. It uses the global variable Firstload to enter only once in the loop after the Chart is painted to set Visible to True or False.

I don't have a date yet for the maintenance release but it may be available within two-three weeks. That could be accelerated if necessary.

Regards,
Marc