LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sensor data sorting and outputting to waveform.

I am attempting to make a VI that takes readings from an arduino sensor (this part works fine) and output them into a waveform chart that will then be exported to excel. The issue I was having was sorting the sensor values into different categories, as the output format of the arduino spits out Pressure, Temp, and humidity in that sequence. I attempted using case structures to filter the numbers and then plug them back into a waveform chart using the bundle function, however the false cases still require an input and it is causing my chart/excel file to have a bunch of zeroes in between readings. Is there a better way to filter the sensor readings so that they can be plotted and exported without the need for all the zeroes/case structures?

0 Kudos
Message 1 of 7
(3,595 Views)
An xy graph. Y is amplitude, X is time when sample was read. Datapoints don't need to be evenly spaced.

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 2 of 7
(3,575 Views)

But how can I split my incoming signal into two different sets of data to graph?

0 Kudos
Message 3 of 7
(3,556 Views)
Not able to view your code (Accessing via mobile)
If you are trying to build acquired data into an array in the true case then use shift register and wire the same array without building with new values in the false case.
----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 4 of 7
(3,546 Views)

Well I am trying to build a cluster of two different doubles (this allows me to have two plots on the waveform chart and then easily export it to excel). This is why I am stuck on the case structure because I am unable to only output a value if it is true.

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

There is no much information on your code.

 

It just configures Serial Port and Reads Current value. There is no two double values which you are planning to build.

Do you want to Display to chart only if value is grater than or equal to 900?

 

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 6 of 7
(3,522 Views)

I would say you should change your Arduino code to make this simpler.  Try sending all of your data in a tab delimited string using the PrintLn.  This way all of your data is in a single message that we can easily read on the LabVIEW side.

 

1. The PrintLn adds a Carriage Return (CR, 0x13) and a Line Feed (LF, 0xA) to the end of the string being sent.  This is what we call a Termination Character.  You are already set up to use this by default.  So all you do is tell the VISA Read to read more than the longest message you expect (I like to use 50).  The VISA Read will stop when the termination character (the LF) is read.

 

2. I say to use tab delimited data so that we can easily separate the data in the message.  So the data should look something like "data1\tdata2\tdata3" where "\t" is actually a tab, not the literal "\t".  So then we just use Spreadsheet String To Array with the tab set to be the delimiter and you will have an array with your 3 pieces of data.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 7 of 7
(3,518 Views)