LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial read issue

Solved!
Go to solution
Highlighted

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,

0 Kudos
Message 1 of 17
(211 Views)

Sound like it could be a misconfiguration of the serial port. Wrong Nr. of stop bits, or parity bit maybe?

Message 2 of 17
(198 Views)

Hi jpparmar,

 

probably there is a problem in your code.

As you didn't attach your code/VI you need to debug it on your own

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 3 of 17
(196 Views)

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.

0 Kudos
Message 4 of 17
(171 Views)

The block diagram is attached.

0 Kudos
Message 5 of 17
(169 Views)
Solution
Accepted by topic author jpparmar

Hi jpparmar,

 

are you reading "binary" data from your device - or formatted ASCII?

Mabye the TermChar crushes your messages!?

 

Notes:

  • Read the help for the VISASerialConfig function. The full help on all its inputs…
  • The way you read messages need to fit to the message content. Unfortunately you don't provide any information on the message format nor the device sending them…
Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

Message 6 of 17
(161 Views)

bd3 works fine. it receives 100 bytes and stops.

while bd1 works but byte locations are shifted.

0 Kudos
Message 7 of 17
(159 Views)

Hi jp,

 

bd3 works fine. it receives 100 bytes and stops.

It is working "fine" with receiving just 100 bytes even though you are requesting for 3600 bytes???

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 8 of 17
(153 Views)

@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.

0 Kudos
Message 9 of 17
(138 Views)

@

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.

0 Kudos
Message 10 of 17
(118 Views)