From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
03-16-2020 03:00 PM
Hi,
I am trying to create a VI which will charge a cell from 2 volts to 3.5 volts then discharge from 3.5 volts to 2 volts and repeat this process for a specified number of iterations.
I have a vi where I take a voltage measurement from a DAQ6008 and pass this into min max and then into a case structure which then depending on the max min is either true or false (note the max min is the 2-3.5 volts) therefore if the voltage is in this range the output should be true therefore turning on the keithley 2000 power supply.
My problem is how do I now if im charging or discharging as it should be always in the specified region 2-3.5 volts. The range wont change and if its always in the range its always true and always turning on the power supply.
I have attracted the VI (2014 sp1)
All the best
Darragh
Solved! Go to Solution.
03-16-2020 07:04 PM
First, clean up your wiring using the block diagram cleanup button.
Second, you don't want to open, configure, and close every iteration of the while loop. Those functions should be outside the while loop and the only thing inside are reads or writes or whatever you want to do repeatedly. Actually, I don't know what those subVI's are supposed to do since they aren't included, but they say Configure, Configure, Query Error, Close. Why are you configuring twice?
What you want is a state machine, Search the forums, search the templates in LabVIEW, search the example finder. You want to keep track of what "state" you are in (charge vs. discharge) and act accordingly, The state is stored in a shift register. Once you've reached the limit, then the state machine will decide to switch to the other state and its behavior will change accordingly.
03-17-2020 05:02 AM
I am configuring the voltage and current output of the kiethley 2000 power supply (via the front panel).
If they are outside the while loop then when i run it it doesn't pass through until the while loop stops, is a tunnel needed ?
I have been on the forums looking at state machines already but am finding it difficult to get an understanding as to how to implement it into my VI.
Also thank you for the help.
03-17-2020 08:57 AM
Only the open and the close belong outside the loop.
The stuff where you want to write to the device on every iteration (or read from it) belong inside the loop. Yes, you will use tunnels to pass the reference wires into the loop from the open/initialize and out of the loop to the close.
03-22-2020 06:24 AM
Hi,
I did what you asked and got a state machine to work.
Have you any ideas how i can write multiple values into one excel sheet with the same time stamp.
Thanks
darragh