LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can anyone help me in Labview Program

Hello All,Iam a begginer and I have a question in finishing a task.

Here is it...

Consider some binary numbers such as.. 11010010101010001001110101010101001010....
1.Now my first task is to group it into two 11 01 00 10 10 10 10 00 10...and so on..
2.then I have to take only good pairs such as 01 and 10..
If it is 01,I have to change it as 1,and if it is 10 i have to change it as 0.the other two pairs 11 and 00 should be omitted.
please help me out.

thanks in advance
0 Kudos
Message 1 of 10
(3,890 Views)
You have to make a string subset of 2 characters. Then use a case to make the new character and append it to the new string.

Look at the VI (LV6.0.2)
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Message 2 of 10
(3,883 Views)
Thats was great.I was thinking of solutions using Boolean.Is there any other way of doing considering the input as boolean array.

Thanks
0 Kudos
Message 3 of 10
(3,864 Views)
I would process the boolean array as attached to convert it to numbers 0,1,2,3.

Then I would feed it into a for-next loop with a case statement inside. I would have a shift register with an empty array hooked up to it and add concatenate the new values to the array as each element is processed.

Are you trying to do Manchester decoding or something else?
Randall Pursley
Message 4 of 10
(3,857 Views)
This is about unbaising Random numbers.the numbers are in a boolean array.(millions of numbers)
each array has binary numbers such as.. 11010010101010001001110101010101001010....(its of Unsigned bit 32)
1.Now my first task is to group it into two 11 01 00 10 10 10 10 00 10...and so on..
2.then I have to take only good pairs such as 01 and 10..
If it is 01,I have to change it as 1,and if it is 10 i have to change it as 0.the other two pairs 11 and 00 should be omitted.
0 Kudos
Message 5 of 10
(3,842 Views)
The solution with boolean array as input and output.

You wrote that there are millions of numbers. This solution has one disadvantage. The execution time and memory needs will increase overproportional with the length of the array. The reason is that the size of the output array is not know before entering the For loop. The build array function needs to allocate new memory when new numbers are added. And the old array will be copied.

To avoid this you can use a second For loop counting the cases when a number will be used. Copy the existing For loop. Initialize the shift register with a U32 and value 0. Replace the Build Array function by a increment. Replace the Array constant with the boolean by a Build Array function. In the second For loop replace the Build Array function in the Case structre by a Replace Array element. If you have the array initialzed with FALSE you need to do this only in the case when you want it to set it to TRUE. You need to count as in the first loop to know which element in the array will be replaced.

Message Edited by waldemar.hersacher on 06-05-2005 12:11 AM

Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Download All
0 Kudos
Message 6 of 10
(3,813 Views)
Thanx..
I cannot open your examples. my version is 6.1.yours is 7.1...what can I do..
0 Kudos
Message 7 of 10
(3,786 Views)
Inorder to reduce the overusage of memory and overusage ...i think this will be better..



MK.K


Using 6.1
Don't forget to rate a good answer and/or question
0 Kudos
Message 8 of 10
(3,751 Views)
Your solution will work if you have enough memory. You are initializing the maximum number for the output array and then make a reshape. Having 2 million input numbers you need 2 million Bytes for the input, 1 million bytes for the intermediate array and 0.5 million byte for the output (if the numbers are distributeed evenly). Your solution would take 1 million extra bytes. It would be much more effecitve than using Build Array.

Attached my solution as 6.1.
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Message 9 of 10
(3,727 Views)
regarding memory its great..what would be the case if we take speed into concern..
0 Kudos
Message 10 of 10
(3,704 Views)