Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Hysys - Excel link, BackDoorVariable

Status
Not open for further replies.

MortenMB

Mechanical
Apr 18, 2016
4
0
0
NO
I am trying to access the Initial holdup composition of a separator in a dynamic simulation. Since it seems that it cannot be done with the VBA functions in Excel, I want to do it with the BackDoorVariable function.

The link to the composition is given by:
FlowSht.1/UnitOpObject.400(V-100)/SepStage.500!:MoleFraction.101.0'

How can I access the separation stage of the separator? My code is:
-------------------------------------------------------------------------------------------------------------------------
Dim hyBD As BackDoor
Dim hyOp As Separator
Dim hyFS As Flowsheet

Set hyFS = Hycase.Flowsheet
Set hyOp = hyFS.Operations.Item("V-100")
Set hyBD = hyOp

Set hyBDvar = hyBD.BackDoorVariable("MoleFraction.101.0").Variable
---------------------------------------------------------------------------------------------------------------------------
It returns -32767, which is the empty value…The composition contains values, so it should return the composition value.
I think the error is in the: Set hyOp = hyFS.Operations.Item("V-100") , because it doesn’t have the “SepStage” part…Is there any way to include this?
 
Replies continue below

Recommended for you

How is your hybd variable defined? I would assume that it should be some kind of array (im not sure how the compositions are define - but there must be a list of components and their corresponding values)?
 
Hi!

I can't use this code =/ It seems I have to initialize from products, so just ignore the question.
But thanks for the response, I appreciate it!
 
Status
Not open for further replies.
Back
Top