VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Rename channel

I'm unable to rename channels in custom devices.

 

Creating a project from scratch, opening the system definition file, adding the NI Embedded Data Logger Custom Device, and then trying to rename the 'FIFO Utilization' channel to e.g.'hello' gives the following error:

 

"Invalid operation.

A name cannot contain \r \n, an ASCII character ranging from \x00 - \0x1F and \0x7F, or have the separator '/' as the first or last character."

 

This was found by one of our customers working with a custom device from us and we have verified it, so it's not just the Embedded Logger CD.

 

Any ideas?



CLA
www.dvel.se
0 Kudos
Message 1 of 8
(4,871 Views)

Hello,

 

I think maybe it's not possible to rename the channel, and it's just the error message that is not clear.

 

Best regards,

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

Yes, that thought has crossed my mind. But I can't really see why i wouldn't be allowed to rename the channel to start with. I believe I can set a tag to disallow renaming, but I really want to be able to rename....



CLA
www.dvel.se
0 Kudos
Message 3 of 8
(4,861 Views)

Did you find any solution to this issue ?

It looks like I'm stuck at this point too...

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 4 of 8
(3,804 Views)

As a custom device developer, you can add the following to any Page defined in your custom device XML to disallow the channel or section from being renamed:

<Page>
  <Name>
    <eng>My Page</eng>
    <loc>My Page</loc>
  </Name>
  <DisallowRenaming>true</DisallowRenaming>
  <GUID>12C3E20E-2576-4AE6-8681-8C37089C3BC9</GUID>
  ...
 </Page>

When you call "NI VeriStand - Add Custom Device Section.vi" or "NI VeriStand - Add Custom Device Channel.vi" in you custom device code, you need to reference the GUID from your XML.  If you do not, the default section or channel GUID is used, which by default has DisallowRenaming set to True.  This is why the original poster was not able to rename the "FIFO Utilization" channel in the Embedded Data Logger, since it is just using the default channel GUID.

 

So in order to allow a custom device item to be renamed, you'll need to define your own pages in the custom device XML and make sure DisallowRenaming isn't true.

Message 5 of 8
(3,800 Views)

Hi!

thanks for the answer !

Is there a way to do this programmatically instead of modifying the XML file ?

I'm adding channels on the fly and I can't modify the XML in advance... Doing it programmatically would allow the technicians to rename the channels according to the signals they are really measuring.

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 6 of 8
(3,795 Views)

No, there's no programmatic way (aside from calling "NI VeriStand - Set Item GUID.vi" to change an item to a different GUID).

 

You don't need to have separate pages defined in the XML for each channel though.  You can have one <Page> entry for all of your programmatically added channels, then when you call "NI VeriStand - Add Custom Device Channel.vi" you just give it the GUID for the page you defined.

0 Kudos
Message 7 of 8
(3,789 Views)

Hi,

 

In fact the renaming function has an input named Force ?.

If set to True, it actually renames the channels. In my case channels are created programmatically, so there is corresponding XML associated to these. And setting True to Force effectivelly allows renaming them.

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
Message 8 of 8
(3,763 Views)