- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have written a multithreaded serial communication application and it uses the functions outp and inp to communicate with the COM1 port. Recently I went about converting my code into calls using sport_read_line and sport_write_line instead of outp and inp. However I notice that the sport routine does not work well in a multithreaded case. As soon as I create a thread erroneous values are returned by the sport command. Do you have any pointers on how to make the sport commands function in a multithreaded case. Thanks,
-hcra
I have written a multithreaded serial communication application and it uses the functions outp and inp to communicate with the COM1 port. Recently I went about converting my code into calls using sport_read_line and sport_write_line instead of outp and inp. However I notice that the sport routine does not work well in a multithreaded case. As soon as I create a thread erroneous values are returned by the sport command. Do you have any pointers on how to make the sport commands function in a multithreaded case. Thanks,
-hcra
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
From what I see in the documentation, using the SPORT routines in a multithreaded application should work. However, the documentation does say "To help ensure that data overruns do not occur, the SPORT_xxx run-time support creates a separate thread that maintains an outstanding read to the connected port. This thread is started when any read or write operation is performed to the port using the affiliated read/write routine. As such, port parameters must not be changed after you have started reading or writing to the port. Instead, you should set up the port parameters after connecting to the port and then leave them unchanged until after the port has been released."
If you can come up with a simple example that fails, and are using CVF 6.6B. please feel free to send it to vf-support@compaq.com
Steve
If you can come up with a simple example that fails, and are using CVF 6.6B. please feel free to send it to vf-support@compaq.com
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For a complete module illustrating serial i/o in a multithreaded Win32 environment, written with Win32 API calls instead of the sport routines, please send an email request.
Paul Curtis
pcurtis@kiltel.com
Paul Curtis
pcurtis@kiltel.com
![](/skins/images/3344F5B3B76C91485ED0E980FD0CA95E/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page