• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 
April 19, 2024, 09:01:29 am

News:

SMF - Just Installed!


Setting Stopbits

Started by Fletch, October 04, 2011, 10:21:15 am

Previous topic - Next topic

Fletch

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

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

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

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

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

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

Hi thanks for your patience

It works.

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

Roman Novgorodov

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

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

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.