ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Using variables in Find

Solved!
Go to solution

Hi,

 

After a recent upgrade to 2019 I have had to change the channel reference style used by a variable from the channel number to the channel name (for reasons I won't bother you with).That is to say, where I used to have:

HWChn = 2

I now have:

HWChn = [1]/HW Angle

 Now I find that the following line doesn't work:

L1 = Find("Ch(" & HWChn & ") = ChnValMax(" & HWChn & ")")

The error message suggests that the / symbol is an attempt to undertake a mathematical operation in text. 

 

Try as I might I cannot find the right combination of double quotes, uses of str(), etc, to overcome the problem. Can anyone help?

 

Thanks, Simon.

0 Kudos
Message 1 of 3
(2,607 Views)
Solution
Accepted by topic author Simon_Aldworth
L1 = Find("Ch(""" & HWChn & """) = ChnValMax(""" & HWChn & """)")
0 Kudos
Message 2 of 3
(2,603 Views)

Thanks. I didn't try enough quotation marks......

0 Kudos
Message 3 of 3
(2,599 Views)