キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

How to run vi continuously when VISA read timeout happens

解決済み
解決策を見る
Hi ongeelim, I have the VISA open for both of them outside this SubVI, do I have to repeat them here? There are flaws in this one as I should put the error code node after the VISA read (I did have tried that way but didn't save it I guess). Do you mean that I should put the whole case structure outside the while loop, and the while loop will stop when there is an error? What if the whole SubVI is in a big while loop in my VI? Does it matter? Maybe I should upload the whole VI next Monday, but it is a big mess. Thank you for your help. It is really kind of you.
0 件の賞賛
メッセージ11/17
1,344件の閲覧回数

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).



See that button on the left side of this post...

If you feel my post is helpful, all you need is just (at most) 2 seconds to click that button, to show your appreciation. Thank you~~



0 件の賞賛
メッセージ12/17
1,335件の閲覧回数

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. 

すべてをダウンロード
0 件の賞賛
メッセージ13/17
1,305件の閲覧回数

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.



See that button on the left side of this post...

If you feel my post is helpful, all you need is just (at most) 2 seconds to click that button, to show your appreciation. Thank you~~



メッセージ14/17
1,280件の閲覧回数

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. 

0 件の賞賛
メッセージ15/17
1,272件の閲覧回数
解決策
トピック作成者LawrenceUNSWが受理

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/



See that button on the left side of this post...

If you feel my post is helpful, all you need is just (at most) 2 seconds to click that button, to show your appreciation. Thank you~~



メッセージ16/17
1,259件の閲覧回数

Thank you, ongeelim. I am more confident now. I will try to make it neaty. I was feeling the same way, too. 

0 件の賞賛
メッセージ17/17
1,242件の閲覧回数