Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

project help

Status
Not open for further replies.
2 byte string, 12byte data and 2bytes of CLRF. what is CRLF or did you mean CRC?

my main proble now is how to detect the beginning of my data since i know my first two bytes before the data will not be complete?

What do you mean by save the received data is a string? is that the same as creating a number of registers to store each byte?

Or are you asking that i send all the data received straight to the PC and let it sort out the data itself? Implying that the PLC simply keeps storing the data until the line is empty then transfers it raw to the PC to process. if that's the case, i have to break up the entire data into RS232 data size then have a PC program reassemble the data.
 
2 byte string, 12byte data and 2bytes of CLRF. what is CRLF or did you mean CRC?
CRLF Carriage return Line feed,, 0dh,0ah

my main proble now is how to detect the beginning of my data since i know my first two bytes before the data will not be complete?
You detect the END of the string, that is the CRLF

What do you mean by save the received data is a string? is that the same as creating a number of registers to store each byte?
As each byte is received in the PC program, it adds the latest byte to the end of the string, when it gets CRLF its knows thats the end of the string and it will display the righthand 14 bytes of the string.

Or are you asking that i send all the data received straight to the PC and let it sort out the data itself? Implying that the PLC simply keeps storing the data until the line is empty then transfers it raw to the PC to process. if that's the case, i have to break up the entire data into RS232 data size then have a PC program reassemble the data.

hi,
The nature of the transferred data, raw or processed, is a decision you make when you are writing
the programs for the PC and the PIC,
The UART's are not bothered if the data is raw or processed.
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top