IDVBCMRecipeEdit3::setunitbinding_v103

Note:

There is not an equivalent Info method.

Method Signatures

 

C\C++

HRESULT SetUnitBinding_v103(

[in] BSTR bstrStepName,

[in] BSTR bstrUnitName,

[in] long lUnitID,

[in] long lMode,

[in, optional, defaultvalue(DEFAULT_WAIT_TIMEOUT)]

long lWait)

VB

Public Sub SetUnitBinding_v103(

ByVal bstrStepName As String,

ByVal bstrUnitName As String,

ByVal lUnitID As Long,

ByVal lMode As Long,

ByVal lWait As long)

This method sets a unit binding pair for the recipe.

Return Values

S_OK - success

else - failed

Memory Allocation

None

Visual Basic Usage Example

Private Sub Button1_Click()
    Dim strStepName As String, strUnitName As String
    Dim lUnitID As Long, lMode As Long
    Dim objRecipeInfo As DVBCMRecipeInfo
    Call GetRecipeInfoObject(objRecipeInfo)
    Call GetNewBoundUnitForRecipeStep(objRecipeInfo, strStepName, _
            strUnitName, lUnitID)
    Call objRecipeInfo.SetUnitBinding_v103(strStepName, strUnitName, _
            lUnitID, lMode)
End Sub

Parameter Name

Purpose

bstrStepName

The name of the step that is being changed.

bstrUnitName

The name of the bound unit for the step being changed.

lUnitID

The unit ID of the new bound unit.

lMode

The value (as long) for the alias' selection mode. 1=defer, 2=fixed, and 3=from policy

lWait

Optional. Default = 30000. Time to wait for a server resource in milliseconds.

Set the unit binding for the deferred alias by using the SetUnitBinding_v103 method and supplying the deferred unit alias name for the second argument as follows:

Call objRecipeEdit.SetUnitBinding_v103("Step Name", ""#Unit Alias Name#, _
    UnitID)

Example scenario

To NOT use the unit selection policy and run the step on a specific unit, you could use the following:

objRecipeEdit.SetUnitBinding_v103 "UP_MIX:1", "#MIXER#", 132, 1  // note that 132 is the arbitration id of unit and 1 is the selection mode.

To make the alias NOT use the policy but have the unit selection deferred, you could use the following:

objRecipeEdit.SetUnitBinding_v103 "UP_MIX:1", "#MIXER#", -999, 1  // note that -999 indicates {Defer}.

To make the alias just use the policy, use the following:

objRecipeEdit.SetUnitBinding_v103 "UP_MIX:1", "#MIXER#", -999, 3  // note the new selection mode.