LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read continue binary string

Hi,
 
I have a encoder and it send me a continue string in ASCII. The port configuration is : 1 start bit, 7 data bits, 1 parity bit, 2 stop bits and termination character = x0D . And, the code is like this :
 
ASCII code 31 (011 0001) = SB 1000 110 PB SB SB
 
My problem is I can not cut the string at the good place.
 
Thank you for your help.
0 Kudos
Message 1 of 10
(3,880 Views)

How do you want to split the string?  Have you tried using the Match Pattern function from the String palette?

-Khalid

Message Edited by Khalid on 08-10-2005 01:30 PM

0 Kudos
Message 2 of 10
(3,870 Views)

I try to find how take the data between two termination characters. And the bit are reversed and I want put these in right sense.

Thank.

0 Kudos
Message 3 of 10
(3,863 Views)
To find the termination characters, there are a number of vi's available to use such as "Search and Replace String", "Search/Split String", or "Search and Replace Pattern" as those all return an offest number where it has found the termination character.

In order to reverse the sense (with the possibility of having 15 people find more efficient ways to do this like yesterday), use "String to Byte Array", then "Reverse 1D Array", then "Byte Array to String", and your data will be reversed.
0 Kudos
Message 4 of 10
(3,855 Views)
Thank you, but I receive always the same error : framing error. Do you know what is this ?
0 Kudos
Message 5 of 10
(3,848 Views)
Ummm it could depend on a number of things..  It would be easier to diagnose if we could see your code...  image or vi.
0 Kudos
Message 6 of 10
(3,843 Views)
I thing I have a problem with the code send by the encoder. There is in LIFO for each 4 bits and I thing that the port receive in FIFO, do you know if this can be one of my problem ?
0 Kudos
Message 7 of 10
(3,837 Views)
Where exactly -- which VI -- do you get this "framing" error?
 
-Khalid
0 Kudos
Message 8 of 10
(3,830 Views)
The framing error occur with only in VI contain Visa configure serial port plug on Visa read.
0 Kudos
Message 9 of 10
(3,822 Views)
You will want to narrow down the issue.  First make sure you are actually able to read the values into LabVIEW.  Don't worry about the format, just make sure you are reading the value without any errors. 
 
Next, take the read value and parse it out the way you want.  For this part, in fact, you can play with your own test strings. 
 
Hope this helps.
 
-Khalid
0 Kudos
Message 10 of 10
(3,807 Views)