02-02-2012 09:56 AM
I am trying to write a script in DIAdem 2010 SP1 to delete the first row of a group that contains two string channels and one time channel, but the
wrong data is being deleted from the string channels.
I start with a file that contains a group like this:
I run this code expecting the first row to be deleted
Dim logGroup Set logGroup = Data.Root.ChannelGroups("Log") Call ChnAreaDel(logGroup.Channels("Name"),1,1) Call ChnAreaDel(logGroup.Channels("ID"),1,1) Call ChnAreaDel(logGroup.Channels("Timestamp"),1,1)
but end up with this:
The first row of the Timestamp channel is deleted, but the Name and ID channels get their last rows deleted.
I have played around a bit and it seems to me that for a string channel ChnAreaDel only deletes from the last row.
Is there another function I should use?
Any help would be appreciated.
Thank You,
Joe
Solved! Go to Solution.
02-03-2012 12:23 PM
Hi Joe,
I've reproduced that ChnAreaDel() bug you reported in both DIAdem 2010 and 2011-- really odd. In the meantime, you can use this older approach that uses a string parameter to point to the channel collection to remove the row(s) from:
Set logGroup = Data.Root.ChannelGroups("Noise data results") ChnStr = "" FOR Each Channel In logGroup.Channels ChnStr = ChnStrAdd(ChnStr, Channel.Properties("Number").Value) NEXT Call DataBlDel(ChnStr, 1, 1)
Brad Turpin
DIAdem Product Support Engineer
National Instruments
02-03-2012 02:31 PM
Thank you Brad,
Your alternative worked like a charm.
I had came across the DataBlDel command in Help, but the last note says that you cannot perform block operations on text channels, so I didn't try it.
-Joe