LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Keyboard Wedge VI

Solved!
Go to solution

All,

 

Before I get into what my issue is, I think it might be best to give you some background info on what my program does. My "small" program uses VISA Serial functions to populate values in Excel from any device available in the drop down so my end users don't have to hand enter values from the chosen device. Bascially it makes more efficient use of their time.

 

I am getting some odd behavior with my VI. When my program runs, sometimes it doesn't always get the file information and does not open the file. I must re-type or re-select my file then press the "Test Device" button again for the file to launch.

 

Any ideas on what it could be? Granted, it's not the cleanest code, but it works. Also, any ideas on how to condense this VI would also be appreciated. FYI - I use a 22" monitor so that's why the code block is large.

0 Kudos
Message 1 of 9
(3,113 Views)

We can't comment on your code because you did not post all your subVIs.  Do a Save As and duplicate the hierarchy to a new location.  Zip the new location and post the zip file.

0 Kudos
Message 2 of 9
(3,086 Views)

I apologize for not getting back sooner, I had a death in the family.

 

 

Download All
0 Kudos
Message 3 of 9
(3,062 Views)
Solution
Accepted by topic author Eric1977

My condolences on your loss.

 

With respect to your VI, the issue is that you are not passing through the values in the Timeout case. Thus, the wire that's holding the filename is being reset. Along with the other values.

0 Kudos
Message 4 of 9
(3,057 Views)

Thank you. Your advice worked.

 

I have the Timeout Terminal set to 1000ms. Think that's gonna be long enough? It looks like it, but I wondered if there is a "best practice" for wiring the Timeout Terminal.

0 Kudos
Message 5 of 9
(3,047 Views)

You don't need to set a value for the timeout. All you need to do is connect a wire from the left tunnel to the right tunnel so the value doesn't get lost. You already do that in the other event cases.

0 Kudos
Message 6 of 9
(3,039 Views)

I misspoke (a.k.a I was wrong). I did not look at your VI in great depth, but started looking at it some more. You initially had the Timeout unwired, so not having the wire pass through would not have made a difference. The only reason you'd need a wire is if you actually wired a constant to the Timout terminal.

 

Can you better indicate when that "sometimes" is that you don't get the file information? Are you sure you're not getting an error from the serial port communication? If that generates an error the opening of the file is not done. All you have is a Boolean flag coming out of the InitializeInput, and you're clearing errors (why?).

0 Kudos
Message 7 of 9
(3,030 Views)

I forgot to remove that Clear Errors VI out of my code. Sorry about that.

 

Sometimes when I click on the Test Device button, the Excel sheet should open. At times, it does not and I need to press the button again.

 

 

0 Kudos
Message 8 of 9
(3,001 Views)

When you click and excel does not open, can you verify that you are indeed entering that event structure?  Maybe you could change an LED or similar.  My hunch is that when you click that you are stuck in another case, and do not register the button press.  Let me know what your thoughts are.

 

Ryan

Applications Engineer
National Instruments
0 Kudos
Message 9 of 9
(2,978 Views)