Please tell me the principle of rs232 communication command in detail!

char controlStatus[3] = {'?','C','\r'}; // ?C<CR>

void setup()
{
   Serial.begin(9600);

}

void loop()
{

   for(uint8_t i=0; i<3; ++i){
     Serial.write(controlStatus[i]);
   }
   
   delay(10000);

}

I just changed the code a little bit by referring to the other article.

If you code like that, will the control status be divided into 0, 1 and sent?

Also, we have ADIXEN Pump in our company, so we upload the code to Arduino in the following article, so Current can be read normally. It was so surprising. However, I do not quite understand the principle.

And now I want to code to bring in Edwards Pump's Current.

Also, I would like to know more about the principle of sending commands.

Since English is not my first language, I may not be able to speak well.

I look forward to your kind reply. Have a great day!

Re: Adixen A1803H Dry Pump Arduino Uno Rs232 Address Data reading - Using Arduino / Programming Questions - Arduino Forum

The way you've used serial.write() puts a single character out each time it is called.

You call it in a loop so it sends the three characters in the array. Every 10 seconds. Forever.

More than you need to know about the low level dets:

and something to study if you don't know all the corners of this:

Most ppl never need to bother with the 1s and 0s aspect of it and deal strictly from a higher level of abstraction. But it's wicked old cool technology worth a bit of attention nevertheless.

HTH

a7

RS-232 is strictly and electrical specification! Has NOTHING to with actual data.

1. Asynchronous transmission/reception at 5V/0V (traditionally called TTL Level) (Fig-1).
185-00
Figure-1:

2. In Fig-1, the 7-bit ASCII Code of character A (1000001) is being sent in a 10-bit frame which has Start Bit (always LOW), Character Bits (D0 - D6), D7 (always LOW), Parity Bit (optional), and Stop Bit (always HIGH).

3. TTL level signal of Fig-1 can travel up to 50 feet; after that, the signal's shape deteriorates. To overcome this problem and to allow the signal to travel up to 150 feet without using any expensive repeater/amplifier, the TTL level (5V/0V) of Fig-1 is changed to RS232 Level (-12V/+12V) (Fig-2 for character/digit 9).


Figure-2:

4. Fig-3 depicts the TTL <-----> RS232 Conversion Module.
rs232xy
Figure-3:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.