Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

how to pass visa resource name from one vi to other vi

i want to pass visa resource name from one vi to other vi through tcl .i am able to obtain the visa resource name from initialise.vi to tcl , it returns something like "dmm 1099384" no when  i pass this to my other subvi  it  gives error like "paramnames type mismatch.expected 1d array of strings or 1d array of string variants". Below is the code that i am using

package require tcom
#
# close Tk widnow
#
catch {wm withdraw .}
# open LabVIEW application
#
set lview [::tcom::ref createobject "LabView.Application"]
set path "C:\\Documents and Settings\\rajr1\\Desktop\\project\\dmm\\initialise.vi"
set vi [$lview GetVIReference $path]
$vi Run
set seid [$vi GetControlValue "VISA resource name out"]
set path "C:\\Documents and Settings\\rajr1\\Desktop\\project\\dmm\\singlemeasurement module.vi"
set vi [$lview GetVIReference $path]
set names [list "Measurement Data" "VISA resource name"]
set values [list 2 $seid]
$vi Call names values
puts [lindex $values 0]
$lview Quit
0 Kudos
Message 1 of 5
(3,872 Views)
help please 😞
0 Kudos
Message 2 of 5
(3,857 Views)
Why not use a string

greetings from the Netherlands
0 Kudos
Message 3 of 5
(3,843 Views)
Hey P1,
 
A useful tool to use to troubleshoot would be NI-SPY. It shows the driver level calls being made, and you should be able to see what resource it's trying to use. If you would like, it'd be good to also try to put indicators in your program to show what's actually being used.
 
Like mentioned above, would you be able to pass the information as a string, and try to implement it that way?
 
Regards,
 
Nick D.
Message 4 of 5
(3,827 Views)

One last thing...

You can find NI-SPY at Start->Programs->National Instruments->NI-SPY.

Regards,

Nick D

Message 5 of 5
(3,824 Views)