Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple instance accessing one device

Arjun K - It is quite impossible that the parameter that I am supplying is incorrect because like what I said in my previous post if I am just running it as 1 instance, it is working just fine. The problem comes in when I am launching a second instance and it is throwing me an error, it is in the line of  messageBasedSession.Write(commandstring); even if I am trying to connect to a different instrument, the error is still occuring. I also tried running the 2 instances independently and that is how I discovered the error.
 
It is one of our requirements to launch multiple instance of the application so I want to make sure that it is possible with NI-VISA.
 
 
Let's put it this way, without looking on my code. How will you do it, your way? If you are going to launch multiple instance and access multiple instrument or even accessing the same instrument?
 
0 Kudos
Message 11 of 14
(1,423 Views)

Hi,

You really don't have to do anyhting special to open two Visa sessions. You can have two instances of SimpleReadWrite example open, where each session is talking to a different serial port, You can find this example in Program Files-->National Instruments-->Measurement StudioVS200x-->DotNET-->Examples-->Visa. You will see that this runs without any error. You can compare the code in the exaple to yours and see if you might be doing something differently.

Thanks,

Arjun K

National Instruments
Applications Engineer
0 Kudos
Message 12 of 14
(1,403 Views)
Did you try it from your end? because I tried it and it is throwing me the same error.
 
So it is acting up the way my app is acting up.
Scenario is when I launch the first application and try talking to the device with messagebasedsession it is working just fine. Once, the second application is launch and I tried talking to the device it is throwing me an error of "Unable to start operation because setup is iinvalid (usually due to attributes being set to an inconsistent state). Visa error code -1073807302 (0xBFFF003A), ErrorIinvalidSetup". And when I go back again to the first application and tried talking to the device it is throwing me the same error that I am receiving from second application.
 
 
 
 

Message Edited by mbd on 09-13-2007 09:37 AM

0 Kudos
Message 13 of 14
(1,388 Views)

Hi,

I have tried it again before posting this reply and it works just fine. I have two VISA sessions open and I try to communicate with two different instruments. It works without any errors. I have also tried daisy chaining the instruments and it still works. I have a strong belief that you either have the same address for your two instruments or VISA is corrupt. I would suggest that you try repairing your VISA drivers and reconfiguring your instruments in MAX. From the same VISA session, try communicating with the your devices one after the other and if everyhting so far works fine, try opening up two sessions.

Thanks,

Arjun K

National Instruments
Applications Engineer
0 Kudos
Message 14 of 14
(1,356 Views)