Variable: BlChannelProperties
- Updated2024-09-12
- 2 minute(s) read
Variable: BlChannelProperties
Variable: BlChannelProperties
The channel properties object provides the methods and properties to set the channel properties which you can use in the DAC save block.
| Definition | BlChannelProperties(i), Variant variable i = 1 ... BlSignalListLength |
![]() | Note You must use the following object hierarchy to access the variable:Call DACObjOpen(BlockName)
Value = BlChannelProperties(i)
Call DACObjClose(BlockName)You need the DAC block name to open the DAC block, to access the variable, and to close the DAC block. Refer to Accessing Objects in DIAdem DAC for more information. |
Methods
| Add | Adds a new property. |
| Delete(Index) | Deletes a property. |
Properties
| Count | Specifies the number of properties. |
| Name(Index) | Specifies the name of the property. |
| Type(Index) | Specifies the type of the property. The type can have on of the following constant values: DataTypeFloat64, DataTypeInt32, DataTypeString, and DataTypeDate. |
| PropValue(Index) | Specifies the value of the property. Use the @@ syntax to enter variables. Use the Save in Variables block to assign variables to values from the block diagram. |
The following example generates a new group property and assigns a name, a value, and a data type to this property. The example requests the signal name and generates a channel property with the data type, the name, and the value for all connected input signals.
| VBScript | Python |
Dim iCount, i Call DACObjOpen("Save1") BlGroupProperties.Add iCount=BlGroupProperties.Count BlGroupProperties.Type(iCount)=DataTypeFloat64 BlGroupProperties.Name(iCount)="MyGroupProperty" BlGroupProperties.PropValue(iCount) = 1.234 For i = 1 To BlDataInpSigMax(1) BlChannelProperties(i).add iCount=BlChannelProperties(i).Count BlChannelProperties(i).Type(iCount)=DataTypeString BlChannelProperties(i).Name(iCount)="MyChannelProperty" If BlDataSourceName(i,1)="Temperature" Then BlChannelProperties(i).PropValue(iCount) = "@@Monthname(month(now))@@" Else BlChannelProperties(i).PropValue(iCount) = "@@Weekdayname(weekday(now))@@" End if Next Call DACObjClose("Save1")
