LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Connect RS232 with labview to read current and voltage values.

Highlighted

Hi, I am trying to connect my microcontroller kit which will measure the current and voltage. I was provided with rs232 port to connect with labview to read the voltage and current data that is measured by my controller. How to make it display both current and voltage value by acquirng the data from rs232. I tried some programming but it doesn't work or it was wrong. How to make it work ?

0 Kudos
Message 1 of 4
(1,076 Views)
Highlighted

Hi bala,

 

probably your programming is simply wrong!

 

- Your while loop runs as fast as it can, so you will read either 0 or 1 byte from port. That will not give meaningful data…

- Your indicator is outside of the loop and will display only the last reading…

- You configured your port to use the TermChar. Why don't you use it later on? Read a sufficient high number of bytes to get your full message!

 

You need to know the format of the transferred data. How many bytes do you expect per message? How are the data formatted in a message?

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 2 of 4
(1,073 Views)
Highlighted

As we said in the other thread, you need to talk to whoever is designing the microcontroller and decide on a specific format for it send you the data.  Once we have that, then we can start talking about how to program this up.


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 3 of 4
(1,054 Views)
Highlighted
And a pretty common format is to send both values with a delimiter (i.e. a comma) and a termination character (i.e. a line feed) at the end. Blindly sending bytes without some identification as to what byte is what is bad design.
0 Kudos
Message 4 of 4
(1,048 Views)