DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

adding channels to the view

I am trying to add channels to a view using the vb method

view.sheets(1).Areas(1).DisplayObj.columns.add(iChannelNo)

When I do this it takes about 40 seconds to bring in 100 channels.
When I select the channels manually and drag and drop them into the
view, it only takes 1 or 2 seconds.
What am I doing wrong?
0 Kudos
Message 1 of 3
(3,134 Views)
There is a difference between interactively draging a whole bunch of
channels into the table and programatically adding the channels one
after the other in a VBS.
In your script, the table view is refreshed after each adding command
(even if the module view is not visible). This takes a certain abount
of time if there are numerous channels to be redrawn. You can use the
property view.autorefresh to change this behaviour. Have a look at my
script, it is generating a table of 100 channnels without refreshing
VIEW after each of them. This accelerates the action to some view
seconds.

wndshow "VIEW"
view.autorefresh = false
view.newlayout
view.activesheet.ActiveArea.DisplayObjType="ChannelTable"
for iCNo =1 to 100
view.activesheet.ActiveArea.DisplayObj.columns.a
dd(iCNo)
next
view.autorefresh = true


Ingo Schumacher
Application Engineering
National Instruments
0 Kudos
Message 2 of 3
(3,134 Views)
Hi Anonymous,

The speed also depends on whether you create the table columns one at a time or pass the method an array of channel numbers. Here is a VBScript that uses the latter "method".

Cheers,
Brad Turpin
DIAdem Product Support Engineer
National instruments
0 Kudos
Message 3 of 3
(3,134 Views)