LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert a string to visa resource name

I have a string , like "visa://192.168.123.212/RIO0::INSTR", how can I convert it to a Labview visa resource name? The resource name is going to be used for "Open VI reference" control.
 
Also, a related question is , is there a special vi control for ip address input?  How do I check whether the input ip address is in valid format or not? 
0 Kudos
Message 1 of 17
(11,873 Views)
Just wire it up. A string will coerce to a resource name.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 17
(11,866 Views)

@mikeporter wrote:
Just wire it up. A string will coerce to a resource name.

Mike...
 

I don't think it does. At least not for me. I am having the same problem, I am trying to wire a string to the VISA resource name and doesn't work. 

0 Kudos
Message 3 of 17
(5,575 Views)

@dadest100 wrote:

@mikeporter wrote:
Just wire it up. A string will coerce to a resource name.

Mike...
 

I don't think it does. At least not for me. I am having the same problem, I am trying to wire a string to the VISA resource name and doesn't work. 


It works for everybody else.  But as it stands, no one can help you because "doesn't work" is too vague, and you didn't provide a VI that you're having trouble with.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 4 of 17
(5,571 Views)

Hi Leiyuan,

 


@Leiyuan wrote:
I have a string , like "visa://192.168.123.212/RIO0::INSTR", how can I convert it to a Labview visa resource name? The resource name is going to be used for "Open VI reference" control. 

It works for us to wire a string to a VISA reference:

check.png

 


@Leiyuan wrote:
Also, a related question is , is there a special vi control for ip address input?  How do I check whether the input ip address is in valid format or not? 

No, there is no special (frontpanel) control. You can check for 4 integer numeric values in the range of 0…255, separated by dots…

(Search the forum, this question has come up before.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 17
(5,553 Views)

@paul_cardinale wrote:

@dadest100 wrote:

@mikeporter wrote:
Just wire it up. A string will coerce to a resource name.

Mike...
 

I don't think it does. At least not for me. I am having the same problem, I am trying to wire a string to the VISA resource name and doesn't work. 


It works for everybody else.  But as it stands, no one can help you because "doesn't work" is too vague, and you didn't provide a VI that you're having trouble with.


Hi Mike, yeah sorry apologies my input string wasn't formatted correctly that's why it didn't work. 

 

Cheers

0 Kudos
Message 6 of 17
(5,529 Views)

The proper way is to use Type Cast

 

typecast.PNG

========================
=== Engineer Ambiguously ===
========================
Message 7 of 17
(5,513 Views)

@RTSLVU wrote:

The proper way is to use Type Cast

 

typecast.PNG


Only if you have an aversion to coercion.  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 17
(5,510 Views)

@billko wrote:


Only if you have an aversion to coercion.  😉


IMHO: Coercion dots are a sign of failure 😛

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 9 of 17
(5,505 Views)

@RTSLVU wrote:

@billko wrote:


Only if you have an aversion to coercion.  😉


IMHO: Coercion dots are a sign of failure 😛


That's a little extreme.  Coercion Dots are red flags to issues, not a sign of complete failure.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 10 of 17
(5,499 Views)