LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple plots

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 

0 Kudos
Message 1 of 5
(2,642 Views)

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.

0 Kudos
Message 2 of 5
(2,635 Views)

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

0 Kudos
Message 3 of 5
(2,625 Views)

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

0 Kudos
Message 4 of 5
(2,585 Views)

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:

  1. Your VI uses about 20-30% of my processor sitting there doing nothing ...  as fast as it possibly can. What you are really doing is just polling your boolean controls over and over.  Make this event driven instead.
  2. The "DAQ Assistant" you have configured is horribly ineffeciant.   You build a new task, get one sample, close the task each time.  If you right click on it you can "Generate DAQmx code" and put the create task and destroy task outside of your while loop so you don't do it each time.
  3. This is the perfect application for a Producer/Consumer event type design pattern.  You can find an example by clicking "File > New > VI > From Template > Design Patterns"

Edit: A word... for clarity

0 Kudos
Message 5 of 5
(2,576 Views)