LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ Assistant Curve fitting .

Thank you for the answer, but how can I at least save the data which I want to fit ? how to accumulate the wanted data as you said with shift register ? 
At least, if i fail for doing that I woul like at least to save the wanted data in Excel using " Export to Excel " in the Graph window, and then I just load them by LabVIEW and do the fitting as you did. 

But I tried several time to load the excel file which I uploaded to fit it as you did, but It didn't worked for me. 
Can you tell me how did you readed my Excel file and ploted it in the "raw" window? a simple VI can be a good help for me .

I thank you again for your support, I appreciate. 

0 Kudos
Message 11 of 15
(917 Views)

I tried to save the data with shift register but it only save few points
I attached the program

0 Kudos
Message 12 of 15
(906 Views)

You need to append the new data to the data already in the shift register.  This is a basic LV concept.  If you have not done so, I recommend that you spend a little time on the on-line tutorials for Getting Started with LabVIEW.

 

The attached VI shows one way to accumulate the data. This is not the most efficient way and can lead to memory allocation problems if the array gets large, but it is conceptually simple.  In the True case the data is converted to an array from the Dynamic Data Type (DDT). This step is not essential but the DDT makes it so hard to know what is going on that I avoid it where possible (which is always!). The Build Array primitive is modified (context-click) to Concatenate Inputs. If this is not done, the result is a 2D array. In the False case a Wait is added so that the loop does not try to run millions of times per second while waiting for the user to push the sv button. An event structure is even better but let's not complicate things learning that now. I moved the Waveform Graph outside the case structure so it is updated every iteration.

 

Lynn

0 Kudos
Message 13 of 15
(899 Views)

Hello JohnSold

Well I begin to get the idea , i thank for your help I fixed my VI succeded to save the wanted waveform; the VI is attached with the fittin functions
Only one problem which I cant fixed is that the saved waveform is totaly saved as the inverse of the real one , I attached two picture of the real waveform and the saved one. 

lvd: is the real waveform. 
svd: the savd waveform.

I attahed also my VI
I ca't understand why it's saved inversly
Can you help please ? I appreciate your support and help again

THANK YOU

Download All
0 Kudos
Message 14 of 15
(883 Views)

Ah! I messed it up for you. Sorry. By prepending the new data at Build Array, it reverses the array. The image below shows the correct way.

 

Correct array order.png

 

Other questions: It appears that you are reading 10 data points on each iteration of the loop but only appending one to the array. Why are you throwing away the other 9 points? It also appears that you need to read the DAQ Assistant and process the data 50 times per second to keep up. As the array grows larger, it will become more difficult to do that. I suggest reading larger chunks less often and looking at managing the array size appropriately.

 

Lynn

0 Kudos
Message 15 of 15
(869 Views)