Home > Back-end >  C buiider serial port communication
C buiider serial port communication

Time:09-21

RS232 turn with interface into USB, written in c + + builder when a machine code is there a difference? Novice to seek help from god

CodePudding user response:

No difference, you when the 232 local accessories line is your computer

CodePudding user response:

Driver will simulate a port, for this port, speaking, reading and writing,

CodePudding user response:

Most current turn usb serial port equipment, after the computer directly displayed as a serial port equipment, direct manipulation, note that some devices may not be displayed a serial port, can change the display of good,

CodePudding user response:

Writing the code is written by USB, or by RS232 write

CodePudding user response:

reference 4 floor songshu_jun response:
writing the code is written by USB, or by RS232 write

Don't ignore the usb, when RS232 line directly,

CodePudding user response:

I don't have problems, compile run times wrong, this is the error report (RS232 serial port communication, open the serial port times wrong)
Project Project1. Exe raised exception class EAccessViolation with message 'Access violation at address 00401 c72 module' in the Project. The exe '. Read of address 00000218 '. Process stopped. Use Step or Run to continue.
What's the matter?
This is the wrong sentence
Temp="COM" + IntToStr (rdCOM - & gt; ItemIndex + 1);

CodePudding user response:

refer to 6th floor songshu_jun response:

it is a wrong sentenceTemp="COM" + IntToStr (rdCOM - & gt; ItemIndex + 1);


Didn't see what's wrong with this sentence, why don't you change to:
String Temp=IntToStr (rdCOM - & gt; ItemIndex + 1);
Temp="COM" + Temp;

So try complains?

CodePudding user response:

It should not be this error code? Unless you have a problem of variable definitions,

For more than some code to see see

CodePudding user response:

Not you the code error, should be an error in the code memory operations elsewhere,

CodePudding user response:

There is no difference, can have a virtual serial port on the computer, you read and write the serial port, to go,

CodePudding user response:

1, serious serial port directly with,
2, according to the error is illegal access, the solution of two kinds:
One, right click on the "my computer" and click "properties", click "advanced" in the "system properties", click "Settings" in the "performance", in the "performance options" click "data protection", click "add", choose to run the program, OK, it's that simple,
Two, what might you use serial port controls, it introduced to the variables such as "Com1", and behind the case of the string has affected the function of the reading errors caused by, or the computer itself is the serial port or the serial port has been no other software opened

CodePudding user response:

The memory conflict,

CodePudding user response:

RS232 turn with interface into USB
What you have to look at with that agreement, if only the virtual serial port is simple, it is best to know use conversion chip,
Or check the hardware inside have a virtual serial port, or more USB devices,
If not through the virtual serial port, USB interface to operate,
Now 232 turn USB chip generally use Silicon Laboratories company CP2102 series, or a Prolific companies such as PL2303,
CP2102 can use a serial port directly read or use the company's DLL USB operation, a routine,
PL2303 is implemented through the virtual serial port, direct manipulation a serial port is ok,
  • Related