Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
5 ratings:
 4.20 out of 5     Rate this Document

Runtime Error 28: Out Of Stack Space With Serial Communication

Hardware: Serial>>RS-232>>PCI-232/16

Problem:
I have two PCI-232/16 devices in one computer. I would like to communicate to all 32 ports using Visual Basic 6 and MSComm. Why do I get Runtime Error 28: Out of Stack Space when trying to access ports greater than 16?

Solution:
When you are communicating serially to any device with Visual Basic and MSComm, the maximum COM port you can use is 16. If you set the CommPort property to be greater than 16, a "out of stack space" runtime error will be generated. When establishing a connection, you should use the MSComm.CommPort property to set the comm port for communication. MSComm, however, has a limitation on the range of COM ports that can be set. The range of values for CommPort can be any number between 1 and 16 (default is 1). For more information on basic serial communication, see the knowledge base or MSDN links below.

Related Links:
KnowledgeBase 31HBCB1P: How Do I Use Serial Communication in Visual Basic
MSDN Using Communications Control

Attachments:





Report Date: 09/06/2006
Last Updated: 09/28/2006
Document ID: 415G2L0L

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit