01-16-2014 09:00 PM
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.
01-17-2014 12:58 AM
I tried to save the data with shift register but it only save few points
I attached the program
01-17-2014 08:33 AM
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
01-18-2014 04:28 AM - edited 01-18-2014 04:35 AM
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
01-18-2014 11:44 AM
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.
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