07-18-2019 02:01 AM - edited 07-18-2019 02:10 AM
Hi, I'm trying to read data on RS422, but having issue with the reception.
The DUT sends 36bytes every 2ms and i'm trying to receive this data inside labview. the complete bunch (of 36 bytes) is sent in approx 800 microseconds.
when I'm using serial read inside while loop, the received data bytes are randomly shifted.
when i read 100 or more bunches at a time (without using while loop), then everything is received ok.
What could be the issue. Please suggest solutions.
regards,
Solved! Go to Solution.
07-18-2019 02:18 AM
Sound like it could be a misconfiguration of the serial port. Wrong Nr. of stop bits, or parity bit maybe?
07-18-2019 02:18 AM
07-18-2019 04:32 AM
The configuration seems to be ok i.e., data bits=8, start bit= stop bit =1, parity =nil.
Also, if the config is not ok, then the version with no while loop will also not work.
07-18-2019 04:33 AM
The block diagram is attached.
07-18-2019 04:43 AM - edited 07-18-2019 04:45 AM
Hi jpparmar,
are you reading "binary" data from your device - or formatted ASCII?
Mabye the TermChar crushes your messages!?
Notes:
07-18-2019 04:44 AM
bd3 works fine. it receives 100 bytes and stops.
while bd1 works but byte locations are shifted.
07-18-2019 04:52 AM - edited 07-18-2019 04:52 AM
07-18-2019 05:07 AM
@jpparmar wrote:
The configuration seems to be ok i.e., data bits=8, start bit= stop bit =1, parity =nil.
Also, if the config is not ok, then the version with no while loop will also not work.
Not per se.
If handshaking is done after a message, what is consisting a message will make a difference. I'm not sure if it can actually happen, but I wouldn't rule out the configuration.
If you are communicating binary data, the configuration of termination characters is definitely wrong.
07-18-2019 05:50 AM - edited 07-18-2019 05:52 AM
@ GerdW
The data is binary.
I made a mistake. I am receiving 3600 bytes not 100. The version without while loop is working fine as required.