LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create a "dummy" VISA session?

Solved!
Go to solution

Hi!

 

I am adapting an old LabVIEW instrument driver to a new device. My old driver used a serial port and a VISA session. The VISA session was also used to carry some additional information about the instrument as shown in the Extended User Data.vi in the 34401A example coming with LabVIEW.

 

Now the new driver will not use a real VISA session for device communication anymore because it interfaces the new device directly through a DLL. But I would like to keep the VISA session mechanism to carry device information between VIs as done before. My question is therefore if I can create dummy VISA sessions, i.e. sessions that do not connect to a real device ressource. Is this possible?

 

Many thanks in advance!

 

Regards,

Anguel

0 Kudos
Message 1 of 10
(3,876 Views)

I don't believe so.  You could just encapsulate the Visa session into a Disable structure and enable it when you need to.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 2 of 10
(3,851 Views)

@MoReese wrote:

I don't believe so.  You could just encapsulate the Visa session into a Disable structure and enable it when you need to.


Thanks for the reply MoReese. Unfortunately I don't understand how this would help me. My problem is that in my new driver I want to create VISA sessions without actually having real VISA instruments connected to them.

 

The question is if LabVIEW can also create sessions for "dummy" instruments. Maybe I could connect my own strings like "DUMMY1", "DUMMY2", etc. as my VISA ressource names? The question is if this will work. Of cource I am also happy about different suggestions.

 

Regards,

Anguel

0 Kudos
Message 3 of 10
(3,833 Views)

You could make a visa wrapper of sorts and send to yourself through a null modem and then translate the visa command to a activeX call ...

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 10
(3,811 Views)

@Yamaeda wrote:

You could make a visa wrapper of sorts and send to yourself through a null modem and then translate the visa command to a activeX call ...

/Y


Yes, that's possible, but I'm just not seeing what the point is.  Why do you want a dummy Visa session that does nothing?  Is it for future use?  Please clarify for the mentally deficient.Smiley Wink

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 5 of 10
(3,807 Views)

@AStankov wrote:

@MoReese wrote:

I don't believe so.  You could just encapsulate the Visa session into a Disable structure and enable it when you need to.


Thanks for the reply MoReese. Unfortunately I don't understand how this would help me. My problem is that in my new driver I want to create VISA sessions without actually having real VISA instruments connected to them.

 

The question is if LabVIEW can also create sessions for "dummy" instruments. Maybe I could connect my own strings like "DUMMY1", "DUMMY2", etc. as my VISA ressource names? The question is if this will work. Of cource I am also happy about different suggestions.

 

Regards,

Anguel


You could create aliases in MAX that don't really mean anything. For example, you could create a TCP/IP VISA resource that points to an address not in your network. During the creation don't choose to validate the resource, and then give it an alias. In your code you could reference the VISA resource by that alias. When you distribute the code you'd need to also export your MAX configuration.

 

Not sure what that really gains you in the end. If it's a new driver and it doesn't use VISA, why do you  want to use VISA controls? I know you said you want to keep VISA for device communication. Why?

0 Kudos
Message 6 of 10
(3,799 Views)
Solution
Accepted by topic author AStankov

As I had explained, in the old driver I used the VISA session to transport some additional information about my device. A similar thing is also done in the Agilent 34401 examples. That information can later be queried where needed by reading it out from the VISA session.

 

You are right that I don't need VISA for device communication in my new driver anymore, but I wanted to keep that transport mechanism. I could also use clusters instead, but somehow I did not find a way to collapse large clusters and they would fill up my front panels in every driver sub-VI. So I decided to stick with the old VISA transport mechanism instead. Of course I would be happy about better suggestions.

 

Regarding my question I tested a bit: It seems to be fine to just give some random name like "DUMMY1" to the VISA session by attaching a string to the "VISA ressource name" input. As long as I don't use VISA Open or similar things in my driver this seems to be ok. This is similar to the suggestion from , but it looks like the TCP/IP + MAX stuff is not needed. At least I don't see any errors so far. Or maybe I overlooked something?

 

Thanks again for the help.

0 Kudos
Message 7 of 10
(3,791 Views)

If this is just a functionality that you need to use on occasion for the old stuff or whatever, place your Visa session in a case structure with a boolean enable button or enum to enable it when needed.  It won't interfere with your normal running processes.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 8 of 10
(3,783 Views)

@AStankov wrote:

 

Regarding my question I tested a bit: It seems to be fine to just give some random name like "DUMMY1" to the VISA session by attaching a string to the "VISA ressource name" input. As long as I don't use VISA Open or similar things in my driver this seems to be ok. This is similar to the suggestion from , but it looks like the TCP/IP + MAX stuff is not needed. At least I don't see any errors so far. Or maybe I overlooked something?


Not really. It's true that you can just pass in a string to a VISA resource control, but it sounded like you wanted to be able to pull down the VISA resource name and select the specified resource. That's why I had suggested creating the dummy aliases in MAX. If you don't care about that, then there is no need to create the aliases in MAX.

0 Kudos
Message 9 of 10
(3,778 Views)

smercurio_fc wrote:
Not really. It's true that you can just pass in a string to a VISA resource control, but it sounded like you wanted to be able to pull down the VISA resource name and select the specified resource. That's why I had suggested creating the dummy aliases in MAX. If you don't care about that, then there is no need to create the aliases in MAX.

Thanks for the confirmation. I don't need the pull down VISA stuff, I just "misuse" the VISA session for transport.

0 Kudos
Message 10 of 10
(3,767 Views)