Author Topic: Setting Stopbits  (Read 1291 times)

Fletch

  • Newbie
  • *
  • Posts: 29
    • View Profile
Setting Stopbits
« on: October 04, 2011, 01:21:15 pm »
Hi

Silly question.  How do I set the stopbits in code

nrComm1.Stopbits := sbOne

Gives error "unidentified identifier sbOne"

Also one of the devices I need to connect to uses 0 (no stop bit) how can I do this? No option for 0 stopbits

Thanks

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Setting Stopbits
« Reply #1 on: October 04, 2011, 04:07:47 pm »
Hello

The TStopBits is declared in "nrcomm" unit.
If can not resolve this error please upload here full source code of project, we will check.

About 0 stop bits.
Your wish is very funny :-).
It is impossible for RS232 interface at all.

Roman Novgorodov
DeepSoftware LLC
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

Fletch

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Setting Stopbits
« Reply #2 on: October 05, 2011, 06:53:47 am »
Hi

I just need help with my syntacs to set the stopbit, I dont think it is anything wrong with the your source.


With regards to the "no stop bit".  I am currently using Async pro which works fine, but the support is not so good, that is why I am testing your product.  Async pro can accommodate no stop bit.  See my code below:

Port1.Baud := 9600;
Port1.DataBits := 8;
Port1.StopBits := 0;
Port1.Parity := pNone;

This is an unusual setting but it definitely exists.  It is used when connecting to a fuel dispenser.  This is a show stopper for me.  I would like to change to your product, but I cannot unless your product allows for no stopbit

Thanks


Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Setting Stopbits
« Reply #3 on: October 05, 2011, 07:02:41 am »
Hello

Port1.StopBits := 0;

It is not number of stop bits. You can try to assign 1.5 value to this property.
It is zero base index of enum "ONE", "ONEandHALF", "TWO"
So Port1.StopBits := 0; is equal nrComm1.StopBits := spOne;

Roman Novgorodov
DeepSoftware LLC
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

Fletch

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Setting Stopbits
« Reply #4 on: October 05, 2011, 09:08:58 am »
The protocol is based on a older non uart comms. :-[

It would appear that Async pro is in fact using 1 stopbit and ignoring the frame errors.
 
I will have to test yours and see how it handles the comms

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Setting Stopbits
« Reply #5 on: October 05, 2011, 09:20:23 am »
Hello

Windows includes driver and API for access to serial com. It request at least one stop bit.
See here StopBits field:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa363214%28v=vs.85%29.aspx

Roman Novgorodov
DeepSoftware LLC
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

Fletch

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Setting Stopbits
« Reply #6 on: October 05, 2011, 09:40:04 am »
Hi thanks for your patience

It works.

Another question.  Can your RS232 component handle odd baud rates?  I need 5760 baud

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Setting Stopbits
« Reply #7 on: October 05, 2011, 10:10:44 am »
Hello

You can try.
nrComm allows assign any integer value.
We can not test on our side because USB2Serial adapter knows nothing about such magic.

By the way possible you mean 57600 ? It is normal baud rate for RS232 and it works fine.

Roman Novgorodov
DeepSoftware LLC
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

Fletch

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Setting Stopbits
« Reply #8 on: October 05, 2011, 11:13:09 am »
Hi

No it is definitely 5760.  Actually the device runs at 5787 but 5760 is the closest the uart can get to it.

Thanks again for your help I will be buying your component :)

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Setting Stopbits
« Reply #9 on: October 05, 2011, 11:15:56 am »
Hello

Please do not hurry to buy license.
Your tasks are very non standard and I afraid nrComm can not help you.
Please check all before purchasing license.

Roman Novgorodov
DeepSoftware LLC
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.