LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Find Resource (PC Win7 LV2010) to VISA Configure Serial Port

I would like to use VISA Find Resource to identify which USB port on my PC (Win7) has a live connection with my instrument. I then want to search the identified USB ports for the signature data feed of my instrument. I have already accomplished this on my Mac (OSX Snow Leopard) and my compiled VI runs well as an .app and is used by our field crews.

 

In an attempt at platform expansion, I want to duplicate our .app into an .exe but I ran into a problem with the Find VISA Resource subVI. It seems the PC handles things differently? Is this true? It seems the output from Find VISA Resource is not compatible with the input of VISA Configure Serial Port on the PC version. Hopefully I am missing something minor and this is not a major bother to you helpful people. Ideally this "search and identify" task happens at the VI startup and is invisible to the user.

 

Attached is a portion of the MacOSX VI (it might be clunky code) that I am attempting to convert to the PC platform. Any ideas would be helpful. I searched the forums already and couldn't find this exact problem.

 

Thanks.

0 Kudos
Message 1 of 15
(4,348 Views)

I'm not so sure about VISA Resource finding USB ports, but if your instrument is binded to VISA or perhaps is a virtual com port, it should find it.

The problem with your VI is how you are indexing into the while loop. If you want to find the VISA resources then choose one, you might do something like I have attached.

 

 

Richard






Message 2 of 15
(4,346 Views)

Quite an elegant piece of code you provided, thank you for that alternative solution. It has helped me isolate my particular problem and leads me to this direct inquiry of the forums. I can't figure out why this happens:

 

1. Create a CONFIGURE SERIAL PORT vi

2. Create an EMPTY STRING CONSTANT vi

3. Connect EMPTY STRING CONSTANT (string) to CONFIGURE SERIAL PORT (Visa Resource Name - file I/O))

 

At this point, the VISA Resource Name  on Configure Serial Port happily turns from a file input to a string input.

 

4. Change EMPTY STRING CONSTANT vi to FIND VISA RESOURCE vi

5. Connect FIND VISA RESOURCE output (string) to CONFIGURE VISA RESOURCE input (file I/O)

 

On a Mac this is acceptable and I can proceed with coding. On the PC this is disallowed and I cannot proceed.

 

A. Will someone please tell me why this is so?

 

B. Is there a way I can simply change the FIND VISA RESOURCE output to something the CONFIGURE VISA RESOURCE vi will accept as a file input?

 

This is the solution for which I am searching. I truly appreciate the effort and time put into the fantastically workable vi offered above. The only problem with me using it in my particular case is that I cannot use it to write a vi that is compatible for both Mac and PC (case structure defining platform at beginning of vi) as the PC version will not accept my "Mac" case described above as a viably wired diagram (bonks on the string to file I/O).

 

Thanks!

0 Kudos
Message 3 of 15
(4,316 Views)

Still hoping someone can tell me how to wire VISA Find Resource to VISA Configure Serial Port on a PC running Win7. Thanks!

0 Kudos
Message 4 of 15
(4,293 Views)

Are you just trying to convert a string to a VISA Resource name?

If yes, just do this:

test.png


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 5 of 15
(4,288 Views)

The question makes no sense. The output of the VISA Find Resource is a string array and since it is auto-indexed through the while loop, the wiring is just fine. There is no need to convert a string to an actual VISA Resource data type.

0 Kudos
Message 6 of 15
(4,283 Views)

Yes, I hope that is all that is necessary. What is the name of the VI in your image please?

 

Thanks!

0 Kudos
Message 7 of 15
(4,281 Views)

@CodeMunkee wrote:

Yes, I hope that is all that is necessary. What is the name of the VI in your image please?

 

Thanks!



Why do you even care? As I said, there is no problem wiring a string to the VISA Configure Serial Port. Your original VI seems just fine.

0 Kudos
Message 8 of 15
(4,279 Views)

The question makes sense.

 

If you are referring to my example .vi in my first post, that code is from OSX and works perfectly. When the same VIs are applied in LV on a Win7 platform, the wiring will not connect as the same data type. My question is simply, why is this so? And more importantly, how do I get around it?

0 Kudos
Message 9 of 15
(4,277 Views)

There is nothing to get around. The input to the VISA Configure Serial Port will accept a string. Everything should still work assuming it worked on the mac. If you get an error when the VI runs, you need to provide the error number that you are getting.

0 Kudos
Message 10 of 15
(4,274 Views)