From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Incrementing 'index array' row input according to bytes received

I am receiving binary data through a UDP port. I'm reading a column of a spreadsheet and I want to extract the consecutive row everytime a further 4 bytes of data is received. I will use the contents of the spreadhseet cell as a condition to format the binary data. I guess i need to count the bytes of data passed then reset the counter every time it reaches 4. Every time the counter resets the index array contant need to increment by 1...but i don't know how to do this. Can anyone help?  

 

Thanks

0 Kudos
Message 1 of 4
(2,031 Views)

You don't have to reset the count of bytes. What you can do is to divide the counter by 4, get the remainder using the Quotient & Remainder node and when that outputs zero, incrememnt the array count by 1. Post of an example of what you accomplish (make this a isolated test code) and we can help you from there.

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 2 of 4
(2,016 Views)

Hi!

 

You need a shiftregister that stores the array index value. Then just increment if you get a reset.

1.PNG 

Regards,
Even
_________________________________
Certified LabVIEW Associate Developer

Automated Test Developer
Topro AS
Norway
0 Kudos
Message 3 of 4
(2,015 Views)

I tried as you said, it seems to be partially working but there seems to be a problem with the timing. The index increments in steps of one but not quickly enough. The data type sent to the selector terminal does not seem to be in sync with the binary data as my data does not update as i expect. Any ideas how to fix this problem?

 

vi attached...

0 Kudos
Message 4 of 4
(2,003 Views)