06-01-2024 08:26 AM
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
Solved! Go to Solution.
06-01-2024 10:26 AM
Suggestion: Save your VI for an earlier version of LV (say 2019). Most people on this forum don't have LV 2024.
06-01-2024 10:27 AM
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
06-03-2024 07:25 AM
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!
06-03-2024 07:26 AM
Hi Paul,
Attached older version
06-03-2024 07:43 AM - edited 06-03-2024 08:06 AM
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:
06-03-2024 08:15 AM - edited 06-03-2024 08:16 AM
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:
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
06-03-2024 08:44 AM
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.
06-03-2024 08:54 AM
Simplified my code and attached the screenshot. In row row 8 9th pin should be 1.
06-03-2024 09:02 AM
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.