キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Serial read issue

解決済み
解決策を見る

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 件の賞賛
メッセージ1/17
4,231件の閲覧回数

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

メッセージ2/17
4,218件の閲覧回数

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


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 件の賞賛
メッセージ3/17
4,216件の閲覧回数

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 件の賞賛
メッセージ4/17
4,191件の閲覧回数

The block diagram is attached.

0 件の賞賛
メッセージ5/17
4,189件の閲覧回数
解決策
トピック作成者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


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
メッセージ6/17
4,181件の閲覧回数

bd3 works fine. it receives 100 bytes and stops.

while bd1 works but byte locations are shifted.

すべてをダウンロード
0 件の賞賛
メッセージ7/17
4,179件の閲覧回数

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


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 件の賞賛
メッセージ8/17
4,173件の閲覧回数

@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 件の賞賛
メッセージ9/17
4,158件の閲覧回数

@

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 件の賞賛
メッセージ10/17
4,138件の閲覧回数