From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Menage channels in one group

Solved!
Go to solution

Hallo,

I'm using the script below to manage or modify a channel according with the condition, but now I need change a large number of channels according with a condition of one channel. 

dim

 for a = 1 to chnlength(1)
    if chd(a,1) > 20 then
       chd(a,2) = nv  now, I need modify a lot of channels, like chd(a,2) until chd(a,300)
    end if
  next

Thanks so much

0 Kudos
Message 1 of 8
(2,414 Views)

A complete example of how to use a DIAdem Analysis Event Search to "filter" that data can be found on my website at this link: http://www.savvydiademsolutions.com/blog.php?topic=blog-filter-channel-data-by-events   Feel free to contact me if you have any further questions.  

Message 2 of 8
(2,343 Views)
Solution
Accepted by topic author Abimael

dim a, b

 for a = 1 to chnlength(1)
    if chd(a,1) > 20 then

        for b = 2 To 300
           chd(a,b) = nv  now, I need modify a lot of channels, like chd(a,2) until chd(a,300)

         next
    end if
  next

Message 3 of 8
(2,328 Views)

Thanks very much! Works very well.
Only one question more, how can I delete the lines selected according with the condition?

0 Kudos
Message 4 of 8
(2,315 Views)

You can call DataBlDel(channnel, startRow, #valuesToDelete)

http://zone.ni.com/reference/en-XX/help/370858N-01/comoff/databldel/

0 Kudos
Message 5 of 8
(2,296 Views)

The link below shows how to perform an Event Search, and then use a custom dialog (that you can download for free) that will allow you to post-process the Event Search results.  You can either set those values to NoValue, or delete those rows.

 

http://www.savvydiademsolutions.com/analysis.php?topic=postprocess-event-search-results

Message 6 of 8
(2,281 Views)

Hallo

Sorry for my poor knowledge to scripting..I'm trying to change a channel base on a range of values from the other channel, I've tried a lot of thing, but doesn't work. Could you give me a suggestion?

dim a, b

 for a = 1 to chnlength(1)
    if chd(a,1) > 20 then (like between  60 until 70),

        for b = 2 To 300
           chd(a,b) = nv  

         next
    end if
  next

 

Thanks Advanced

0 Kudos
Message 7 of 8
(2,212 Views)

Hallo,

I'm just got the good results with this script below

for = 1 to chnlength(2)

aux = chd(a,1)

if aux>cuti1 and aux<cutf1 then

for b = x To y

chd(a,b)= nv

chd(a,b)= chd(a,b)

next

end if

next

Thanks Advanced

 

Message 8 of 8
(2,199 Views)