07-20-2010 02:19 AM
Hi all,
First let me explain setup :
I am communicating between 2 PCs through RS 232.
now my ques is :
I want to implement like, if the serial port gets the data then only read and only those many bytes which are on the seial port,
Now i am doing it, as read the serial port but if data is not there then timeout error comes.
If anyone can share some thought on it.
Regards,
Shrekt
07-20-2010 03:06 AM
Hey Shrekt,
Im a little bit confused on exactly what you are trying to do, could you attach a print screen of your code maybe?
07-20-2010 06:37 AM
I mean I want to read the port only when there is some data on the it, until then wait and check if data is there.
Regards,
Shrek
07-20-2010 07:01 AM
Simply use the VISA Bytes at Serial Port.
07-20-2010 07:12 AM
Hey Shrekt,
For what I can tell there is no particularly easy way to do this. I have found a relevant post one of my colleagues has created which might just be useful to you and help you on your way a little. The link is posted below, you may need to copy and paste it into your browser address bar. Failing that you can always go onto the ni website (ni.com) -> developer zone -> examples -> in search bar type "message bus" and it should be the first result.
http://decibel.ni.com/content/docs/DOC-12159
Hope this helps!
07-20-2010 07:42 AM
Andrew,
I don't see the relevance or the difficulty. The function I mentioned is used in the shipping examples and in in hundreds of other posted serial examples.