LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting values from a Chart Graph

Dear All,

I have a question, I would like to read two values from a chart graph.
The total measurement has a duration of 25 seconds.
I would like to see the first value after 3 seconds and the second value after 22 seconds, as in the example image I drew.
But after many experiments and attempts I have not succeeded
Can anybody help me with this?

 

Maarten

 

 

Download All
0 Kudos
Message 1 of 9
(2,419 Views)

Hi Dandy,

 

I would like to read two values from a chart graph.

There are several problems in this sentence:

  1. What is a "chart graph"? LabVIEW has charts, and it has graphs. These are two different kind of indicators…
  2. Why do you want to read "from" a graph? Typically you wire data "to" a graph - and you can analyze that data in parallel to your data display…

I would like to see the first value after 3 seconds and the second value after 22 seconds, as in the example image I drew.

When the x coordinate is fixed ("after 3s and after 22s") then all you need to do is to index the corresponding Y value to your x coordinate.

When there is a different condition/algorithm to determine those samples you need to define that algorithm before you can implement it in software!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(2,407 Views)

Hi GerdW,

 

Thank you for your answer, I mean "Waveform Chart, of course and not "Chart Graph", my mistake...
There are probably mulitple solutions possible for what I want and If indexing the corresponding Y value to the x coordinate also
works, that fine with me.
I have only no idea to do this...could you maybe show me this in a example vi?

0 Kudos
Message 3 of 9
(2,403 Views)

Hi Dandy,

 

how to read a certain Y value for a given X position from a waveform:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 9
(2,399 Views)

Thank you GerdW,

 

For you fast response, I tried to get it to work, but I don't understand
what value I have to connect to the "Get Wave Form XY" vi (see attachment)
I tried different values but it seems to samples only the last value...?

 

test1.PNG

0 Kudos
Message 5 of 9
(2,393 Views)

Hi Dandy,

 

how many samples are in your waveform? That function automatically gives the last sample, when you request for a X value larger than the timespan of that waveform…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 9
(2,385 Views)

Hi GerdW,
 
I have 2500 samples, I tried your solution in a separate test vi, and then it worked
However when I placed it into my main setup, then it only shows the last value..
I think it has maybe something to do with the core "Run Time Relative Time" vi that I'm using?
(I found this vi on the NI Forum)

test2.PNG

 

 

Download All
0 Kudos
Message 7 of 9
(2,373 Views)
  • Learn LabVIEW, especially the Principle of Data Flow.
  • Learn the major use of the Event Loop, handling changes in Front Panel controls.
  • Banish (!!) all local variables.  Learn LabVIEW, especially the use of Shift Registers to hold "local variables".
  • Remove the two "timing" features.
    • You don't need the Timeout Event if you understand how to use Value Change Events to keep the current value of Control Backward,  Control Forward, and Idle in a Shift Register.
    • Do you actually have a three-value State, Idle, Forward, or Backward?  Might an Enum represent this single quantity, with three Boolean controls changing the State?  Might make the logic cleaner (or maybe it won't ...).
    • You do not need a Timer Wait inside the DAQ loop -- the DAQ Read will have a far more accurate clock than Windows/LabVIEW (for one thing, no cycles will be "stolen" to do disk I/O, anti-virus testing, Windows update, etc.).
    • Learn LabVIEW, especially how DAQmx works.
  • It's curious how you are playing with t0 in your primary data cluster.  If you want relative time, all you need to do is to create (in your formula) your own clock, 0*dt, 1*dt, 2*dt, 3*dt, etc.
  • Data are sacred!!  Keep your data intact, and don't mess with its internal structure!

Bob Schor

0 Kudos
Message 8 of 9
(2,359 Views)

Hi Bob,

Thank you for your advices, I will certainly apply them if I see the possibility.
but I am a Labview newbee, and I fear that I am not yet at the level to fully understand all of your advices
But thanks, I appreciate your feedback!

0 Kudos
Message 9 of 9
(2,340 Views)