Shaun07 0 Posted January 28 Report Share Posted January 28 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 Quote Link to post
JKSH 82 Posted January 28 Report Share Posted January 28 Hi, and welcome! These are useful places to start: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x1jtCAA https://www.ni.com/en-us/support/documentation/supplemental/06/ni-visa-overview.html Quote Link to post
crossrulz 87 Posted January 29 Report Share Posted January 29 Shameless plug: Proper Way to Communicate Over Serial 2 Quote Link to post
Shaun07 0 Posted January 29 Author Report Share Posted January 29 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! Quote Link to post
Rolf Kalbermatter 505 Posted January 30 Report Share Posted January 30 (edited) 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. Edited January 30 by Rolf Kalbermatter Quote Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.