LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW stops at initialise.vi and not responding after clicking stop

Solved!
Go to solution
Highlighted

The background is that I am using AFG3022B Signal generator from Tektronix and connect it through USB-USB to my PC (AFG3022B I had only had a USB port to connect with).

 

I want to write a LabVIEW program that I can use it to generate certain output power at a certain frequency.

 

The basic flow is that initialize > setting frequency and power > enable output > close vi.

 

I did it in an open loop without iterations. It works fine.

 

When I create a for loop and run, after a few iterations, I can see from NI I/O trace that it stops at VISA open, as you may check from capture1.png.

 

Then I went back and check the normal status, as you can check from capture2.png.

 

Apparently, the normal status will repeat twice the visa resource name "USB::XXX" and give 0. Then everything continues to work.

 

The unknown status shows only one time of visa resource name "USB::XXX" and give nothing. Then LabVIEW stops there, and not responding when I try to stop the program.

 

please share your idea on how to fix this problem.

0 Kudos
Message 1 of 12
(336 Views)
Highlighted

updated the pngs

Download All
0 Kudos
Message 2 of 12
(334 Views)
Highlighted

Could you share your code? It is awfully difficult to see errors in code that cannot be seen.

0 Kudos
Message 3 of 12
(285 Views)
Highlighted

in the zip file, it includes the driver I find in NI website, the vi file I create and captures.

0 Kudos
Message 4 of 12
(282 Views)
Highlighted

I also encounter other problems. Sometimes I try to increase waiting time, then some errors will not appear, but in the end, there will be an error waiting for me.

 

Like sometimes it will report:

 

1. "Error -1073807343"

 

Possible reason(s): VISA: (Hex 0xBFFF0011) Insufficient location information or the device or resource is not present in the system.

 

2. error "-1073807302"

 

possible reason is listed as "VISA: (Hex 0xBFFF003A) Unable to start operation because setup is invalid (due to attributes being set in an inconsistent state)."

 

3.Error-1073807297.

possible reason is like "format string is invalid".

 

just a simple labview program. Maybe the driver itself is faulty?

0 Kudos
Message 5 of 12
(271 Views)
Highlighted

Can you save your VI for a previous version of LV. Many of us aren't running on 2020 (I am still on 2019 personally)

0 Kudos
Message 6 of 12
(266 Views)
Highlighted

I try the "save for previous version" and select 18.0.

 

hopes it works. thanks for your help.

0 Kudos
Message 7 of 12
(256 Views)
Highlighted
Solution
Accepted by topic author Tony@NTU

I can't open the driver VI's because they are still for LV 2020.

 

A couple of observations which might solve your problem, even if they don't I recommend that you do them.

 

Only initialise and close your VISA reference once. Leave it open whilst you are using it.

 

In other words, open your VISA reference - in a loop perform your tasks - once you are finish end the loop and close the reference.

 

It may be worth putting your initialise VISA reference in a loop to retry connecting if it fails but this shouldn't really be necessary and may just be a plaster for a bigger problem.

 

See a suggestion attatched

Message 8 of 12
(252 Views)
Highlighted

Thanks. I take a look first.

 

Also, the driver can be found from:

http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=6EC36E806C121C7AE04400144FB7D2...

 

I download it again and it's for 2018 as it states.

 

please take a look.

0 Kudos
Message 9 of 12
(242 Views)
Highlighted

@Niatross wrote:

Only initialise and close your VISA reference once. Leave it open whilst you are using it.


This is the most likely thing to fix the issue.  There is absolutely no point in constantly opening and closing a connection in a normal operation.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 10 of 12
(226 Views)