it's been a long time. The vi that you shared is working perfectly fine. Thank you for that.
Currently, I am trying to add another feature to my program that is to control two solenoid valves (NO & NC, both 24Vdc) programmatically. I want to incorporate it to the current algorithm. So on the first loop after five (5) seconds, instead of just a Boolean indicator it will also be the signal to close the NO valve and open the NC valve. Then on the second loop once ten (10) seconds is over it will do the opposite of the first loop.
Will provide more information next time but for now I am very grateful of your help from the start.
Again, Thank you very much.
So you need a subvi between the loops that send a true and a false to a digital port
And after the second loop you can use the same subvi to send a false and a true...
In that subvi you can send a signal of the right polarity to the hardware.
Be sure to use diodes to prevent the high voltage peak when stopping a current in a solenoid valve.
That diode blocks current during on and should be big enough to prevent the peak to destroy the diode.
yes I am using a diode. I already have a working circuit just need to incorporate the algorithm for that though. Will follow your advice regarding the subvi. Your inputs are really helpful.
Thank you very much.
first of all thank you for your help as always. I have another question, I am trying to write the data to an excel file and I made a subvi for that. You have an idea how the program works however data is not being appended to the Excel file. It just overwrites the previously recorded data every time I click the Play button.
Ideally, I want the datalogging to continue writing the data every time the Play button is clicked. It will only stop when the user stops the program.
How can I make the datalogging vi work like that?
Here's the screenshot of the block diagram for the main and sub vi's. I also attached the actual vi's.
Thank you very much!