Most of the examples for DataPlugin programming use channel names in separate lines, like the following example:
Channel
Name: Time
Type: Time
Channel
Name: XShift
Type: R64
Channel
Name: YShift
Type: R64
Most of my data sets have channel names and / or units in one tab-separated line such as
"Dehnung" "Standardkraft" "Sensor" "Zyklusnummer" "PWM"
"mm" "N" "V" "" "%"
Is there a more efficient way of adding channels named and equipped with units as per these lines than cycling through some index variable? As my channel number, naming etc. vary frequently, I'd be looking for a more flexible solution, avoiding fixed array sizes or hard-coded names.
I suppose
aMyChannelNames = split(File.GetNextStringValue(eString), vbTab)
aMyChannelUnits = split(File.GetNextStringValue(eString), vbTab)
for i = 0 to UBound(aMyChannelNames)
Set Channel = Block.Channels.Add(aMyChannelNames(i),eString)
channel.porperties("Unit")=aMyChannelUnits(i)
next
might do the job - but is this the most efficient way?
Thank you for assisting.
Michael