LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Breaking Specific Bits/Bytes off Hexadecimal LIN Signal

Hello All,

 

I am currently working on implementing a LIN-Analog Converter in Labview, and in order to do so I must break off a specific set of bits and convert these to decimal format.  The VI currently breaks off the first 8 bits and converts them to decimal, however I am a bit confused on how to modify this for my present needs.  I need to break off the "3rd and 4th byte pairs" (i.e. bits 17-32).  This point may be illustrated more clearly in the attachment entitled "Bits of Interest".  Furthermore, my current VI is attached to this message.  Any assistance would be greatly appreciated!

 

Regards,

 

Colin

Download All
0 Kudos
Message 1 of 4
(2,380 Views)

In your case, you only care about specific bytes.  This makes like really easy.  Here are two possible solutions for this.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 4
(2,376 Views)

Crossrulz,

 

Thank you very much for the speedy response.  Unfortunately I am having some issues with taking the CAN/LIN signal and converting it to a byte array w/ the method shown.  I have attached a screengrab of the error message.  If I do not convert the raw signal to a byte array, I can successfully port the signal to the "Index Array" block, however the outputs then cannot port to the "Join Numbers" block.  Any assistance would be greatly appreciated.

 

Regards,

 

Colin

0 Kudos
Message 3 of 4
(2,360 Views)

Hi Colin,

 

the error message mentions a cluster, so you need to Unbundle(ByName) it's components!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(2,353 Views)