01-12-2011 07:35 AM
Hello,
I want to acquire data serially which is 16 bit.
Learning from the post http://forums.ni.com/t5/LabVIEW/16-bit-receive-over-rs-232/td-p/1214869/page/3
I was succeeded in joining the two eight bits. But the problem i am facing is that the two eight bits some time interchanges each other from MSB to LSB. The Block diagram Code is same as that from the above thread infact i have also plotted the data on Waveform Chart.
To simulate the behavior, i have created a program of 16 bit addition and sending the data as LSB and MSB on the serial port.
Here i am sending you the pics that may help you to identify the problem.
This is the first picture that shows the serial port properties, The graph, and the resulting string that contains LSB then MSB and than the Conversion Result i.e 16 bit output.
This graph is exactly following the Conversion result
But when the LSB and MSB are interchanged this can we viewed clearly from this. Here the incremented result is reflected on MSB in place of LSB and has disturbed the whole program
The graphical representation of the error
In such Cases it is noted that the return count does not counts correctly as shown
To check whether the error is not at the transmission end, I made another program in which I first send
1 2
3 4
5 6
7 8
9 10
And the same problem came here too. as shown below
Here you can see that I didn’t send 0 but 0 is here as the first received data. Also the data is transmitted in five cycles but received in six cycles also the return count is 1 again.
Waiting for reply
Thanks
Note:- I request you to please don't consider my another thread of Multichannel data receiving as same. They both are for different objective. Thanks
01-12-2011 10:29 AM
None of those images shows your code and none of those images show how you are transmitting the data. What are you sending to indicate either the start of data or end of data. You can't simply send two separate 8 bit packets of course. The serial read is asynchronous to your serial write so you need a start or end character (or both). You would also need to make sure that the start/end character does not appear in the data.
01-12-2011 11:00 AM