LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert cluster containing bytes into array of bits?

Solved!
Go to solution

Hi wannabe,

 

mind to downconvert them for LV2019 and upload again? (Thanks!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 11 of 18
(1,639 Views)

Hi Gerd,

 

Here are the files.

 

Warm Regards,

0 Kudos
Message 12 of 18
(1,634 Views)

Hi wannabe,

 

as soon as you avoid all those coercion dots and unneeded conversions things fall into place:

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 13 of 18
(1,623 Views)

The ending string to U8 and shenanigans should give the same result if you simply subtract 48 from the string to U8 conversion.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 14 of 18
(1,606 Views)

Hello everyone,

 

So the packet formatter works very well. I removed all the coercion dots causing all the issues.

 

I am trying now to perform packet parser. It performs in exactly opposite way to the packet formatter. I am trying to determine the presence of preamble, and if found, extract payload, SYNC word and finally packet counter. I want to read the bitstreams directly as U32 and U16 integer. The payload is read as U8 integer and then I try to convert it back to string. I displayed each byte array after the case structure and all of them read the right bits from the received bit stream. But after conversion to string/U32/U16, somehow they end up with wrong information. It is mainly because of the coercion dots, which I cannot remove in packet parser function. 

 

The screenshot is attached here.

 

packetparser.PNG

As you can see here, there are coercion dots after byte array to string conversion. Why do you think they exist? How do I remove them? Kindly let me know.

 

I have also attached the vi files for your reference. If you need any other information, let me know.

 

Warm Regards,

0 Kudos
Message 15 of 18
(1,591 Views)

@labview_wannabe wrote:

As you can see here, there are coercion dots after byte array to string conversion. Why do you think they exist? How do I remove them? Kindly let me know.

 


Any code that requires dynamic data can be greatly simplified!

There is never a need to maximize the diagram and front panel to the screen.

 

Why don't you create a simple toplevel VI that contains the formatter and parser, then wire the parser to the formatter input and see if the result is the same as the original input.

 

Message 16 of 18
(1,578 Views)
Solution
Accepted by topic author labview_wannabe

See if this can give you some ideas.

 

There are many open questions (see red text). Do you have a link to the manual?

 

altenbach_0-1660586302941.png

 

Message 17 of 18
(1,566 Views)

Hi altenbach,

 

1. the Byte order is not specified. But in my opinion it should be MS byte first based on expected sequence in the main vi file.

2. Thee 2 payload length is just used for Synchronisation and packet integrity verification. Two payload length acts as double verification. Verifies packet integrity by checking if both packet length fields are same and if the payload length are same as well. Kinda like CRC but lot simpler.

3. 0,1 not reversed. Not specified in the manual though.

 

The link to manual is lab1_ho_v0.pdf (ntu.edu.tw)

0 Kudos
Message 18 of 18
(1,535 Views)