Developing an own cpp/ .NET Unit Operation

Discusses use of CAPE-OPEN compliant Process Modelling Components

Moderator: jasper

Developing an own cpp/ .NET Unit Operation

Postby CSchirmer » 17 July 2020, 13:45

Hello,
I'm a real beginner in developing .NET projects (but I think I'm not the only process engineer with this problem), so don't be surprised if my questions are very simple.
My task is to develop an own unit operation and I started with the cppMixerSplitterExample from the CoLan website as a base. I have edit the calculation method to my needs and added some classes, that I need for the calculation. I also started changing the Editdialog class. Now I want to test the unit Operation within COFE. What additional changes do I have to make in the example and what steps are neccessary for including it into COFE?
I am grateful for any kind of help!

Christoph
CSchirmer
 
Posts: 2
Joined: 07 July 2020, 12:15

Re: Developing an own cpp/ .NET Unit Operation

Postby jasper » 21 July 2020, 09:06

The CPP mixer splitter example of course is not a .NET unit operation. If your unit operation does not show up in COFE, you probably have not registered the DLL yet. The COM object must be visible to PMEs (including COFE) and for this you must put the information into the registry. Most COM DLLs, including that of cppMixerSplitterExample, are self-registering through the DllRegisterServer and DllUnregisterServer entry points. You can invoke these using Windows' regsvr32 utility for example:

regsvr32 CPPMixerSplitterexample.dll

from a cmd prompt (you may need to start the command prompt with admin rights).

If you want to get started in .NET, here's a possible example:

https://www.amsterchem.com/flowexchange.html
User avatar
jasper
 
Posts: 989
Joined: 24 October 2012, 15:33
Location: Spain

Re: Developing an own cpp/ .NET Unit Operation

Postby CSchirmer » 19 August 2020, 14:50

Thank you for your answer Jasper!

I have successfully registered the Unit Operation and can use it in the 32 bit Version of COFE. Now I would like to set it up as a 64 bit Version, so can you give me some advice what to change in the registration an structure of my Unit Operation to use it as 64 bit?
Furthermore I would like to ask, if there is a comfortable way of getting intermediate results from calculation which is done. The Unit Operation isn't just straight forward calculating. Several steps of iteration have to be done. The intermediate results would help me validating the Unit Operation.

Best,
Christoph
CSchirmer
 
Posts: 2
Joined: 07 July 2020, 12:15

Re: Developing an own cpp/ .NET Unit Operation

Postby jasper » 19 August 2020, 18:39

To run a 64 bit version, you will need to compile a 64 bit version first. Then register the 64 bit version and it should show up for 64 bit PMEs (I am presuming you are using C++ here, not .NET).

You could expose intermediate values via output parameters, or information ports, or via a report.
User avatar
jasper
 
Posts: 989
Joined: 24 October 2012, 15:33
Location: Spain


Return to Process Modelling Components

Who is online

Users browsing this forum: No registered users and 1 guest

cron