LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Substitute Variables VI does not work for names with underbars. What can I do?

For example, I want to change "p_0=p_1+p_2;" into "x0=x1+x2;". However the VI does not do it and returns just the same formula. Is this the specification? I enclosed a sample VI to show it.
0 Kudos
Message 1 of 5
(2,956 Views)
You problem is in "Find String Identifier" (a subVI of "Substitue Variables") - it searches your variables and tries to split any other characters out of it (it only accepts alphanumeric and spaces as variable names, not special characters - hence your "p_0" becomes "p", and then "p" is not found in your substitution rules, so the original is piped through instead.




Copyright © 2004-2024 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 4.0 License.
0 Kudos
Message 2 of 5
(2,956 Views)
Hi Christopher!

Thanks for your reply. I understand the situation.
However IMHO to use underbars in variable names is very common, isn't it? Now we are transforming a measurement system built in HP Basic into LabVIEW. It holds much variables like P_01_001. (The separator has its meaning.) Don't you have any clue to manage this?

Michiro
0 Kudos
Message 3 of 5
(2,956 Views)
Michiro,

Try making the following modifications to the Find String Identifier.vi. When I ran your VI with the modifications, it worked correctly.

Randy Hoskin
Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(2,956 Views)
Hi Randy!

Thank you very very much. Splendid!

Michiro Nasu
Baba Laboratory
0 Kudos
Message 5 of 5
(2,956 Views)