03-19-2012 09:04 AM
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.
Solved! Go to Solution.
03-20-2012 07:39 AM
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.
03-21-2012 11:00 AM
I apologize for not getting back sooner, I had a death in the family.
03-21-2012 11:36 AM - edited 03-21-2012 11:37 AM
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.
03-21-2012 12:06 PM - edited 03-21-2012 12:07 PM
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.
03-21-2012 12:36 PM
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.
03-21-2012 12:49 PM
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?).
03-23-2012 01:19 PM
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.
03-26-2012 12:52 PM
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