LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with linear chart

Solved!
Go to solution

Hello.

 

After two days tray to solve problem, I need your help.

 

I have problem with presentation some data. Data growning aproxx. linear. I read this data from device. Sometime my .vi not successful read data and in this case my chart have sags to zero (see on picture)

 

http://prntscr.com/6yq9y2

 

How I can make chart :  if not succesfull read data use previous value to show on the graph? In this case I not have big sags to zero.

 

Pls help.

 

 

 

 

0 Kudos
Message 1 of 6
(2,870 Views)

Hi Qooler,

 

easy solution: when you don't want those zeros in your chart you shouldn't put them into the chart plot!

 

if not succesfull read data use previous value to show on the graph?

Some pseudocode:

new value := readDAQ()
IF error on reading new data THEN
  new value := old value
ENDIF
plot(new value)
old value := new value

Please attach images/VIs/files directly in the forum using the attachment button right below the message edit box. Using 3rd party websites will just lead to problems when accessing this website from behind (company) firewalls!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,856 Views)
Solution
Accepted by topic author Qooler
Another option would be to replace the 0 with NaN, this would produce a gap in the display that would communicate that a data point was missing.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 6
(2,832 Views)

Mike,

 

How I can use NaN for this simple graph. Thee random numeric plot to graph. If random number 0 use NaN? (this is same case like my problem when read data from device)

 

http://prntscr.com/6z1n74

 

 

0 Kudos
Message 4 of 6
(2,815 Views)
Solution
Accepted by topic author Qooler

Hi Qooler,

 

again: PLEASE DO NOT POST LINKS TO 3RD PARTY WEBSITES! Attach images directly in this forum!

Yours: img.png(Using AutoClenaup would be nice before posting images…)

 

Mine:check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 6
(2,806 Views)
The question is why the 0 is happening in the first place. The preferred method would be to detect that cause and use it to trigger the substitution .

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 6
(2,787 Views)