{"id":1519,"date":"2007-05-29T22:14:52","date_gmt":"2007-05-30T01:14:52","guid":{"rendered":"http:\/\/www.hoogervorst.ca\/arthur\/?p=1519"},"modified":"2007-10-06T09:34:35","modified_gmt":"2007-10-06T12:34:35","slug":"that-serialport-stuff","status":"publish","type":"post","link":"http:\/\/www.hoogervorst.ca\/arthur\/?p=1519","title":{"rendered":"That, SerialPort stuff"},"content":{"rendered":"<p><span class=\"dropcap\">T<\/span>he log files reveal that a lot of people are looking for help using the Serialport component of the .Net Framework. Once again, lets summarize:\n<\/p>\n<ul>\n<li>There are two ways to access data from a serialport:<br \/>\n1. Using the DataReceived event (non-blocking)<br \/>\n2. Using (individual) ReadLine statements in your code (blocking)<br \/>\nFor a more detailed description, I mentioned the difference in a different <a href=\"http:\/\/www.hoogervorst.ca\/arthur\/?p=1497\">posting<\/a>. Which method you&#8217;re going to use depends on how or when data becomes available to you and <em>where<\/em> you want that data to appear in your application. If your GUI needs to be updated frequently, use non-blocking. Note that you can mix ReadLine statements in your DataReceived events, but most likely <em>you will need to clear your serial port buffers<\/em> before closing off the program.<\/li>\n<li>Know the difference between the various way of reading data (Read, ReadLine and ReadExisting). Experiment with them.\n<\/li>\n<li>If you need to read a certain amount of bytes, check into the <em>BytesToRead<\/em> property.\n<\/li>\n<li>If you&#8217;re going to use blocking methods, make sure to adjust both read and write timeouts appropriately.\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The log files reveal that a lot of people are looking for help using the Serialport component of the .Net Framework. Once again, lets summarize: There are two ways to access data from a serialport: 1. Using the DataReceived event &hellip; <a href=\"http:\/\/www.hoogervorst.ca\/arthur\/?p=1519\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[88,152],"_links":{"self":[{"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/posts\/1519"}],"collection":[{"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1519"}],"version-history":[{"count":0,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/posts\/1519\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1519"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1519"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1519"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}