LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

want to update XY graph at same time of measurement.

Solved!
Go to solution

Hello,

I want to update XY chart at same time of measurement.

Normally graph is update in last after taken all the reading.

I tried to made one graph which is update at same time but its not seems me correct value.

 

Will you please guide me.

Thank you very much.....

0 Kudos
Message 1 of 11
(3,563 Views)

I think your code is about 90% too convoluted. Most of your cases contain cpu burner loops as well as vestigial loop that make no difference if you would remove them. It seems 99% of the code of most cases is identical. Why duplicate all that code???

 

Are you talking about the inner or outer xy graph?

In the outer shift regsiter, you seem to transpose the 2D array with each iteration (righ after building, inside the case structure that is always true), thus messing things up beyond repair when you keep appending and transposing. You are adding columns, then rows, then columns, etc. switching with each iteration.

 

 

 

 

 

 

 

 

0 Kudos
Message 2 of 11
(3,552 Views)

Thank you very much for answer.

Actually this is sample program, my real program is quite similar of this program in that I am dealing with HM8118 and analog converter.

Here I am talking of outer graph of while loop which I need to be update after each iteration.

I will remove all extra burning CPU loops.

Will you please guide me how can I update the graph with each measurement.

Thank you very much once again.

 

0 Kudos
Message 3 of 11
(3,549 Views)
Solution
Accepted by AnkitRamani

Sorry, I cannot figure out how many plots you have on the graph. Only one?

 

Here's a quick example showing the incremental building of an xy graph. Maybe you can adapt it to your problem.

Message 4 of 11
(3,545 Views)

Yes its only one plot.

I want to draw xy chart between force and capacitance value.

I want to update the graph after every measurement.

Here I have attached simple graph may be you can get idea that what I want exactly.

Here in my case I got graph but its not correct there is some point is skipped during the measurement.

 

0 Kudos
Message 5 of 11
(3,540 Views)

@AnkitRamani wrote:

Yes its only one plot.

I want to draw xy chart between force and capacitance value.

I want to update the graph after every measurement.

Here I have attached simple graph may be you can get idea that what I want exactly.

Here in my case I got graph but its not correct there is some point is skipped during the measurement.


As mentioned earlier, there are many things wrong with your code, for example some cases output zeroes because the tunnel is not wired.

 

Here's a simple rewrite (Still maintains many of the original flaws!). Maybe it can give you some ideas....

 

 

 

Message 6 of 11
(3,506 Views)

Thank you very much for your help..

Its very good structure and lots to learn for me from labview.

Here I in attachment there is my actual vi with it I am dealing, I have to set function like that when voltmeter hash 0v then it will note capacitor and dissipation ration and go ahead then same for 1 V and so on....

Can it possible to reduce this vi also....??

Please guide me ...

Thank you very much,.....

0 Kudos
Message 7 of 11
(3,471 Views)

@AnkitRamani wrote:

Can it possible to reduce this vi also....??


Never, EVER!, attach a VI that is set to "run when opened". That is extremely rude!

 

You can use the same techiques as already demonstrated:

 

  1. use arrays instead of scalars
  2. avoid duplicate code. (Cases 2..12 are basically identical except for some diagram constants)
  3. You still have a CPU burner loop in case 1.
  4. avoid local variables, they are not needed here.
  5. Mind your representations (look at all these coercion dots!)
  6. Avoid death traps! (Many of your while loops will never stop if there is pathological data, trapping the code forever)
  7. Avoid unreachable code. (e.g. the loop can only stop if the boolean is true, so the false case of a subsequent case structure can never be reached.
  8. Avoid duplication of diagram constants. All you need is a single channel constant and a single visa resource outside the loop. You have identical constants in dozens of places. If you ever need to change the hardware, you would need to make changes in dozens of locations instead of a single place.
  9. The "Stop" primitive is not needed. The VI will stop once the loop has finished.
  10. Avoid overlapping wires and objects. E.g. case 13 is a huge mess.
  11. etc etc...

 

This forum is not a cleaning service. I think you have all the tools to do this yourself. Since you made the original VI, making a sane version using the above advice will take you 10% of the time, because there will be 90% less code. Try it.

Message 8 of 11
(3,454 Views)

Thank you for your suggestion.

I tried as you suggest me but I got confused that how can I set two loops in same structure and how to change the value of limit function for example I have set limit 1.00 to 1.2 for 1 volt, 2 to 2.2 for 2v ....

And one more problem I am facing is that in old structure in the last after saving file ,labview takes lots of time to be stop, how can I solve this problem.

Please guide me...

Thank you very much.

0 Kudos
Message 9 of 11
(3,413 Views)
  • Who said anything about two loops? You already have several loops, some are not even useful.
  • What "structure" are you talking about?
  • If each iteration should have a new limit, use an array of limits and autoindex e.g. on a FOR loop.
  • How long is "lots of time"? You VI will stop after all operations have completed. There is no user iteraction. Why do you think "saving" is the slow part? How big is the file? Is it saved to a remote network drive? is the HD asleep?
  • Did you implement any of my suggestions yet?

 

0 Kudos
Message 10 of 11
(3,381 Views)