Home > Software engineering >  How to set up a serial port for the 19200-8 - E - 2 such format?
How to set up a serial port for the 19200-8 - E - 2 such format?

Time:09-22

A communication control parameters of the upper and lower position machine, using SerialMonitor monitoring data serial communication process, get a serial port status is as follows:

And how can I in VB is set to 19200-8 - E - 2 this format, always can only be set to the 19200-8 - E - 1 this format, and the next bit machine communication only if a write parameters to the next bit machine error, the machine alarm, and read the hypogyny machine parameters is normal, even the whole communication process simulation of the original product or as long as a writing, speaking, reading and writing data parameters to the next bit machine error alarm, telecommunication lines, that is, sending and receiving and to three lines, there should be no other strange way to detect the original is not original, how may not be able to write to the next bit machine parameters? Are down only the format of the serial port Settings is a little different, could you tell me his - E - 19200-8, no. 2 in this format in the VB how to set out?

CodePudding user response:

Using the latest version of MSCOMM control?

CodePudding user response:

This latest version is also called "MSCOMM"? I use or 6.0, then can you tell me the item - 2 below is what mean? If search is less than the specific meaning,

CodePudding user response:

I didn't come into contact with a serial port communication, only know a little fur,

I think "- E - 19200-8, no. 2", it should be:
19200: data transmission baud rate
8: data digits
E: parity
2: stop bit two

As for VB6 serial port control can "stop bit" parameter is set to 2, I don't know,
You are used, these should clear than me, or else as "related parameters set mode" to try to know,

CodePudding user response:


Settings properties


Set and returns the baud rate, parity, data bits, stop bit parameters,

Syntax

Object. Settings [=value]

Settings attribute syntax consists of the following parts:

Part of the description
Object expression, and its value is "applied" in the list of objects,
Value string expression, the communication port Settings, as described below,


Description

When the port open, if the value is illegal, the MSComm control an error 380 (illegal) attribute values,

The Value is composed of four Settings, has the following format:

"BBBB, P, D, S"

BBBB for baud rate, P surprising parity, D digits for the data, S to stop bits, the value of the default value is:

"9600, N, 8, 1"

In the table below lists the legitimate baud rate:

Set the value

110
300
600
1200
2400
9600 (the default)
14400
19200
28800
38400
56000
128000
256000


The following table shows that legal parity value,

Set the value description
E Even (Even)
M Mark (Mark)
N the Default (the Default)
None
O Odd (Odd)
S Space (Space)


Legal bits of data values listed in the table below,

Set the value

4
5
6
7
8 (the default)


Legal stop bit values listed in the table below,

Set the value
1 (the default)
1.5
2


Data type

The String

CodePudding user response:

19200 baud rate, parity, 8 data bits, stop bits 2
Mscomm control Settings is written "19200, e, 8, 2"
  • Related