08-08-2011 10:21 AM
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
Solved! Go to Solution.
08-08-2011 04:22 PM
I don't believe so. You could just encapsulate the Visa session into a Disable structure and enable it when you need to.
08-09-2011 12:28 AM
@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
08-09-2011 07:57 AM
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
08-09-2011 08:16 AM
@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.
08-09-2011 08:23 AM
@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?
08-09-2011 10:29 AM
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 smercurio_fc, 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.
08-09-2011 10:38 AM
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.
08-09-2011 10:51 AM
@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 smercurio_fc, 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.
08-09-2011 03:13 PM
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.