03-29-2022 09:44 AM
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
Solved! Go to Solution.
03-29-2022 09:57 AM
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.
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?
03-29-2022 10:00 AM - edited 03-29-2022 10:02 AM
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.
03-29-2022 10:11 AM
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 ?
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 ?
03-29-2022 11:58 AM - edited 03-29-2022 12:03 PM
@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 ?
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.
03-30-2022 02:09 AM
Thank i will try that !