Jump to content

Communication with hardware using Serial connection (RS232)


Recommended Posts

Hello All,

I am new to the Labview. I am trying to communicate my hardware using serial port connection and trying to read values by entering specific command. It would be really helpful if someone can give me a broader idea how I would can able to do that. 

Ex: if I type SNU? , in that situation I should get a response from hardware about the serial number. 

Thanks in advance,
Parth

Link to post
Share on other sites

Thank you so much it helps a lot to understand and my vi is working also now. 
I have still have small doubt about the output. 
Actually my output is reading in string and would like to convert into number. and I am having issue with that. 
Do you have any suggestion?

Output Looks like : AOM=300
I would like fetch 300 from the string!

Link to post
Share on other sites
On 1/29/2021 at 2:53 AM, Shaun07 said:

Thank you so much it helps a lot to understand and my vi is working also now. 
I have still have small doubt about the output. 
Actually my output is reading in string and would like to convert into number. and I am having issue with that. 
Do you have any suggestion?

Output Looks like : AOM=300
I would like fetch 300 from the string!

There are about 500+ ways to tackle this.

You could use a Scan from String with the format string AOM=%d. Or with the format string %d and the offset with 4 wired.

Or a little more flexible and error proof, first check for where the = sign is and use the position past that sign as input to the Scan from String above.

1323761013_LabVIEWstringscanning.png.d9638a30f0f5a6726ff162eb3fbc2d33.png

Edited by Rolf Kalbermatter
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.