07-18-2017 04:16 AM
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
07-18-2017 04:34 AM
Try to save in LV 2015 and Share not able to VIEW your Code
07-18-2017 05:35 AM
LabView for 15
07-18-2017 06:07 AM - edited 07-18-2017 06:12 AM
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!)
07-18-2017 06:09 AM
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
07-18-2017 06:16 AM
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.