03-19-2015 04:23 PM
Hi All
I am building a vi for controlling some experiment in my lab. The vi simply reads values from a usb6008. The vi has two modes of opperation measurments and callibration. In the calibration I measure the values agenist constant values I then do a linear fit. All this is working fine. Wat I would like to do now is to plot the fitted data on the same plot with the original data. Can any one help.
I am attaching my vi. Since I am a beginner it will also be great if you recommend how I can do things better and how to make the vi more effecient.
Cheers Ihab
03-19-2015 04:44 PM
As I first step, I would get rid of most of the express VIs and collect the data in a shift register. You can easily display it in a graph and table control and the overall code would be much cleaner.
Graphing the data with the fit would be trivial.
Couldn't you read 100 points in one operation and take the mean? Why the FOR loop?
You have many type mispatches (orange vs. blue)
Why do you have so many feedback loops.
You can show the digital display of the slide, no need for a seperate indicator (right-click slide...visible items...digital display ... move it to where you like)
It is annoying to have the front panel and diagram maximized to the screen.
03-19-2015 05:29 PM
Hi altenbach
Thanks for the quick reply. I konw that the vi is not very smart. it will be very generous of you to show me how to do what you proposed.
Thanks in advance.
Cheers Ihab
03-20-2015 08:08 AM
Hi Altenbach
I made some corrections as you did suggest. A number of things I didn't know how to do:
1- remove the express vi for the table.
2-remove the express vi for the Daq.
3- I also want to share the reset and zero set bottons between the two tabs.
It will be great if you can guide me through.
Thanks.
Cheers Ihab
03-20-2015 08:32 AM - edited 03-20-2015 08:35 AM
To start off, there are several things you do right. Your use of feedback nodes shows that you are thinking dataflow... a lot of beginners would have just used lots of local variables and hidden controls. You may want to turn some of those in to shift registers to make reading the code easier. Also, your use of "Build Array" instead of "Insert Into Array" is correct.
Places to improve:
Edit: A word... for clarity