LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in pausing chart inside a simulation loop

Dear Sir

 

I posted these files before but I added again under the simulation loop discussion because I need any help about:

 

I. Modifying the clear button to clear the graph and also initialize the simulation time to restart again.

2. Modifying Pause button to let the chart to pause during simulation

 

 

Download All
0 Kudos
Message 1 of 8
(3,889 Views)

Can't read your file because I only have 8.2 here at work.  😞

 

but...

 

Clear button: Hook it up so that it writes an empty array to the history property of the graph (you will need to add a property node and select the history property).  Should work if I understand you correctly.

Pause button: Can't address without seeing code.

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 2 of 8
(3,877 Views)

Hi Ahmad

       I am not clear about your problem.Explain briefly

Balaji PK (CLA)
Ever tried. Ever failed. No matter. Try again. Fail again. Fail better

Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
0 Kudos
Message 3 of 8
(3,870 Views)

Briefly, when pressing the pause button the value of chart comes to zero but I don't like that I just want to pause the graph and when pressing again it starts again.

 

Also, for clear button, it clears the graph but the simulation time still continue but I want to restart the simuation time after each pressing of cleara button to clear chart and counts the time from initial time zero.

 

I hope anyone to solve it for me quickly

 

 

0 Kudos
Message 4 of 8
(3,852 Views)
In the simulation loop u cannot use the front pannel objects in the case structure. So if u paused the loop also u getting the default value zero from the false case. I am not having the  LabVIEW Control Design and Simulation Module so i attached the simple state machine code for ur need.
Balaji PK (CLA)
Ever tried. Ever failed. No matter. Try again. Fail again. Fail better

Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
Message 5 of 8
(3,829 Views)

Hey Ahmad,

 

One of the things that may prevent you from doing the pause and clear like you are wishing to do is the fact that you are using a simulation loop. Is there a particular reason why you chose to use a simulation loop? Perhaps you could use a simple timed loop (available from Functions»Programming»Structures»Timed Structure) instead. This would give you the same timing control as with the simulation loop, but you could also implement some of the suggestions made by Baji.

 

Hope this helps.

 

-Ben

Hope this helps.
-Ben

WaterlooLabs
0 Kudos
Message 6 of 8
(3,813 Views)

Dear

 

The reason for using the simulation loop that I have two differential equations dependent on each other. I sent to the forum before to use the simple timed loop but I still have problem about how to convert the subvi to strictly vi reference because when I used the ODE function the input of F(x,t) requires my subvi to be a strictly vi reference but no one in the forum helped me about this problem so that I made a simulation loop to implement a differential equation using integrator or differentiator.

 

 

0 Kudos
Message 7 of 8
(3,811 Views)

Hey Ahmad,

 

Since you are looking to work with ODE, the simulation loop may be a better choice for your application. One of the problems you are seeing in your example code in regards to pausing, when you press your 'pause' button, you are getting zero's because you are not pausing your simulation. You are simply not passing your calculated values to your waveform. So what you really want to do is pause your application. This would be very do-able with that timed loop or as Baji has done in his example. However, like Baji pointed out, you cannot use the front panel objects in a simulation loop. So, pausing you application would be difficult. One possibility would be to simply use the 'Pause' option on your execution toolbar.

 

Also, in terms of the clear button. It sounds like you are more interested in restarting the simulation so it may be useful to stop your simulation loop using the Halt vi (Functions»Control Design and Simulation»Simulation»Utilities»Halt Simulation). Then, since your simulation loop is within a while loop, you will restart the simulation.

 

Hope this helps.

 

-Ben

Hope this helps.
-Ben

WaterlooLabs
0 Kudos
Message 8 of 8
(3,796 Views)