LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Do curve fitting after click the stop button

Hello, I have a question about do curve fitting after stop the while loop.

 

here is the situation, I build up a real-time system, so the signal value would change along time. after finish the record, i want to fit this curve.

 

initially, I put an express curve fitting function in the while loop , however it doesn' seem right.

Then I think the curve fitting should be done after stop the recording, there is, I use an event case that clicking the program stop button would lead to curve fitting.

 

but in the first step, i try to show the mutiple plot  just like the one in while loop, I failed...

without this step, I don't think the curve fitting could be done.

but the other function in the event case are successful...like saving image or change some booling value.

 

 

0 Kudos
Message 1 of 4
(2,577 Views)

Hi mei,

 

I failed...

Well, you failed in a lot of ways (according to your description)… 😄

Most important: you forgot to attach your VI!

 

Attach your VI, tell us exactly where you are stuck, don't forget to embed useful default data in the VI (run the VI until you got good measurement data, then stop the VI, set all values to default in the edit menu, save the VI, attach it)!

Best regards,
GerdW


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

The magic word is "state machine". Create a acquisition state, a fitting state, a shutdown state, and an idle state. And define transitions based on the current state and user interactions. Never exit the top-level while loop until you are completely done. Code needs to stay alive, not just run downhill into a black hole.

 

Please show us your code!

0 Kudos
Message 3 of 4
(2,494 Views)

@mei0512 wrote:

 

initially, I put an express curve fitting function in the while loop , however it doesn' seem right. 


You need to tell us what right (and wrong) means. Since you have not replied in a while, I wonder if you solved the problem?

0 Kudos
Message 4 of 4
(2,469 Views)