Property: Factor for DirectAccessChannel
- Updated2024-09-12
- 1 minute(s) read
DataPlugin > Properties > Property: Factor for DirectAccessChannel
Property: Factor for DirectAccessChannel
Specifies the factor that the read value is multiplied by.
This property, used with the Offset property, can be used to calibrate values as they are read in. The formula for conversion is as follows:
Value = Factor*File value + Offset.
Object.Factor
| Object | DirectAccessChannel Object with this property |
| Object.Factor | Double with read and write access |
| Note The properties Factor and Offset are ignored when text channels and time channels are read. For all other channel types, the conversion formula returns a Real result. |
The following example creates a new channel group with a DirectAccess channel. When the channel values are read, each value is first multiplied by the factor 2, and then the offset 5 is added.
Dim oBlock: Set oBlock = File.GetBinaryBlock() Dim oChn : Set oChn = oBlock.Channels.Add("MyChannel",eI32) Dim oMyGrp: Set oMyGrp = Root.ChannelGroups.Add("MyChannelGroup") Dim oMyChn: Set oMyChn = oMyGrp.Channels.AddDirectAccessChannel(oChn) oMyChn.Factor = 2 oMyChn.Offset = 5