El Lobo

Páginas: 22 (5491 palabras) Publicado: 18 de noviembre de 2012
JHGGGJHGH FHFCJGJHMHN,K












NMMMMMKB HOLAAAAAAAAAAAA












ChemCAD 5 services to visual basic applications











User Manual

































































chemstations, inc.







Introduction



CHEMCAD 5 offers threeapproaches link with Visual Basic applications or other Windows applications. In the first approach CHEMCAD 5 is activated as an out-of-process server from a Visual Basic application. This enables a VBA application, such as Excel macros, to delegate computational tasks to CHEMCAD 5 running in background. The second approach functions through the addition of a new unit operation in CHEMCAD 5 called “ExcelUnit”. With this unit operation, a user can program specific tasks in VBA macros within an Excel workbook, and CHEMCAD 5 can execute these macros in the context of a unit operation during a simulation run. The third approach facilitates user-specified rate expressions in use with CHEMCAD 5 built-in kinetic reactor (KREA) and batch reactor (BREA).

CHEMCAD 5 publishes a set of COM interfaces totwo type libraries, cc5.tlb and ccx2xls.tlb. Through these interfaces, many CHEMCAD 5 functions and data are made available to other Windows applications. By executing the interface methods, a user can retrieve flowsheet topology and its unit operations, update stream data and unit operation parameters, calculate k-value and enthalpy, flash streams and convert engineering units. This documentpresents a detailed discussion on the uses of these published interfaces within user-developed programs. We assume that user is familiar with VBA syntax and has some knowledge of Microsoft COM. The knowledge on process modeling with CHEMCAD 5 is necessary.



VB Server


In this approach, CHEMCAD 5 plays the role of a simulation engine, and the user application organizes the calculationactivities. The user application presents a user interface for any user instructions on the calculations, while CHEMCAD 5 carries out the instructions on the background. The user application is often developed in MS Excel using VBA programs. It is responsible for activating CHEMCAD 5 as a COM object. After activating CHEMCAD 5, the user application should proceed with its calculation tasks that may inturn be delegated to CHEMCAD 5.

To activate CHEMCAD 5, a user application executes VBA command CreateObject(“CHEMCAD.VBServer”), where “CHEMCAD.VBServer” is the programmatic identifier (ProgID) for CHEMCAD 5. This command returns a handle to an object interface called ICHEMCADVBServer. Through the methods on this interface, the user application can further access many other CHEMCAD 5 objectinterfaces. In this section, we discuss interface ICHEMCADVBServer and its methods. This interface is published in CC5.tlb.


Description ICHEMCADVBServer interface provides simulation job related operations and serves as an entry point to all other interfaces. Through this interface, a user application can find a simulation job, load one of its cases, update stream data or unit operationparameters, and run steady state or dynamic simulations.

A handle to this interface is often created using its programmatic identifier “CHEMCAD.VBServer” in a VBA macro. In the following example, a handle to ICHEMCADVBServer of CHEMCAD 5 is passed to VB variable CC5.






Dim CC5 As Object


Sub LoadCC5()
Set CC5 =CreateObject("CHEMCAD.VBServer")
End Sub







Definition: dispinterface ICHEMCADVBServer
{
methods:


boolean LoadJob(BSTR* bstrJobPath);
boolean RunJob();


// interfaces defined in ccx2xls.tlb
VARIANT GetFlowsheet();
VARIANT GetUnitOpInfo();
VARIANT GetUnitOpSpecUnitConversion();...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • los lobos
  • Lobos
  • El Lobo
  • El lobo
  • La loba
  • Lobo
  • Lobo
  • lobos

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS