DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Channels with different sampling in a DataPlugin

Hallo,
 
actually i´m programming an DataPlugin for a textdatafile witch is build like this:
 
metadata
 
channelname1; channelname2; channelname3
value_ch1; value_ch2/value_ch2/value_ch2; value_ch3
value_ch1; value_ch2/value_ch2/value_ch2; value_ch3
....
 
The problem i have ist to get the values of the channel2 (ch2) into one channel.
 
Could anyone help me by solving this problem?
 
Thank You
 
Lacher


Message Edited by m.lacher on 07-14-2008 07:03 AM
0 Kudos
Message 1 of 2
(3,321 Views)
Hi Lacher,
 
Would it be possible to read this as a fixed-width ASCII file?  By that I mean that the values for channel 2 always start on the same character number in each row, with the same being true for all other channels as well (Excel has a fixed-width import option).  If so, then you can use DirectAccessChannels to efficiently load the multiple values from channel 2 on each line (provided it's always the same number of multiple values).  This you would specify with the property:
 
FixedWidthBlock.Channels(2).Formatter.SampleWidth = 3
 
If you can't read this as a fixed-width ASCII file, because the ";" delimiter does not always fall at the same location in each row, then you'll just have to parse the values manually with a VBScript loop inside the DataPlugin.  This will work but will be much slower than using a DirectAccessChannel.
 
Brad Turpin
DIAdem Product Support Engineer
National Instruments
0 Kudos
Message 2 of 2
(3,313 Views)