DIAdemヘルプ

Object: Assignment <Data>

  • 更新日2024-09-12
  • 5分で読める

Object: Assignment <Data>

The assignment object provides an individual assignment of an assignment channel in the script interface for internal data. A text value (property Value) is assigned to a numeric value (property Definition) or to a value range (property DefinitionRange) in order to define an assignment.

Note  Assignment channels do not support assignments to time values.

The following example generates an assignment channel with three assignments and displays the value ranges and the associated text values:

VBScriptPython

 

Dim oMyGrp, oMyChn, oMyAssgnList, Assignment, vRange
Set oMyGrp = Data.Root.ChannelGroups(1)
Set oMyChn = oMyGrp.Channels.AddAssignmentChannel("MyAssignmentChn","Default Value", DataTypeChnFloat64, 1)
Set oMyAssgnList = oMyChn.AssignmentList
Call oMyAssgnList.Add("text1",Array(10,20))
Call oMyAssgnList.Add("text2",Array(30,40))
Call oMyAssgnList.Add("text3",Array(50,60))
For Each Assignment in oMyAssgnList
  vRange = Assignment.DefinitionRange
  Call MsgBoxDisp("Definition Range " & vRange(0) & " - " & vRange(1) & ": " & Assignment.Value)
Next