취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

Couldn't Broadcast data of 16KB to multiple clients through UDP....:(

해결 완료!
솔루션으로 이동

Hi guys...!!!

My objective is to send a 2D Array of 16x100 coming from a NI-PXI hardware (Single precision float - 4 bytes each) [Total of 6400 bytes] through UDP in broadcast mode to multiple clients.

  • I've taken the simple UDP sender and receiver program and modified the sender side by taking the input as a 2D array and converting it to a string by using Array to Spreadsheet string.vi (string length comes around 14000 bytes after converting) and padding the remaining of 16KB (16384 bytes) with a "$" sign so as to  make the string length uniform of 16KB.
  • At the receiver side, the search & split string for the "$" sign and converts to the required data using spreadsheet string to array.vi and also fixed the byte size in udp read to 16384 bytes as we already know the size.

After running the Sender code in a PC-1, I'm able to receive the data in receiver code in the same PC-1. But when i run the receiver code in a different PC-2 (PC-1 & PC-2 are ofcourse in the same network), getting an Error - 56.

 

All VIs are attached.

 

Please help me guys.

Thank you

모두 다운로드
0 포인트
1/5 메시지
2,634 조회수

Hi seshasai,

 

how does your VI behave when you start with smaller data size, less than 548 bytes?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 포인트
2/5 메시지
2,610 조회수

Hi GerdW,

Thanks for your response.

 

My program with multiple clients is running perfectly fine up to a byte size of 1472 bytes in UDP read.vi (no.of bytes setting). And stopped working with multiple clients after 1472 bytes.

 

Thank you

0 포인트
3/5 메시지
2,568 조회수
솔루션
승인자 seshasai94

Hi seshasai,

 


@seshasai94 wrote:

My program with multiple clients is running perfectly fine up to a byte size of 1472 bytes in UDP read.vi (no.of bytes setting). And stopped working with multiple clients after 1472 bytes.


So that's the limitiations of your current (local) network: don't use UDP messages with length of more than 1472 bytes!

(There's a reason the UDP function default to 548 bytes for UDP messages…)

 

When you need to send more data than fit into 1472 bytes you need to split the data into several messages.

Or you switch to TCP communication which handles most of this basic stuff on its own…

 

Btw. converting 16×100 SGL values into human-readable ASCII text is not needed for UDP communication. And it even increases the bandwidth needs as it increases the message size from 6400 bytes (16×100×4) to 16384 bytes (your arbitrary 16kB limit)…

Even the padding can be made a lot easier:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
4/5 메시지
2,563 조회수

Hi GerdW,

 

Thanks for the suggestions..:)

Cheers man..!!!

 

 

0 포인트
5/5 메시지
2,544 조회수