09-12-2024 03:26 AM
Hi everyone,
I have a recurrent problem on my Labview VIs.
Actually I did two for recording and controling different lab equipment (probes, pumps, ...).
The problem is when I run the program most of the time there are probes that are giving no value "0". I have to restart the program multiple times to finally get the value. Once I have the value, the program can run without any problem for a few hours/days.
For both program, it was the same probes (same brand) on two different DAQ systems (1 from Advantech and 1 from NI). The other equipments that are controlled by the program seems to work (2 AO/AI mass flow controllers, 1 AO agitator, 6 other AO channels, 1 solenoid valve).
So either there is a problem with these particular probes, or I do something wrong when programming the VIs (I think the latter is more probable...).
You will find below the typical program I am using.
Do you see something wrong there?
Would you have any advice for me? Should I modify some parameters?
Thanks a lot!
Solved! Go to Solution.
09-12-2024 06:15 AM
Hi lforire,
@Iforire wrote:
Do you see something wrong there?
Would you have any advice for me?
@Iforire wrote:
The problem is when I run the program most of the time there are probes that are giving no value "0". I have to restart the program multiple times to finally get the value. Once I have the value, the program can run without any problem for a few hours/days.
Which "probes" are you talking about?
(Why do you expect "0" values at AI channels when you start your VI?)
09-12-2024 06:27 AM
Hi GerdW,
Thank you for your answer.
And sorry for not being crystal clear.
The image is an example, the full VI is more complex so I simplified it to the maximum so it can be better understood.
@GerdW a écrit :
- Why do you need to convert an array (of 2 elements) into a cluster of 9 elements to unbundle the first two elements???
- Why don't you use IndexArray when you want to index elements of an array???
- Why don't you clean up your code? (Straight wires…)
Yes indeed this is silly, in the final VI, I am using IndexArray, but not everywhere, I will modify that.
What do you mean by "clean up the code"? Actually my final VI is a total mess, I really need to improve that and need to learn how to do clean my code. I am gonna look for some tutorial (if you have some, I will be glad if you can share them!)
Which "probes" are you talking about?(Why do you expect "0" values at AI channels when you start your VI?)
Sorry my English is not always good. When I say probes it's the pH and temperature sensors. There are a few others I am using that do the same thing. And they are of the same brand.
Actually, I do not expect to have a "0" value when starting the VI but a real value between 4 and 20mA.
And something important, when I get "0" when starting the VI, it does not change and stay "0", so I cannot read the sensors values and I need to restart a few times before it can work.
Thanks
09-12-2024 08:01 AM - edited 09-12-2024 08:03 AM
Hi lforire,
@Iforire wrote:
What do you mean by "clean up the code"? Actually my final VI is a total mess, I really need to improve that and need to learn how to do clean my code. I am gonna look for some tutorial (if you have some, I will be glad if you can share them!)
There is a "Style Guide" chapter in the LabVIEW help…
@Iforire wrote:
Actually, I do not expect to have a "0" value when starting the VI but a real value between 4 and 20mA.
And something important, when I get "0" when starting the VI, it does not change and stay "0", so I cannot read the sensors values and I need to restart a few times before it can work.
DAQmxRead will give you a "constant 0" when there is an (upstream?) error. Are there any errors?
(We cannot debug your VI without your hardware, so you need to do that on your own!)
09-12-2024 01:56 PM
As was somewhat mentioned above, you're probably getting an error but the error is hidden so you don't see it.
To give more concrete instructions on what to do:
09-13-2024 05:03 AM
Thank you Kyle for the suggestion. It gives me multiple errors I need to investigate!