02-28-2014 01:28 AM
02-28-2014 01:47 AM - edited 02-28-2014 01:49 AM
Oh wait, the diagram that you've posted is the SubVI.
Sorry, I wasn't paying attention to it.
Since you're using the subVI and you have VISA Open and Close functions outside the subVI, then you do not need them in the subVI. So, just remove all the VISA Open and Close function, and more importantly, remove Simple Error Handler.vi and the Stop function (Because you'll still need the main VI to continue running and pass on any errors detected outside of the subVI to the next function until the end of the main VI).
03-02-2014 05:48 PM
Hi ongeelim
Here is my whole VI. I am not sure if you can run it without the driver for ag33xx and DSO6000. I have tried to put a indicater (Read?) after the VISA read. however, the light was not turned on and it means that the program still stops at the VISA read. Also, I put the VISA close and STOP in the case box cause I want the program to stop there if the error occours.
03-02-2014 11:10 PM
Hi Lawrence,
I was unable to get access to the block diagram since your code is password-protected. From what I've observed from the attached images (subVI_2.JPG), is that the Read? indicator will only light up if the error code is equal to 1073807339. (It should be -1073807339 (timeout error code), not 1073807339)
But you mentioned that the LED indicator was not turned on and it means that the program still stops at the VISA read. The statement and label of your LED indicator is contradicting and confusing. What are trying to achieve from using the LED indicator (Read? ). Are you using the indicator to determine whether the read operation is completed or check if the timeout error has occurred.
And based on your code, regardless of whether there will be an error occurred, there's no way the program will terminate at VISA Read because the error information will eventually pass to the next function.
03-02-2014 11:47 PM
Hi ongeelim
Thank you for pointing out the code is -XXXXXXXX. I just had a test with his code and you are absolutely right as the program continues to the next function. For the LED, I put it in just to see if the program reads the next function (so the label is "read?"). Forget it now.
I think the problem now shall be solved (while, there wasn't a problem indeed but confusions).
I forgot that I had a password-protection, sorry. The code is "yichi". I would be grateful if you have time to have a look at my code and help me to improve it.
03-03-2014 01:00 AM
Your code should be doing fine (although there are small improvements you can make to improve), but there's too much wires going around the block diagram and can be a bit messy.
What I can recommend for you is to try grouping, if possible, all the inputs into 1 cluster, to make the entire block diagram neater. Here are the links to know more about clusters.
http://www.ni.com/gettingstarted/labviewbasics/datastructures.htm#Clusters
http://www.ni.com/white-paper/7571/en/
03-03-2014 04:10 AM
Thank you, ongeelim. I am more confident now. I will try to make it neaty. I was feeling the same way, too.