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: 

Name each StoreChannels with distinct Name with the AddStoreChannel method

Hello,

 

Using the method AddStoreChannel(StoreChannel, [sName] as String) I can only name the channels with the same [sName] pre-fix.

How could I make a condition or a list or a dictionary in order to have each Channel with each distinct [sName]?

 

I also tried to change the "Name" property after creating the Root.ChannelGroups.Channels, but it shows the error message that the Name Property is Read-Only.

0 Kudos
Message 1 of 2
(1,015 Views)

Hi vtrshimada,

 

It is true that VBScript DataPlugins do not let you rename a channel once you've created it, so you need to get the name right the first time.

 

The AddStoreChannel(StoreChannel, [sName]) command is called for each StoreChannel you want to assign to a Data Portal channel group, so you just need to pass the desired sName you want to see in the Data Portal as that second parameter.  If you have the desired names stored in an array variable, you can place the array variable (indexed) in that second parameter in your loop.  Or if you have the StoreChannel ==> DataPortalChannel name mapping in a dictionary variable, then you can retrieve the DataPortalChannel name right before the AddStoreChannel() call and pass the desired name in the second parameter, all inside your loop.

 

Or am I missing your question entirely?

Brad Turpin

Principal Technical Support Engineer

National Instruments

0 Kudos
Message 2 of 2
(945 Views)