02-12-2016 01:12 AM
Hi,
I need to know how to seperate the 2 or 3 responses upon a single request, for eg:
Request: 3B 16 XX XX XX XX XX
Respoonse i am getting as : 3B16 XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
XX3B 16XX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX 3B16 XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
I want to separate these 3 response which starts from 3B 16, is there any simple way to do that beacuse i can use the offset and separate them but it will become too messy.
Thanks
Aniket
Solved! Go to Solution.
02-12-2016 04:26 AM
Assuming LabVIEW, you could use Search/Split String inside of a loop or possibly Spredsheet String To Array.
02-12-2016 04:31 AM
Ok...can you share one sample how to use it beacuse i have used this but not able to get the desired o/p.
02-12-2016 05:11 AM - edited 02-12-2016 05:11 AM
I am making some assumptions on your data. So you may need to post some examples if you need more help.

02-14-2016 10:37 PM
Thanks for sharing the screenshot.
Now i know how to proceed further.....i will try in my actual programming and will let you know about the progress.
Cheers
02-15-2016 03:08 AM
Hi,
I used your above sample in my code and instead of using 3B16 i am using 3B16 1724 & 3B16 1624, since i want these 2 frames to be only displayed in the o/p but it is not spliting the result as per the expected, suppose
3B16 1724 xxxx xxxx xxxx xxxx xxx3B 1616 24xx xxxx xxxx xxxx xxxx is the string
expected o/p should contains only below 2 frames
3B16 1724 xxxx xxxx xxxx xxxx xxxx
3B16 1624 xxxx xxxx xxxx xxxx xxxx
02-15-2016 05:32 AM - edited 02-15-2016 05:32 AM
Then just use a Search Split String

02-16-2016 04:43 AM
Hi,
Thanks for sharing the screenshot, i have to use the string subset to extract the whole frame based on the length.
3B16 1724 xxxx xxxx xxxx xxxx xxxx xxxx
3B16 1D24 xxxx xxxx xxxx xxxx xxxx xxxx
3B16 3B22 xxxx xxxx xxxx xxxx xxxx xxxx
In all the frame the 6th byte position and the Bit position from 0to2 need to compare to some values suppose 2or3 and based on that output me that whole frame which is single string like 3B16 1724 xxxx xxxx xxxx xxxx xxxx xxxx.
Thanks for your patience
02-16-2016 05:04 AM
Use String To Byte Array to get an array of bytes. Then Index Array to extract the exact byte you need to do the comparison with. If you only want to compare specific bits, then AND the byte with a value that will make all of the bits you don't care about 0 and preserve the bits you do care about.
02-17-2016 10:42 PM
Thanks, got what i was looking for 🙂
Cheers