LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview Program for battery charging and discharging

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.

Download All
0 Kudos
Message 1 of 7
(1,225 Views)

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

0 Kudos
Message 2 of 7
(1,205 Views)

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?

 

0 Kudos
Message 3 of 7
(1,163 Views)

Hi Vikash,

 

no need to start a new thread for the very same problem…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 7
(1,148 Views)

can you check and find the problem in the logic and guide me?

0 Kudos
Message 5 of 7
(1,136 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(1,129 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 7
(1,087 Views)