Property: Offset for Channel <DataPlugin>
- Updated2024-09-12
- 1 minute(s) read
DataPlugin > Properties > Property: Offset for Channel <DataPlugin>
Property: Offset for Channel <DataPlugin>
Specifies the offset that is added when a value is read.
This property, used with the Factor 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.Offset
| Object | Channel <DataPlugin> Object with this property |
| Object.Offset | 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 one channel. When the channel values are read, each value is first multiplied by the factor 2, and then the offset 5 is added.
Dim oMyGrp : Set oMyGrp = Root.ChannelGroups.Add("MyChannelGroup") Dim oMyChn : Set oMyChn = oMyGrp.Channels.Add("MyChannelNum",eR32) oMyChn.Factor = 2 oMyChn.Offset = 5