08-30-2008 07:26 AM
Altenbach,
My problem was i could only transmit 8 bits through my usb controller.So i will be sending 30,00,000 of data and i need to convert this back to 15,00,000 of 16bit data and i will convert this back to an image.
Thanx a ton for the suggestion altenbach.You are right i am not very conversant with data types. Sure will take up your suggestion.
08-30-2008 07:28 AM
08-30-2008 07:57 AM - edited 08-30-2008 07:58 AM
Hi altenbach,
I am getting this
08-30-2008 07:59 AM - edited 08-30-2008 08:00 AM
My expected output is this altenbach. I think i misunderstood your suggestion.
08-30-2008 11:32 AM
muks wrote:
Just a little info altenbach.The inplace function u see was suggested by you again.Thanx once again
You lost me here. I don't see any "inplace" function in any of your code, so what exactly do you mean by your statement?
muks wrote:I am getting this
![]()
You really have a serious problem with even the simplest code. 😮
Of course you will get a different result if you wire up a completely different program than what I suggested!!!
08-30-2008 12:04 PM - edited 08-30-2008 12:07 PM
muks wrote:My expected output is this altenbach. I think i misunderstood your suggestion.
![]()
NOOOOO!!!!!
This is NOT how you join 8 bit values to form 16 bit values! This is total garbage! 😮
Remember that 8 bit values are as follows (displaying all 8 bits)
00000001 (1)
00000010 (2)
00000011 (3)
00000100 (4)
So, after joining in the correct byte order, we get two 16 bit values:
0000001000000001 (513)
0000010000000011 (1027)
The way you are joining the values is completely meaningless and ambiguous, because there is no way to reconstruct the original data from the result. With your method, a result of 10011 could have come from e.g. [0:10011], [100:11], [1001:1], etc. with equal probability.
Attached is a quick draft, see if you agree with my results! 🙂
08-31-2008 08:33 PM - edited 08-31-2008 08:33 PM
Just for completeness, here's another very simple alternative. 🙂
09-01-2008 12:01 AM
The way you are joining the values is completely meaningless and ambiguous, because there is no way to reconstruct the original data from the result. With your method, a result of 10011 could have come from e.g. [0:10011], [100:11], [1001:1], etc. with equal probability.
Attached is a quick draft, see if you agree with my results!
Thanx for pointing that ou.I totally agree. The inplace function i mentioned was used inside the while loop of serial communication.
09-01-2008 02:14 AM - edited 09-01-2008 02:15 AM
muks wrote:The inplace function i mentioned was used inside the while loop of serial communication.
There is no inplace function, but you can do certain operations "in place", e.g. using shift regsiters and replace operations. Still you need to initialize the array with the correct representation, U8 in this case.
LabVIEW 8.5 and higher has the "in place element structure" (see image), it can be useful sometimes. I first thought you were talking about this. 😉