LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

A Program that somethimes doesnt work

Hi everyone,
I am trying to make a computer controlled measurment system, where I should control a several machines in my laboratory.. but something doesnt work right..

I am pretty new in LabView but I have managed to make it work somehow. The weird part is that it doesnt work every time... In the step 1 the program should start the discharging of a battery, and discharge it until the current drops under 0,5 A, but somehow the program just skips that part and continue the rest. It happens like ~90% of the time, every 10th time when I start a program it works fine.

My first prototype worked just fine, and than I tried to make some better GUI, and even if I didnt change anything in the loop, it broke somehow..
Please for any advices... Thanks

 

0 Kudos
Message 1 of 6
(2,484 Views)

Try to save in LV 2015 and Share not able to VIEW your Code

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 6
(2,472 Views)

LabView for 15

0 Kudos
Message 3 of 6
(2,457 Views)

Hi vlado,

 

something doesnt work right.

Please clean up that monster of a VI!

(Basic rule: keep block diagram size to screen size. You surely don't use a >6000 pixel wide monitor!)

 

I suggest to convert that huge flat sequence into a proper statemachine…

 

In the step 1 the program should start the discharging of a battery, and discharge it until the current drops under 0,5 A, but somehow the program just skips that part and continue the rest.

- "Step1" is probably the 8th frame of your sequence - you forgot some useful comments in your code!

- Why do you compare numeric values using strings? Why convert a device reading to DBL, then format that DBL value into a string?

- A program NEVER "somehow" works! It always works as programmed BY YOU - and you should debug your code!

 

(In case you're more comfortable in German I can also recommend the German LabVIEWForum!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(2,442 Views)

Hi vladosaurus,

 

Please go through the LabVIEW Basics and Architecture (State Machine Architecture), Even if it works it is not the recommended way of coding.

please restructure your coding

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 5 of 6
(2,440 Views)

vladosaurus wrote:  In the step 1 the program should start the discharging of a battery, and discharge it until the current drops under 0,5 A, but somehow the program just skips that part and continue the rest.

Your specific problem there is you are comparing strings.  You need to convert the strings into numbers first and then compare numbers.

 

From an architectural view, you really should look into a State Machine.  It will make your code a lot more manageable and allow for repeating of states.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 6
(2,426 Views)