LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 2 occured at no active connection to device

Hello everyone,

 

I have a question regarding and Error 2 that I am getting in my main VI.

 

My main VI is very long, so I attached a printscreen of the relevant part below.

 

Screenshot.jpg

 

In the first frame, a subVI is called. This subVI moves a nanopositioner to a new location. This part works wihout a problem. Nanopositioner is previously initialized with success which is not shown above.

 

In the second frame, I initialize a new device (a displacement sensor) by using the recommended procedure by the manufacturer. Please ignore the weird looking case structure. This part works fine as well, as I can tell from the outputs "connected", "interface address", etc. When I measure the displacement with this device later in the code, everything works properly.

 

In the third frame, the subVI of the first frame is recalled (move nanopositioner). This time it does not work and gives the error: "Error 2 occured at no active connection to device". If I do not initialize the displacement sensor in the second frame, this third frame works fine as well.

 

Both of these devices are from the same company and they get connected to my computer with two separate USB cables.

 

I will appreciate any comments on the issue.

 

Thanks!

 

Note: The above screenshot is not exactly what I am trying to accomplish, it is more like a dummy example illustrating the problem. I have previously used these two devices simultaneously without a problem by utilizing LabVIEW 11. Now I use LabVIEW 12 and I use some newer subVIs provided by the manufacturer in accordance with some firmware updates. Nanopositioner move task can be accomplished multiple times as long as the other device is not initialized.

0 Kudos
Message 1 of 6
(2,523 Views)

It seems to me that initializing the second device broke somehow the communication with the first one.

Can you provide more details about these devices control? There is a VirtualCOM generated for each USB device?

Do you use the same interface number for controlling both devices? I saw you used interface "0" in the second frame. Which number you use in the first frame for the subVI wich moves a nanopositioner to a new location? I hope it is not the same "0" interface.

0 Kudos
Message 2 of 6
(2,519 Views)

I am not knowledgeable about the connection types. So I do not know if it is a VirtualCOM or not and I do not know how to figure that information out. If you could explain a little bit more, I will be happy to try finding out.

 

Regarding the interface number, there is a "Device No" input for connecting to the nanopositioner. I put zero there, otherwise it does not get connected.

 

For the displacement sensor, I also put zero to a "Device number" input for getting connected. Similarly, it does not get connected if I put any other number.

 

Thanks.

0 Kudos
Message 3 of 6
(2,499 Views)

I think this is the problem: you use the same device number for both communications.

Normally this should be different.

With the devices connected please check in the computer's Device Manager for available ports. I am expected to be there two different ports. (You can check which port correspond to each device. Or maybe you have a special program from the manufacturer which allows you to change the ports settings.

You can also check it in a different way: use on the front panel of a device a VISA Resource Name control from the I/O pallete (not necessary to connect tghis control). Scroll down the control to check the available ports in the computer (if necessary right click on the control and choose refresh). Unplug one USB device - refresh and check the VISA Resource Name control components. You will see probably the missing port. 

0 Kudos
Message 4 of 6
(2,494 Views)

Hello Nicku,

 

I would like to thank you for your help.

 

I checked through device manager that they are in two different ports. But I am not sure how that information can be used to differentiate between the devices.

 

The manufacturer recommended me to try 1 and 0 for the two device numbers but then only the one with device number 0 gets connected properly, and the one with 1 does not get connected.

 

Their associated subVI calls some dll library function so it is difficult for me to tell what is happening inside the library. It seems that they might need to modify something in the library, and they are also working on identifying the problem now.

 

Thanks.

0 Kudos
Message 5 of 6
(2,486 Views)

If you still need support from my side please contact me on Skype. My ID is nicu66pr. I have good Labview experience in automate tests and remote work.

0 Kudos
Message 6 of 6
(2,483 Views)