LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding elapsed time for the duration a signal remains on (1V) for the whole day

I have a sensor which gives an analouge output of 1V when a certain condition in the day is met, otherwise it remains 0V and its an analouge input. I want to find the duration of the time for which this signal gives 1 V for the whole day (as for the whole day it will keep on fluctuating between 0 and 1V) . Can anyone kindly help me with this. I am relatively new to Labview so am still trying to grasp the hold of it. I was thinking of a way to use "Elapsed Time" but couldn`t figure out how. Thankyou

Obliged 

0 Kudos
Message 1 of 9
(3,687 Views)

Common guys, can any body help me out with this? 

0 Kudos
Message 2 of 9
(3,643 Views)

This is not a "Do My Work For Me For Free" site -- it is a place where you post your code, ask "Why doesn't this do what I want?" (or a similar question), and (politely) ask for help in understanding LabVIEW.  Certainly, if you post a "Do this for me" on Saturday, why are you being so impatient on Sunday (unless it is due on Monday)?

 

Post what you've done, and show us what difficulty you are having.  Among other things, it will give us some idea of the data rates you are using, what you expect to "trap" (are you worried if the signal drops to 0 for 1 microsecond?), and other issues.  It will also show us what you know/understand about LabVIEW -- if you are interested in learning LabVIEW, we'll be able to suggest resources.  

 

Bob Schor

0 Kudos
Message 3 of 9
(3,631 Views)

What are the conditions for this signal?  You say 1 volt,  but supposed the signal is measured as 0.99V?  Can it ever by 5 Volts?

0 Kudos
Message 4 of 9
(3,612 Views)

You haven't helped yourself by not providing what hardware you have available either.

 

As RavensFan has said, you also need to recognize your realistic specs for what is considered "on."  What kind of resolution are you looking for in timing?  What is the minimum on time that needs to be captured?

0 Kudos
Message 5 of 9
(3,603 Views)

On top of what everyone else added, you should use context help (ctrl+h) to understand the tools you're using.  You essentially said "I see this nail in the board and I want to get it out.  Why won't my screwdriver handle that task?!"  The Elapsed Time Express VI is meant to tell you when a certion period of time elapses.  You put the time into it to start with.  How would this accurately measure an unknown time?

 

Before you even begin to tackle this problem, you need to define your signal better.

 

1) What RANGE of voltages qualify as a 1? (noise will ensure you don't remain at exactly 1V)

2) What RANGE of voltages qualify as a 0?

3) What remaining voltages show that something isn't right in your system and should be handled differently?

4) What sampling period do you care about?  (Does it need to remain 1 for a second or more to count or should every moment be counted?)

 

Once you understand your problem, you can begin to take a look at a way to measure it.  Right now, you might as well report an estimation.  You'd be as accurate as an ill formed question.

0 Kudos
Message 6 of 9
(3,595 Views)

It is not clear what you are asking. Can we assume that your entire hardware setup is complete and that you can reliably read sensor voltages or do you also need help with that?

 

On the hardware side, you need a device to measure that voltage. What do you have. Possibly add some analog filtering. Do you need to count it even if it is only on for a nanosecond?

 

On the software side, you need a LabVIEW program containing a while loop with a reasonable loop time (depending on the signal and desired resolution) where you repeatedly read the signal and comparing it to e.g. >0.9V. Whenever that happens, increment the value held in a shift register by the loop time. You also need a stop button to terminate the loop and shut down the hardware. You probably also want two time indicators. One to display total elapse time and one to display sensor-ON time. Now you can even calculate the percentage of time the sensor has been ON.

 

It might be difficult to test if the sensor might not turn on for hours. As a first step leave out all the hardware and replace it by a button that is set to "Switch until released". Run the program and occasionally hold down the button. (alternatively use a slider to simulate actual voltage). Observe the code and make sure it works correctly. Now add your sensor hardware to replace the button. Should take minutes to complete the entire project. Have you done any tutorials?

 

You also need to define what "for the whole day" actually means. Should it stop after one day? Should it go on forever? Should it reset the statistic with every new day? Should ig log the result for each day to a file?

0 Kudos
Message 7 of 9
(2,460 Views)

The OP hasn't logged on in about 5 years now, I think he probably got his issue sorted 🙂

0 Kudos
Message 8 of 9
(2,448 Views)

Good point. I guess the thread got bumped by a deleted spam post. If it shows up in the new unsolved topic, I usually don't check the date... 😄

0 Kudos
Message 9 of 9
(2,440 Views)