LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to read 9th bit value

Solved!
Go to solution

Hello Folks, I was trying to read 9th bit data in 8th row and also logging in a notepad. Attaching the logic and vi. Any suggestions

Venugopal
0 Kudos
Message 1 of 17
(826 Views)

Suggestion: Save your VI for an earlier version of LV (say 2019).  Most people on this forum don't have LV 2024.

0 Kudos
Message 2 of 17
(802 Views)

Your very short message does not tell us what you are trying to do.  You also attached a VI in LabVIEW 2024, which many of the long-time LabVIEW users do not have, so cannot see what you are trying to do.  Please "Save for Previous Version" and specify LabVIEW 2019 or 2021.  If we can understand what you want to do, we can help you to learn how to do it.

 

Bob Schor

0 Kudos
Message 3 of 17
(801 Views)

Hi Bob,

 

The data which is saved in the control is a Hex data and i have the pin info at 7 th byte and i was trying to display the data in boolean array by using string to byte array. the key issue here i'm only able to read the data of 8 bits the 9th bit data is lost.

 

I'm attaching an older version VI so that everyone can have access to it.

 

Thanks for the support!

Venugopal
0 Kudos
Message 4 of 17
(737 Views)

Hi Paul,  

 

Attached older version

Venugopal
0 Kudos
Message 5 of 17
(735 Views)

Hi VenuGopal,

 


VenuGopal@57 wrote:

Hello Folks, I was trying to read 9th bit data in 8th row and also logging in a notepad. Attaching the logic and vi. Any suggestions


How do you want to access the 9th bit of an U8 8 bit entity???

 

This could be a simplified version of your code:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 17
(723 Views)

Good morning, Venu.

 

     Thank you for attaching your code in LabVIEW 2014 (I would have been happy with 2019 or 2021, as well).

     Your processing starts with an input array of strings, "Array 3".  You describe it as a Hex representation of (byte) data, with the "Pin info" at the "7th byte".

     Can you attach a "file version" of Array 3, which I presume will be a file of Ascii characters, possibly looking something like the character string you show as the output string array "Array" (starting "AA99 0005 A201 0100 94").  I'm assuming (but could be wrong) that the actual starting file had the hex characters "0x0D 0x0A" (or <carriage return><line feed>) following the "94", but if we see the actual file, we can "figure it out".

     Aha!  I was about to ask "what do you mean by the 7th byte", and I figured out the solution to the problem you are having!  [But, still, please do attach the data file I asked for, just to let us confirm my guess].

 

Your data format appears to be the following:

  • 6 bytes representing "data" meaning something to someone.
  • 2 bytes representing the "Fortran Array Position" of this entry.
  • A single byte representing "something else.

Look at the two bytes in the 4th cluster of characters.  They start 0100, go up to 8000, then go to 0001.  Consider them as two bytes, and take the "first byte" (which starts "01", goes to "08", and ends "00" and consider them as a number, from 1 to 8 to 0.  Now look at the "second byte", which stays "00" until the nineth entry, "01".

 

Add these two numbers together.  You get the sequence "1, 2, 3, ..., 8, 9".  Subtract one, and you have what you are looking for, the Byte positions 0..8 in a U16 or I16 (or U32/I32) integer.

 

This is a totally weird encoding scheme, but it seems to be what your device is sending.

 

Bob Schor

0 Kudos
Message 7 of 17
(709 Views)

Hi Bob, 

 

Good morning,

 

Currently i don't have the hardware with me. But i can explain how it works. I request data from board with a fixed command. The hardware sends me the data at VISA read i receive data in Hexa. it is only clearly visible when we use typecasting. The data in the array3 contains info of pin numbers at 7th position. i have requested hardware for 9 pin data so in the array 3 you can see the data received at serial port for 9 times. for the next iteration i might request 15, 25 upto 78.

 

VenuGopal57_1-1717422124450.png

 

Venugopal
0 Kudos
Message 8 of 17
(693 Views)

Simplified my code and attached the screenshot. In row row 8 9th pin should be 1.

VenuGopal57_0-1717422821083.png

 

Venugopal
0 Kudos
Message 9 of 17
(683 Views)

Do you have a manual you can link to or something that explains the communication protocol your device is using?  Just eyeballing it, it looks like your device is only sending out 2 bytes, which correspond to 8 Boolean values.  There is no 9th bit.  This is where the device manual would be helpful.


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 10 of 17
(676 Views)