06-29-2022 07:52 AM
hello everyone,
Can i select the particular data after visa read and mask other output data?
Solved! Go to Solution.
06-29-2022 08:12 AM
Hi jeet,
@jeet4230 wrote:
Can i select the particular data after visa read and mask other output data?
Yes.
(This usually is called "parsing". You need to apply the rules given in the manual of your device.)
06-29-2022 08:51 AM - edited 06-29-2022 08:52 AM
hello thank you for quick reply.
As attached in the image i want to neglect 1A and OK from this output data and want to select only the 042D. how is is possible.??
06-29-2022 08:55 AM
Hi jeet,
@jeet4230 wrote:
As attached in the image i want to neglect 1A and OK from this output data and want to select only the 042D. how is is possible.??
Use ScanFromString with a formatstring of %2s%4s and use the 2nd output.
When the desired part is a hex-formatted number you can also use %2s%04x instead…
06-29-2022 09:10 AM - edited 06-29-2022 09:10 AM
I did not get you actually. can you explain in detail if possible. or with example
Thank you
06-29-2022 09:21 AM - edited 06-29-2022 09:23 AM
Hi jeet,
@jeet4230 wrote:
I did not get you actually.
When you don't know how to use ScanFromString function you should take the LabVIEW basics/tutorials offered at the top of the LabVIEW board…
Use ScanFromString with a proper format string:
06-29-2022 09:40 AM - edited 06-29-2022 09:45 AM
Thanks. i will go through scan function. Moreover As this function is for scan. my sensors values are going to change. this will applicable for every hex value which is going to change? i want to neglect 2 LSB's in hex output and all the raw data such "ok" .
Looking forward for help.
thank you
06-29-2022 09:51 AM
Hi jeet,
@jeet4230 wrote:
As this function is for scan. my sensors values are going to change. this will applicable for every hex value which is going to change?
As long as the format stays constant the ScanFromString will correctly parse your string.
That's the point of a "fixed format"…
@jeet4230 wrote:
i want to neglect 2 LSB's in hex output and all the raw data such "ok" .
What are "2LSBs in hex output"? I only know of LeastSignificantBits in bytes/words…
What is "least significant" in your string of chars?
The "ok" (or "OK" in your image) is already omitted in my example, it should appear in the "remaining string" output of SfS…
06-29-2022 10:01 AM - edited 06-29-2022 10:13 AM
Im attaching the new image in here. So in this i want to remove all the data such as A -trans -crc b800, 1A(in hex number), Ok, SIC-CLI. overall all i just want to select 042B in the the whole image. and olny 042B will change after every sensor output others will remain same. do you have any idea how to do it?
:here LSB are 1A
Thank you for helping me out
06-29-2022 10:11 AM - edited 06-29-2022 10:13 AM
Hi jeet,
@jeet4230 wrote:
So in this i want to remove all the data such as A -trans -crc b800, 1A(in hex number), Ok, SIC-CLI. overall all i just want to select 042B in the the whole image. and 1A042B will change after every sensor output others will reamin same. do you have any idea how to do it?
What is the communication protocol with your device?
When does it send those data?
Is there some trigger/request for each of those lines?
Does the line of interest ALWAYS start with "1A"? In case it does not: is there a better format description for those two bytes?
You really need to learn to supply all the information needed to answer your questions!
Now you completely changed the problem from a fixed format string to a completely different kind of string…
You already got the very same question in your other thread: Please supply a full specification of your communication protocol!
Why does your µC answer with such a lot of garbage when you just request some data?