LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding the maximum continue on-time and the minimum idle-time, and display them on the waveform chart.

Solved!
Go to solution

Hello everyone,

 

I encountered a problem and could need some help.

 

I'm trying to monitor my equipment for the maximum continue on-time and the minimum idle-time, and display them on the waveform chart.

The original signal is an analogy sample, and I using trigger level to change it to 01 for easier to differentiate.

Hence, input is the 1D array of 0 and 1, 0 means the device is in idle-time and 1 is on-time.

 

Result measurement:

  1. Determine the maximum continuous on-time of the equipment.
  2. If the equipment stop time is less than or equal to 1 second, it is classified as an operating state (1).
  3. Determine the minimum idle time of the equipment.

 

The figure below shows the ideal output state, the maximum continuous on-time is 7 seconds, and the minimum idle-time is 3 seconds:

Capture.PNG

 

I would be really grateful for some help since I'm stuck with this problem for a long time now.

 

Best regards,

Thomas

Download All
0 Kudos
Message 1 of 5
(1,941 Views)

Hi Thomas,

 

That looks like homework to me.
Surely you can see you are looking at the area under the graph, and now you've got a rectangle you can just calculate that easily.
look in the Array pallette to find the function(s) you need. It should be obvious from the question. I'm not going to tell you the answer 😉 - that's cheating.
Then you just need to keep in memory the biggest/smallest value you've got so far and compare for a running check.

(Haven't looked at the code, question and front panel tell me enough).

 

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 2 of 5
(1,917 Views)

Hi James,

 

Thanks for your response.

I'm using the "Property Node" to show up my idea layout. (as picture below)

11111.PNG

I am new to the LabVIEW since I learn it by myself, no idea how to start the determined function when it is detected the on-state (1), calculates the idle-time (o) less than 1 sec between the on-time state, and stop if the idle-time more than 2 sec. (also start detected next states…)

 

Best regards,

Thomas

0 Kudos
Message 3 of 5
(1,820 Views)
Solution
Accepted by topic author ThomasChen_0203

Hi Thomas,

 


@ThomasChen_0203 wrote:

I am new to the LabVIEW since I learn it by myself,


I hope you already found all those "Training resources" offered at the top of the LabVIEW board. Did you?

 


@ThomasChen_0203 wrote:

I'm trying to monitor my equipment for the maximum continue on-time and the minimum idle-time, and display them on the waveform chart.


  1. You need to detect the changes between "on-time" and "idle-time". Think about boolean changes/crossings - there is a LabVIEW function named "BooleanCrossing"…
  2. Whenever such a crossing occurs you can determine the current timestamp and store it in a shift register.
  3. You can calculate a duration from current timestamp and the previous timestamp hold in this shift register: this will give you the duration of the previous on-/idle-time.
  4. Now you need to use two more shift registers: one stores the longest duration of "on-time" (wow, there's a MinMax function!), the other holds the "minimum idle-time" (again after using a MinMax function)…

See how far you get - these steps should bring you most part of the way! 😄

(I also think this is some kind of homework, so please do your work to learn LabVIEW on your own. We will not provide solutions, but will always give you comments on the code you will attach.)

 

Btw. it always helps to sketch an algorithm on a sheet of paper before starting the actual coding work!

Best regards,
GerdW


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

Hi Gerd,

 

Thank you very much for your response, it is very helpful to me.

Basically, I simplified the question, because the original data is more than 60 million.

After learning and trying step by step, I succeeded.

 

Best Regards,

Thomas

0 Kudos
Message 5 of 5
(1,673 Views)