Using RMChart in E3.

INTRODUCTION

The RMChart ActiveX can be used in E3 for graphic visualization of data. In addition, this is the ideal tool for presenting statistical information, since they are loaded into the database and do not need to be displayed in real time.

RMCDesigner

The RMCDesigner is a program that helps create and develop a template file (with .rmc extension) containing the chart’s initial settings. Although you can create this structure entirely via scripts, RMCDesigner has a friendlier graphical interface, which facilitates your work and provides instant preview of the effects applied.

 

 

After configuring the RMC file, you will have a chart’s structure template that ca be used alongside ActiveX in E3. To do so, the RMCDesigner provides a tool to extract the necessary code. You can access it via File – Get Source.

 

 

The language used in E3’s scripts is VBScript. Alternatively, RMCDesigner’s ASP language is an option whose syntax is compatible with VBScript. So, we will use the settings below to show you how to extract the code we want.

 

 

After clicking Ok, the code is copied to the Clipboard.

Integrating RMChart into E3

In E3, insert an RMChart object onto a screen by right-clicking it and selecting Insert – RMChartX. In the screen’s OnPreShow event, create a Script pick and paste the code obtained in RMCDesigner. In the figure below, the code previously generated is shown with its configured properties. As you can see, With command requires RMChartX1 variable to contain an RMChart object.

 

 

Therefore, right before the line With RMChartX1, insert the definition of the variable receiving the RMChart object that is on screen. Use the AppBrowser to locate it. Also, run Clear() method to prevent old data from being loaded into the ActiveX when the application is executed. Example:

set RMChartX1 = Item (“RMChartX1”)
RMChartX1.Clear ()

Now, whenever the screen is opened, this script will be executed, setting the chart’s initial configuration.

Loading data into the ActiveX At RMChart, each series (data set) displays the Datastring property, which contains the values to be drawn. This property requires that the values be separated by asterisks (“15*39*21*17”). So, when you have a bar chart, each value represents a bar. Following our example above, we would have:

 

 

Suppose we wish to present the total amount of historical alarms per area in this bar chart. To do so, we need to create a query that returns this information. When configuring a query, go to SQL tab and enable the option Enable SQL’s direct edition. The following code must be input:

SELECT Area, Count (ConditionActive) the TotalActiveAlarms
FROM Alarms
WHERE ConditionActive = 1
GROUP BY Area

 Area  TotalActiveAlarms
 TankArea1  590
 TankArea2  630
 TankArea3  740

 

On the screen containing the object RMChart, we must insert the following script:

 

 

As seen in the figure, you must create a variable that receives the RMChart object (in this example, RMChartX1) and execute the query previously mentioned by using GetADORecordset() method.Thus, the query’s result will be handled via scripts.

A While loop will run until the last record of the Recordset, concatenating the values returned according to the syntax of RMChart’s DataString property (590*630*740).Finally, Draw() method will perform the graphic design.

Final Remarks

Once you set the template and extract the code via RMCDesigner, the remaining task will belong entirely to E3, which will create and set queries, and then manipulate their results via Recordset. Thus, the data string will be set up, and then passed to the RMChart object.

The RMChart is a great tool for viewing statistical or historical charts. With its aid tool for building the template, your work becomes easier and the application becomes more attractive to the user.

Notes:

  • The RMCDesigner is not installed alongside E3.This software program and its components can be found for download on the Internet.
  • Attached, sample application using RMChart developed with E3 3.2 build 248.
Reference– VBScript Reference Guide
– RMChart Guide
www.rmcharts.com

Attachments:

AppRMChartEN-US_V1_00

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *