LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Beginner: help debugging LabVIEW program for TDK-Lambda power supply

I don't think the problem is that the VI isn't working, the problem is that you're using an equals comparison on a time stamp variable to trigger using it.  Time stamps may look like hours/minutes/seconds and nothing else, but under the surface they're floating point numbers. Comparing floating points for equality in LabVIEW is a bad idea (well, it's a bad idea in all languages...)

 

The easy way to fix your code would be to change it to a "greater than" node instead.  

 

I'd also add a time delay in there too. Since you're only measuring once an hour there's no need to check it millions of times a second.  Add a .1 or 1 second timer in there.

Message 11 of 14
(1,077 Views)

Thank you! Checking the floats for equality was indeed a problem, the code was never entering the "True" case. But I am still not seeing an output from the "Meas Voltage Output VI".

 

On another note, the bottom while loop doesn't execute until I halt the top while loop and I am having trouble understanding why. Is this because of the flat sequence structure in the top loop?

0 Kudos
Message 12 of 14
(1,070 Views)

Yeah, I wasn't looking at that earlier, but the error chain and time stamp inputs won't let the bottom loop run because they both pass through the top loop.

 

You need to either fork the error wire before it enters the loop and move the "Get date/time in seconds" out of the loop, or move the bottom loop so that it's completely inside the top loop.  Not sure which (or both) would accomplish your goal.

0 Kudos
Message 13 of 14
(1,065 Views)

The former fixed it. Took off the error wire from the bottom loop and moved the "get date/time in sec" outside the loop. Thanks so much.

 

Additional question. If I wanted to turn off the power supply after X amount of hours (gradually decrease the voltage down to zero), do you have an idea of what driver I could use to accomplish this?

0 Kudos
Message 14 of 14
(1,054 Views)