07-20-2016 06:43 PM
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?
07-20-2016 10:10 PM
07-21-2016 09:06 AM
But how can I split my incoming signal into two different sets of data to graph?
07-21-2016 11:57 AM
07-21-2016 01:17 PM
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.
07-22-2016 02:15 AM
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?
07-22-2016 05:52 AM
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.