LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mean of mesure OR don't show 0 !

Hello,

 

I'm french so, sorry for my little english.

I have a hub who recieve 2 nodes.

I read it on Labview. Look's like that : ID;Temperature;Pressure

for exemple the node 1 who the ID is 43 :   43;25;10000

i can recieve only one by one. like this :

45;30;12000

45;26;11566

43;28;12569

45;31;15333

I put this on a database. 

Now i want to see the temperature on a graph. BUT on the same graph in red (for exemple) the temperature of the ID 43 and in white of the 45.

I parse informations and take only temperature and ID and use it in a "case" in LABVIEW like pictures. But my problem is how can i show both in the same graph without a 0... 

i'll try to explain : when ID is 43, the case return temperature for the 43 but a 0 for 45 so on the graph it's not good ... and vise versa when it's 45.

 

So 2 solutions : 

- Take the last value when it's 0. if it was 25, take 25 and not 0. but if it was a 0 before the 0, take the last value who was not a 0.

OR

- Try to wait the bundle recieve 2 data <0 before the chart read it.

 

But i don't know how to do it ...

can you help me please guys?

 

thx a lot

Download All
0 Kudos
Message 1 of 22
(3,189 Views)

Can you attach the VI of what you have so far? I think I understand your question but it's not very clear to me how the attached images are related.

Matt J | National Instruments | CLA
Message 2 of 22
(3,168 Views)

hi,

 

the data into the read buffer are like that :

ID;Temperature;Pressure

I have 2 nodes with ID 43 and 45.

when i recieve the data of the node 43 i read : 

43;XX;XXXX

 

so i parse them to have only ID and Temperature.

Then i want to put mean of 5 measure of temperature for ID 43 and 5 for 45. but how ...

is it more clear ?

sorry i don't have a higth level in english

0 Kudos
Message 3 of 22
(3,164 Views)

I'm not quite sure I understand but I think what might help you is that if you have a graph and you don't want to plot some of the numbers such as 0 you can replace the number with NaN and the graph will not show that point.  I have done this in the past and it worked well for me, I did not want to see the zero values.  

0 Kudos
Message 4 of 22
(3,163 Views)

i just creat a constant and write NaN?

or string ?

0 Kudos
Message 5 of 22
(3,158 Views)

@MichaelS78 is correct -- when you plot something, all of the data must have the same properties, which include point size, point color, line type, etc.  If you want some points with one property and other points with another property, you must plot the data twice, once with Property 1, once with Property 2.  To avoid plotting a point, replace its value with NaN (a special value that is defined for Dbls, but not for Integers, so if you are plotting integer numbers, you'll need to copy them to Dbls (safe) and using the NaN "trick" to delete the points you don't want to see.

 

Bob Schor

0 Kudos
Message 6 of 22
(3,157 Views)

i will try it on monday.

thank's a lot for help.

i will tell you if it works proprely for me 🙂

have a good weekend

0 Kudos
Message 7 of 22
(3,155 Views)
  • To take a running average of the last five points, use "mean ptbypt" with a length=5. (Code with expanded shift registers is clumsy and not scalable. Imagine the specs later require you to average the last 100 points instead 🐵
  • Bypass missing values using a case structure.
  • You have some partially unwired tunnels. Can you attach unbroken code instead?
  • What determines the loop rate? Seems to be free running as fast as the computer allows. Not good!
  • Where is the terminal of the local variable?
  • You have a colon delimited string of values, so use spreadsheet string to array with the correct datatype and delimiter to get all values at once into a 1D array (or use a single scan from string using a suitable format (e.g. %d:%d:%d, depending of the exact structure of the string).
  • Why are you parsing the string twice in parallel. Coded correctly, once is sufficient. Right? You can branch to the various indicators later.
0 Kudos
Message 8 of 22
(3,136 Views)

Hello, Thx for the help

  • Bypass missing values using a case structure.  But How ? 😕

I code something simple. (look screens)

once is the ID 43 and once id 45. (depend of the random number)

But someone tells me to put NaN in the other case to "bypasse" the 0 value : but it write "2147483647"

 

Can you give me some help to bypass please?

  • You have some partially unwired tunnels. Can you attach unbroken code instead?

Like what? what's an unbroken code?

I will use "mean ptbypt" 🙂 thx.

Download All
0 Kudos
Message 9 of 22
(3,113 Views)

I refuse to look at pictures of Block Diagrams.  You've previously been asked to post your VIs, as that saves us Time and Energy, and lets us immediately test your code.

 

Attach VIs.

 

Bob Schor

0 Kudos
Message 10 of 22
(3,102 Views)