LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reset waveform chart relative time

Solved!
Go to solution

Hi all

 

I created a wavefrom chart that starts from a relative time of 00:00:00 when the vi starts and display the waveform versus the time elapsed since the vi started.

I did this using an example that i found in ni forums by subtracting the current relative time from the relative time of the waveform as seen in the block diagram attached  

 

when i stop the vi and start it again normally it starts again from zero and so on .

 

the problem that i want the chart to start from zero every fixed amount of time (ex: 50 seconds ) and not require to stop the vi and start it again in order to start back again from zero !!

 

I've been thinking about how to do this for a lot and i tried a lot of things but i couldn't ,does any one have an idea on how to do this ?


i have a feeling that the solution will be simple to a lot of people ,but please forgive me coz i'm new to labview and its my first project using it 

 

Thanks in advance,

 

Regards

 

Shady

Download All
0 Kudos
Message 1 of 7
(3,884 Views)

 

Replace the tunnel that feeds the start time with a shift register and use that value for the start time. You could then reaplce the value in the SR using a case structure or a select node when a button is clicked.

 

Please note that if you pass the waveform chart a new value with a time stamp that is "backwards in time" from what alrady pltted, the cahrt will reset itself claering the prvious data.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 7
(3,879 Views)

Ben

 

First of all thanks a lot of your reply.

 

I just want you to clarify how can i replace this tunnel with a shift register ,where will this sr take the data from ,coz the "Get current date and time" is actually placed outside the loop ,also how can i replace this value with a case structure ,shall i put the "get date and time" in a loop or in a case structure ? coz i actually tried ways that looks like that but it didn't work .

 

I will appreciate that a lot if you showed me what you mean by a diagram. or on the actuall vi that i attached to the post.

 

Thanks in advance

 

Regards

 

Shady

0 Kudos
Message 3 of 7
(3,869 Views)
Solution
Accepted by topic author shadyman

@shadyman wrote:

Ben

 

First of all thanks a lot of your reply.

 

I just want you to clarify how can i replace this tunnel with a shift register ,where will this sr take the data from ,coz the "Get current date and time" is actually placed outside the loop ,also how can i replace this value with a case structure ,shall i put the "get date and time" in a loop or in a case structure ? coz i actually tried ways that looks like that but it didn't work .

 

I will appreciate that a lot if you showed me what you mean by a diagram. or on the actuall vi that i attached to the post.

 

Thanks in advance

 

Regards

 

Shady


 

I reserve that type of service to my paying customers. Smiley Wink

 

Let me turn it around and welcome YOU to post an image of what you have tried and let us comment based on your efforts.

 

I'll get you started with two suugestions and a question.

 

1) You can right-click the input tunnel and select "replace with Shift Register".

 

2) If you watch your code in execution highlighting mode, you can see were the data comes from and goes to when.

 

Now for your question!

 

After watching the code run where would there have to be another "Get time" node have to be located to get a new value WHILE the loop is running?

 

Like I said post images of what you are attempting to do and let us offer advise based on that.

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 7
(3,864 Views)

Ben

 

Thanks to your suggestions I think I managed to do it Smiley Happy

 

I did it using the shift registers and a case structure that switch the time input to the current time from inside the loop when executed.

you actually made it clear when you asked the question at the end of the post Smiley Happy thanks again.

 

I may sound greedy but now i want it to reset automatically every amount "x" of seconds ,what do you think I should do .

 

Regards

 

Shady

 

 

0 Kudos
Message 5 of 7
(3,858 Views)

Read the new time inside the loop and not in the case structure.  Subtract the time in the shift register from the newly read time.  If the difference is greater than or equal to X, OR the reset button is set, put the new time in the shift register, otherwise wire the data from the shift register back through to the shift register.

0 Kudos
Message 6 of 7
(3,852 Views)

Ravens fan

 

Thanks a lot 🙂 ,I don't know what to say ,This solved the problem and the vi now runs exactly like i wanted it to be.

 

That is how it looks like right now ,Thanks to you Guys.

 

I also attached the VI if any one here in the forum wants to use it in the future 🙂

 

 

Final.jpg

 

Thanks Ravens Fan ,and Thanks Ben Smiley Happy

 

 

Shady

 

 

 

0 Kudos
Message 7 of 7
(3,845 Views)