LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

16 bit serial data communication

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.

 

undefined

 

 

 

This graph is exactly following the Conversion result

undefined

 

 

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

 

undefined

 

 

The graphical representation of the error

undefined 

 

In such Cases it is noted that the return count does not counts correctly as shown

 

undefined

 

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

 

undefined

 

 

 

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.

undefined

 

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

 

 


 

0 Kudos
Message 1 of 3
(4,486 Views)

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.

0 Kudos
Message 2 of 3
(4,463 Views)
As i wrote that i have got the idea of 16 bit communication from the thread http://forums.ni.com/t5/LabVIEW/16-bit-receive-over-rs-232/td-p/1214869/page/3
The Code of this is also the same which is as under
Spoiler
Spoiler
The Data is transmitted as two serial bits and joined at the end. Wel can you give me a more clear idea of what could be the easy technique of specifying the start bit and stop bits.
Do you think that the data starts transmitting when some character is send to it. And then two bits and transmitted. Do you think this idea can solve the problem.
0 Kudos
Message 3 of 3
(4,455 Views)