I am trying to make a Labview program which is able to control the temperature of a heater. Sometimes an error 200301 is showed and I don't know what I have to do to correct that.
My program is enclosed (but I have a lot of subVIs so I don't know if I have to enclosed them too...)
Uploading just the top-level VI does not include all of the subVIs. Just like uploading a .c file would not automatically include any other .c file containing functions that are called by the top-level .c file.
In terms of your question: I see only sparse error handling, so how do you know where the error is occurring? The error dialog should tell you where it's occurring. What does it say? If it's not providing enough information, then you need to improve your error handling. It seems as if you are relying on the automatic error handling of LabVIEW to stop the program when an error occurs. Is that the case?
Overall your architecture is lacking, and I think you should consider something like a state machine.
Thank you for your help.
The error dialog tell me it is because of the "stop case" afer the PWM (see file enclosed).
Yes I am relying on the automatic error handling of LabVIEW to stop the program when an error occurs. Is there a better solution?
As regards my architecture I don't know what exactly you want to say. I will try to use state machine but I never use this before...
the error dialog is clearly saying "DAQmx Write" - it's not mentioning any "stop case"!
Your problem is because you rely on automatic error handling: the error is only shown at the end of the error chain - which is the DAQmxClear function.
And of course there's a better solution: Do your own error handling instead of relying on LabVIEW to handle things automatically! There's a full palette of functions dedicated to error handling...
Use the error clusters. All your sub-VIs should have an error in/out cluster. As GerdW has stated, you can also use the error dialogs under the Dialog and User Interface functions palette in conjuction with the error clusters to handle your errors. You should have proper error handling techniques for every project you do. Don't rely on LabView to do it for you.
Also, don't use stacked sequence structures. You have a stack within a stack. This makes the code harder to read, and harder to debug and is just poor programming practice. I believe a state machine was mentioned earlier. I'm in agreement. This would be a much better programming archetecture for what you are doing. Once you've used it once, you will understand the versatility, maintainability, and scalability of this archetecture.