03-28-2006 03:48 AM
03-28-2006 08:58 AM
Hi RCalicut,
Yes you can. Is this something you're willing to have hard-coded in the DataPlugin, or do you really want to pass the DataPlugin start and end parameters each time you use it?
When you create your binary Block object in the DataPlugin, it takes the current File.Position as the starting byte for the whole Block. You can either change the File.Position prior to creating the Block object or create the Block object and then change the Block.Position property to modify which value to start with. Below is an excerpt from the DIAdem 10 Help system on DataPlugins:
The following example reads channel values from a binary file. Because the file pointer is repositioned in the BinaryBlock, the first 25 values (200 / 2 channels / 4 bytes) in this file are ignored.
Dim oBlock : Set oBlock = File.GetBinaryBlock() oBlock.Position = 200 Dim oChn1 : Set oChn1 = oBlock.Channels.Add("FirstChannel", eI32) Dim oChn2 : Set oChn2 = oBlock.Channels.Add("SecondChannel", eI32) Dim oMyGrp: Set oMyGrp= Root.ChannelGroups.Add("MyChannelGroup") oMyGrp.Channels.AddDirectAccessChannel(oChn1) oMyGrp.Channels.AddDirectAccessChannel(oChn2)
Similarly, you can set the Block.Length property to set the maximum value in the Block to read into its channels. Note that the Block.Length counts values, whereas the Block.Position counts bytes.
Let us know if you need further assistance,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
03-29-2006 01:34 PM
03-30-2006 09:47 AM