LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help parsing .csv hex values that are not byte aligned

How about a little Match Pattern (regex)-containing VI like this one. It doesn't have your "1616 0110 0177" at the beginning of every output string, but you could fix that easily. Just make sure that you have your regex and indicators written in hex form or it'll assume it's ASCII.

 

Note: Same old browser malfunction - had to change extension from vi to vix to upload.

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
Message 11 of 20
(1,338 Views)

Funny, looking at it a bit further, I get 376 bytes in each string (see modified VI attached).

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 12 of 20
(1,326 Views)

@gEEkPockets wrote:

I have attached the A.xyz & B.xyz which will need to have their extensions changed to .bin to work with the vi.


Why? Your VI (scrub.vi) does not care about extensions. It would work equally well with *.xyz.

 

Where is "the vi"? Please be more specific!

 

Looking at "scrub.vi" that you posted earlier, there are a few things quite questionable.

  • Why are you only reading the first 12.5% of the binary file?
  • Why are you using hardcoded paths for the output?
  • Why are you starting with an error handler? (That will never do anything useful!).
  • Why are you doing the refnum to path twice in a row? (once is enough!).
  • ...
Message 13 of 20
(1,322 Views)

Ugh - I have 2011 so I can't open your vi. 

0 Kudos
Message 14 of 20
(1,298 Views)

Altenbach,

Answers to your questions are mainly because I am a newbie.  I did fix the reading only 12.5% of file.  Thank you. 

I hardcoded the paths because I had scrubbed certain things out that I didn't want uploaded so hardcoding the files and paths seemed the easiest fix there.

I fixed the error handler at the beginning.

I had a lot of indicators I was using for debugging purposes (like the refnum things to indicators).

Ya - you're right about the .xyz thing.  I sort of got tunnel vision after I started working on this, and overlooked those things.  I will post my lastest vi tomorrow so I can ask some questions.  Thanks

 

0 Kudos
Message 15 of 20
(1,295 Views)

@gEEkPockets wrote:

Ugh - I have 2011 so I can't open your vi. 


Mine? You don't say...

 

But if so, here it is in LV11.

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
Message 16 of 20
(1,272 Views)

Thanks for all the help.  I forgot to update.  I figured it out.  I ended up writing a state machine and masking off data and shifting and masking off again until I found what I was looking for (x16x16) - then writing it out the way I wanted it to look.  I couldn't really post the exact .vi and data for work reasons - and it's too hard to work on "scrubbing" my actual vi to post on the forum.  I learned a lot as this was my first labview coding, so I may be using it more.  Kudos to all of you. 

0 Kudos
Message 17 of 20
(1,232 Views)

ShisKeBobby:  I wish I had seen your post. The format is in my opinion, a misapplication of what was intended, but I figured it out.  Thanks!

0 Kudos
Message 18 of 20
(1,230 Views)

Glad you got it to work. After checking through your posts, i'd probably do a Read from spreadsheet file as U8's, and convert those to boolean arrays, thus you'll have a very long boolean array with all data serialized. Then it should be easy to extract 6 bits at a time until you find your x16 to get the starting point. After that, by extracting groups of 8 you'll automatically get the data back and bit shifted.

How did you solve it?

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 19 of 20
(1,215 Views)

I forgot that I actually did create the code I talked about back then, just to make sure, and I still have the file. This example shows that the B file is 5 bits out of alignment and that the sequence starts at byte 221:

 

scrub_snip.png


___________________
Try to take over the world!
Message 20 of 20
(1,204 Views)