LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Producer Consumer, error stay even when I correct it

Solved!
Go to solution

Hello,

I actually work on a program to control a power supply and read datas from a current sensor with a DAQ (Ni-USB 6009 from NI). For this, i use a producer/consumer template and when there is no error, the VI run normally. But once an error appear, (ex in my case : Power Supply USB not connected) if i correct it, the same error stay as long as i don't close the VI windows and relaunch it. On my program i put a indicator abour the actual task of the VI, and when i relaunch the VI, it stay on the task where VI was stopped due to an error. Normally i want it to restarts all the step before the error (to consider the changement about the error)

 

You can find the file with VI and SUB-VI, The right Vi is "Software banc d'essai V20" 

 

Thank

Hugo

 

Download All
0 Kudos
Message 1 of 6
(1,515 Views)
Solution
Accepted by HugoLabVIEW

It is because you don't clear the error anywhere. Ideally, in the error case, you handle the error and clear it to continue execution.

santo_13_0-1648565732192.png

BTW, you mention USB-6009 but it is not used in your code.

 

Do you need help with solving a Hardware driver error or asking for a better way to handle the error in the software architecture?

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 6
(1,508 Views)
Solution
Accepted by HugoLabVIEW

Hi,

 

Your cluster that contains the error is in a shift register so if nothing resets that value in the shift register the error will still be there and prevent new action if all error in are rightly connected.

At the position you are displaying the error you could add a function to erase that error. Be careful that if a new error is found you will be in a loop of "error creation" => "error erasing" => "error creation" etc ...

 

Edit : Santhosh has even a better solution as doing it in your error case is a cleaner way to do it.

0 Kudos
Message 3 of 6
(1,499 Views)

Thank a lot for your help I've done that to correct the problem and it works, is it a proper way to do it ?

HugoLabVIEW_0-1648566518211.png

 

After, in case of an error i would like to have a way to correct it without stopping and restart the VI do you know a way to do it with mine  ? 

0 Kudos
Message 4 of 6
(1,489 Views)

@HugoLabVIEW wrote:

Thank a lot for your help I've done that to correct the problem and it works, is it a proper way to do it ?

HugoLabVIEW_0-1648566518211.png

 

After, in case of an error i would like to have a way to correct it without stopping and restart the VI do you know a way to do it with mine  ? 


Yes. Initialize the shift register with a value of no error!

 

If you add a general error handler in the error case you can Prompt to user to "Reconnect Disconnected Device and Continue?" When that specific error occurs then use "Clear Error.vi.


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 6
(1,467 Views)

Thank i will try that ! 

 

0 Kudos
Message 6 of 6
(1,434 Views)