03-27-2023 05:59 AM
I have created this labview project for battery charging and discharging. Here I am charging the battery for fixed time interval and then discharing for fixed time intervals. I want to repeat this for a fixed no of cycles. I am able to communicate using serial communication with the system and set the current-voltage values but there are a few problems with the loop.
The loop is not stopping after the given charging and discharging time but at a different time. Secondly, the charging function acts only once even when I set the no of for-loop iterations as 3.
I am very new to LabVIEW and therefore facing problems in solving the above issue. I will thankful for your guidance to resolve the matter. I am attaching my vi program along with the subroutine for the instruments I have used.
03-27-2023 07:14 AM
I also was a Pascal programmer before I learned LabVIEW (Oregon Software Pascal 2, and later Extended Pascal for the PC). Using your Pascal experience, you should have little trouble picking up the basics of LabVIEW, particularly if you can find a experienced Developer who can act as a teacher/mentor for you, and at least teach you how to work with the LabVIEW Development system (like how/why to use dual monitors, one for the Front Panel, one for the Block Diagram, the reason (as explained in "The LabVIEW Style Book") that every Block Diagram should fit on a laptop screen ==> the importance of sub-VIs and TypeDefs, and keyboard "tricks" (an engineering student with some LabVIEW experience explained to me that the "fast way" to move the cursor around the Block Diagram was to hold down "Shift" as I held down an Arrow Key, and a few years later I learned about QuickDrop).
There are some tutorials mentioned on the first page of this Forum, as well as on the Web. If you have a supported version of LabVIEW, you should also have access to NI's Core I, II, and III series of courses (or, at least, that used to be the case, I think).
Bob Schor
03-28-2023 05:32 AM
1. This program is used to charge and discharge a battery for a fixed time based on user input but the while loop does not terminate at the set time period.
2. Secondly, the charging cycle runs only once while the discharging happens for the given number of iterations in the for loop.
Can someone help me find the error in the logic used?
03-28-2023 06:09 AM
03-28-2023 06:45 AM
can you check and find the problem in the logic and guide me?
03-28-2023 07:02 AM
Hi Vikash,
@vikaaaaash wrote:
can you check and find the problem in the logic and guide me?
As soon as I get access for my LabVIEW2021 installation…
03-28-2023 12:40 PM
Hi Vikash,
@vikaaaaash wrote:
Can someone help me find the error in the logic used?
At first you should cleanup the block diagram to make the code more readable!
Then I recommend to implement a proper state machine instead of stacking two or more loops inside a huge FOR loop.
I also suggest to remove Rube-Goldberg code constructs like in the case structure
The "error in the logic" most probably comes from using ExpressVIs without understanding their "inner workings"! I recommend to reset the ElapsedTime ExpressVIs in the first iteration of those inner while loops…