Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

how to plot two signals from a uart serial

Hi,

I am using a PIC microcontroller to sample temperature and humidity every minute. I want to display this data in labview. I can currently send one data stream and plot it using the visa serial block. But I want to plot both streams simultaniously, how do I do this?.

Lets say I transmit the temperature and humidity using the following structure via uart "010,050". This is for a temperature of ten degrees and 50% humidity. Is there a way I can split these in labview so I can plot both seperately?

Thanks,

0 Kudos
Message 1 of 4
(4,101 Views)

I would just use Scan From String.


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
0 Kudos
Message 2 of 4
(4,091 Views)

Hi,

Thanks for the help,

I've tried what you suggested but all I get is the error attached. I can plot one waveform on it's own but can't split the 2. The serial uart string coming in to the visa is characters of the form "123,321", I want to split and plot 123 and 321.

Thanks

Clipboard02.jpg

0 Kudos
Message 3 of 4
(4,064 Views)

Is your microcontroller sending a termination character after those two values?  A termination character is typically a Line Feed (0xA, 10).  If not, can you make it send a Line Feed at the end of the message?  That will make your life a lot easier.  You can then get rid of the Bytes At Port and just tell the VISA Read to read many characters, like 25 or 50.  I am almost certain that you are just not seeing all of the message due to a race condition caused by the Bytes At Port.


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
0 Kudos
Message 4 of 4
(4,061 Views)