LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Removal of a null character from hexadecimal text string

Hi
 
I have already raised this in part in a previous post but am posting as a new thread because I don't think I described the problem in sufficient detail. 
 
I am reading data as hexadecimal text strings across a serial link.  Unfortunately every 11th word appears to contain a null character on the front (I have been informed by the guy that wrote the FPGA code that this is 0x00).  Labview doesn't read this null character as 0x00 though - it just puts a space on the front of the next word word which, messes things up because when I put that hexadecimal word through the hex text to decimal number conversion function the word is returned as zero, so I lose some of my data.
 
I can't seem to get rid of this null character.  I have tried the search and replace string function and remove white space.vi but they don't pick this null character up.  Maybe I am not representing this null character correctly?
 
Help would be much appreciated if anybody has any ideas.
 
Many Thanks
 
Ashley
0 Kudos
Message 1 of 9
(8,536 Views)
Could you post an example string ?
Chilly Charly    (aka CC)
0 Kudos
Message 2 of 9
(8,526 Views)


@Ashley.w wrote:
[...]
 Labview doesn't read this null character as 0x00 though - it just puts a space on the front of the next word word which, messes things up because when I put that hexadecimal word through the hex text to decimal number conversion function the word is returned as zero, so I lose some of my data.

[...]


still not clear to me how your read string looks like. If your string looks like:

'1234567890\0012345'  as a string indicator set to \-display  or

'3132 3334 3536 3738 3940 0031 3233 3435'  same in HEX display

Labview is reading correctly Smiley Happy
All you need is a filter: read each single character (VISA read with lenght 1) and case string equals \00 discard the value
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 3 of 9
(8,522 Views)
Hi Thanks for the replys
 
I have attached my Labview code and also a snap-shot of the front panel after I have run the code.
 
The two arrays of interset are the hexadecimal text array and decimal number array.
 
What you will see is that every 10th word in the hexadecimal text array contains a null character on the front.  i.e. F1AC has a blank space on the front (you will have to look very carefully for this because it is not obvious).   Now when you look at the decimal text array you will see that this hexadecimal text with the blank space on front is returned as a zero.  I need therefore to remove this blank space but can't for the life of me seem to do it.
 
Many thanks
 
Ashley
 
 
 
0 Kudos
Message 4 of 9
(8,510 Views)
Sorry need to attach vi as a seperate attachment.
0 Kudos
Message 5 of 9
(8,509 Views)
simply added a filter
 
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 6 of 9
(8,492 Views)
No way to tell what char should be removed from your vi and screenshot.
Can you run the attached simplified vi, and post the received string ?
Chilly Charly    (aka CC)
0 Kudos
Message 7 of 9
(8,487 Views)

Filter worked!

Many thanks

I knew there had to a be a simple solution!

This will be my last post before Christmas as I am off on holiday. So Chilly Carley, Henrick, KC and all you star Veterans out there many thanks for all your help. 

So Merry Christmas and Happy new year  to you all and I shall be back in the new year year contiuing to master the art of LabVIEW.

Best Wishes.

Ashley

 

0 Kudos
Message 8 of 9
(8,477 Views)

Thanks

0 Kudos
Message 9 of 9
(2,489 Views)