From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

How to assign values to certain parts of a channel with VBS?

Solved!
Go to solution

I need to modify  a continuous part of a channel to a constant, like A(30:50)=1 in MATLAB. It can be done with a for loop but with very low speed. I tried e.g. ch(10:40,5)=1 which doesn't work. And I can't think of a good keyword to search in help documents.

0 Kudos
Message 1 of 3
(5,264 Views)
Solution
Accepted by topic author reko34

Hi reko,

 

If it's really just 30 values, then direct Channel.Values(i) access will be plent fast.  If it's a lot more values, and if you have them in another channel, then you can use the DataBlCopy() command.

 

To find a selection of useful commands like this, go to the Help system, select the "Contents" tab, open the "Programming Reference" node, then the "Thematic Programming Reference" node, then click on "Working with Data".

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments.

0 Kudos
Message 2 of 3
(5,244 Views)

Thanks for the advice! It's a good start position to learn many useful commands. I also discovered chdx is far more efficient than chd. So it's also acceptable to use loop functions.

0 Kudos
Message 3 of 3
(5,220 Views)