Problem with SPort.ocx(Read 14347 times)
Problem with SPort.ocx on: November 09, 2009, 03:56:51 PM
Dear all

Since we use Access 2003 for our Software we discovered a strange problem.

I open the Port through your ActiveX and send some data to a Printer. The printer is receiving some information, but nothing is printed.

If I open and close the Port first through API, the ActiveX is working fine.

This is the code I use for opening the Port through your ActiveX and sending the information:
Code: javascript:void(0);
Set objPort = CreateObject("SPort.SPortAx.1")

lblRetry2Open:
If objPort.IsOpened = False Then
 If objPort.Open(strComPort) = True Then
  objPort.HandShake = 8
  objPort.BaudRate = 9600
  objPort.Parity = 0
  objPort.DataBits = 8
  objPort.StopBits = 1
  objPort.FlowReplace = 1
  objPort.WriteStr (PrinterCommand)
  objPort.Close
 Else
  MsgBox "Cannot open ComPort"
 End If
Else
 objPort.Close
 GoTo lblRetry2Open
End If

We use the same Control for getting information from a scale. This one is working fine without any problems.

Do you have any idea, what the problem could occur?

Thanks a lot for your help in advance

Regards

Susanna



Re: Problem with SPort.ocx Reply #1 on: November 10, 2009, 11:38:04 AM
Dear Susanna,

We are ready to help you. I kindly ask you to be more specific. Please, let us know what value you assigned to Flow control.

There are three commonly used modes:

None: CHSh:0x1, FR:0x40
HARDWARE: CHSh:0x1A, FR:0x80
Xon/Xoff: CHSh:0x1, FR:0x43

We would recommend you to use InitString for initialization.

Please, note that if everything works fine only when you open and close the port in another application fist, then the COM port is not set up correctly.



Re: Problem with SPort.ocx Reply #2 on: November 16, 2009, 05:42:36 PM
Dear Tina

Thanks for your reply.

We tried to use the InitString Method with all 3 possible Handshakes (None, Hardware and Xon/Xoff), but nothing was working.

I did recreate the COM-Port and changed the settings to the same, as the API is going to set. But nothing change at all. ??? The printer is receiving data but not printing anything.

Attached I sent you the settings how the Port is now initialized with the InitString, using this values:

Code: javascript:void(0);
objPort.InitString ("9600,N,8,1,X")
Do you have any more points to check or try?

Thanks a lot for your help

Susanna





Re: Problem with SPort.ocx Reply #3 on: November 16, 2009, 10:01:56 PM
Susanna,
You might want to check to make sure that the port is sending raw data (including nulls) at 8 bits.  I'm confident that the printer would function requiring a number of control chars, some of which might be above 0x7f.  If you are sending only 7 bits, the high bit will never follow correctly.
Steve



Re: Problem with SPort.ocx Reply #4 on: November 17, 2009, 11:31:01 AM
Dear Susanna,

Would you be so kind to test whether our compiled example works fine with your printer?



Re: Problem with SPort.ocx Reply #5 on: November 18, 2009, 11:43:20 AM
Hi Tina

Would you be so kind to test whether our compiled example works fine with your printer?
Where can I find this example you're writing about?

I tried several things with changing the parameters, but it's all the same. I open the port (that works) and send the data to the printer (the printer receives something but doesn't print).

Thanks a lot for your help

Susanna



Re: Problem with SPort.ocx Reply #6 on: November 19, 2009, 08:33:41 AM
Dear Susanna,

Please, find the compiled examples in the Program folder -> Examples.

Otherwise, please go to Start -> All Programs -> Eltima Software -> Serial Port ActiveX Control -> Development Samples.



Re: Problem with SPort.ocx Reply #7 on: December 31, 2011, 09:26:47 PM
Happy New Year!!!!!



 

Sitemap 1 2 3 4 5