LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Session Quitting

I'm developing a program in which an external USB device (MSP430F5522 IC from Texas Instruments) communicates with my program, primarily sending data to the PC. As I'm developing both my LabVIEW program and my device firmware concurrently, I need to re-program my device while still connected to via USB. This, of course, causes my device to reset and the USB connection goes offline as a result.

 

My problem comes in when I try to re-start my LabVIEW program after my device has been reset and the USB goes offline. The issue is that LabVIEW no longer recognizes that my device is present. Here are the conditions in which this happens and the only solution I have found:

Scenario A:

     1. I'm running my program and I do a hard stop (forcing program termination).

     2. I reprogram my device and allow the device to initialize (windows sounds the USB insertion chime).
     3. I attempt to run my LabVIEW program, but it doesn't find my device.

Scenario B:

     1. I do NOT stop my program and let it continue running.

     2. I reprogram my device and allow the device to initialize (windows sounds the USB insertion chime).
     3. I attempt to run my LabVIEW program, but it doesn't find my device.

Scenario C:

     1. I end my program "gracefully", but close the VISA resource before all code terminates.

     2. I reprogram my device and allow the device to initialize (windows sounds the USB insertion chime).
     3. I attempt to run my LabVIEW program, but it doesn't find my device.


Solution for all scenarios:

     1. Remove my device, then attempt to run my program (obviously fails as no device is present).
     2. Plug in my device
     3. Run my program and it works...

 

Attached is my VI and, hopefully, the required VI's that go with it. The Main VI is "Telemetry Receiver - Producer Consumer V1.4 TEST.vi"

 

Final Question: What is the "proper" way of closing a VISA session so that when my VI stops, I can restart it without problems? Thanks!

0 Kudos
Message 1 of 2
(2,195 Views)

Hey Philip,

 

When the device is reprogrammed, does it get a new VISA resource name? The default value for the resource name was "COM 35" which indicates that there are a lot of VISA resources on the machine. Once you reprogram the device is it recognized by Measurement and Automation Explorer (MAX)? I have a feeling what is happening is everytime you reprogram the device the computer is giving it a new name, hence the disconnection. I want to confirm this. The device should show up in MAX under "Devices and Interfaces". Could you tell me the Name and the VISA Resource Name, before you program it and then after you program it?

 

-KP

Kurt P
Automated Test Software R&D
0 Kudos
Message 2 of 2
(2,154 Views)