LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa Resource Name in cluster passed to Network Stream writer causes error 42.

Solved!
Go to solution

If I try and pass this "motor data" cluster with an embedded VISA resource name:

Problem Typdef.png

 

to a Network Stream Writer in this manner:

Writer Loop.png

 

Then I get this error from the "Write Single Element to Stream" VI

Error.png

 

If I change the motor data cluster TypDef so that a string control is used instead of the VISA reference, the error disappears and the data passes over the Network Stream without problem.

OK Typdef.png

 

Is this expected behavior? 

I thought that the "data in" (type = "POLY"?) like the one found on the "Write Single Element to Stream" VI was supposed to accept pretty much anything...

0 Kudos
Message 1 of 5
(3,663 Views)

Hi WNM,


This is Doug from Applications Engineering. Are you trying to send the text portion of the VISA resource name or are you trying to send the memory location of the VISA resource name? When you pass the embedded VISA resource name you are passing a memory address and not simply the string VISA resource name (e.g. ASRL::INSR). 

 

Regards

Doug W

Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,628 Views)

@Doug-W wrote:

Hi WNM,


This is Doug from Applications Engineering. Are you trying to send the text portion of the VISA resource name or are you trying to send the memory location of the VISA resource name? When you pass the embedded VISA resource name you are passing a memory address and not simply the string VISA resource name (e.g. ASRL::INSR). 

 

Regards

Doug W


All I'm trying to pass is the text information, and only passing the text information as a string is how I delt with the problem.

 

My point is that this is the first instance that I have experienced, where the use of the real VISA reference control Clipboard03.png, has produced an error that did not occur when a similar string control Clipboard02.png was used instead. I cannot imagine why anyone would want or even try to pass the memory address portion of a reference over a network stream so perhaps the network stream writer should, at some future time, be made smarter in how it handles this type of object and rather than returning an error, just go ahead and pass the text information and ignore the memory reference data. Other VIs in the library already have this intelligence and so should this VI.

0 Kudos
Message 3 of 5
(3,608 Views)

Doug

 

I would consider this a bug, as the memory location (more precisely the VISA refnum or session) of a VISA resource means nothing on a potentially remote system. Also I was under the impression that most streaming methods like binary file IO, but also the network streams would use the LabVIEW flattened format for data clusters and for that the VISA resource name would be the only logical choice instead of the underlaying VISA refnum, but I might be wrong in this specific case and the default behaviour for flattening VISA resources might always have been to the VISA refnum.

 

Considering that the VISA control can resurect the VISA session from a VISA resource name if it is already opened, flattening to the VISA resource name instead would be more logical, but using a string control in the cluster type definition is a reasonable work around of course.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 4 of 5
(3,600 Views)
Solution
Accepted by topic author WNM

Hi Rolf and WNM,

 

Upon further investigation, I was able to reproduce the issue and agree that this is a bug. This was reported to R&D (#395047) for further investigation. As mentioned earlier, a possible workaround is using the VISA address in the cluster instead of the VISA resource. Thanks for the feedback!

 

Doug W

Applications Engineer
National Instruments
Message 5 of 5
(3,588 Views)