LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

My program is closing unexpectedly as I run with two usb ports

Hi everyone. I'm haveing trouble on running my VI, which performs a digital output with arduino and measurement reading with agilent 34410a. I'd like to know why this happens. It simply shuts down suddenly and I cannot complete my acquisitions.

 

Thanks!

0 Kudos
Message 1 of 3
(2,610 Views)

How long does your application run before it crashes?  Do you get any errors?

 

At the top of my head, I'm guessing that this is a Windows shutting down your USB hubs on you as a "power saving feature".  You can go into the device manager and turn off that feature.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 3
(2,604 Views)

That is some of the strangest code I have ever seen.  
After a few ctrl+Us with a few tweaks to the settings I could begin to read the code:

 

You really do have a nasty race condition with "Amp Instrumentação" where you change the strings (By the way- that is the most Rube Goldberg method of implementing "Rotate array" I've ever seen) and then read the value.  Now you never actually change the values- so the user can only guess what value coresponds to what string-  Thats OK Because you have a whole BOATLOAD of code to unwind the value with two case structures and some of the oddest bit shifting I've seen:

Capture.PNG

Trace that wire back though two cases and the comparison can never be "True" Notice how showing the radix on the constant and setting it to hex makes the code a lot more readable! AND suggests a logical shift of 14 would replace that whole snip!  since really did we need all those "to boolean arrays" to add some integers together?Smiley Surprised

 

I have to admit this is the most obfuscated way to get 4 T or 4 F that I've come across:

Capture.PNG

The constant is 15 or 0 in every case why not just change it to a bool and branch the darned wire that enables your user controlls?  (Interesting way to avoid setting a disabled and greyed property- the user must love that at times controlls do not work)

 

As to why the program crashes-- I have no idea! debugging that is going to be a nightmare until you unwind some of the obvious problems.  but, fundamentally there is nothing actually "Wrong" here that should cause a crash (like unlimited file sizes or run-away memory needs)


"Should be" isn't "Is" -Jay
Message 3 of 3
(2,577 Views)