LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

join number

I used the join numbers function as below:

1.JPG

It works well at most time, but some times I got an incorrect data. Such as: The data from visa is 01, 02, 03, 04.....and I should get 0102,0304; but I got 0102, 0403 sometimes.

I don't know if it is because the visa or somehting elsa.

0 Kudos
Message 1 of 7
(4,006 Views)
You aren't using a termination character or anything else to synchronize the receiver to whatever is doing the transmitting. It's the fault of the transmitter if its just randomly spitting out nonsense. What sort of instrument do you have with such poorly written code?
0 Kudos
Message 2 of 7
(3,990 Views)

I'm not sure what you mean by "transmitter" or "synchronize the receiver"? The "vi" just get data from MSP430 by uart. And I think it doesn't need termination character.

More, I'm new to labview. If the code is so poor would you mind tell me how to do it better, thanks a lot.

0 Kudos
Message 3 of 7
(3,949 Views)

Altenbach is saying that if the bytes are out of order, then it has to be occurring within whatever device is sending the data  (the "transmitter").

 

LabVIEW isn't going to swap bytes in the data stream on its own.  The poor code he is referring to is whatever code is in the device since it seems like it is the one swapping bytes around arbitrarily.

0 Kudos
Message 4 of 7
(3,944 Views)
The read will start at some arbitrary point. You have no idea whether it receives the first or second byte when it starts. That will make the join you are doing meaningless. Since it sounds like you wrote the micro code, you need to write it correctly. One way is to join the bytes in the micro and send it as text. Another easy is to prepend a start byte that will not be a valid value and the receiver will search for that, strip it, and then read/join. The first method makes it simple for the receiver but requires more bytes to send a value. The second requires more elaborate code of the receiver. Your choice. Study how actual instruments do this instead of throwing some random protocol or there and hoping it will work. It has nothing at all to do with LabVIEW or VISA. It has everything to do with serial communication basics.
0 Kudos
Message 5 of 7
(3,922 Views)

Sorry Dennis.  I should have said your name.  I saw the shield, and I think I recently saw Christian's name in another post and his name was still in my mind.

0 Kudos
Message 6 of 7
(3,914 Views)
No problem. 🙂
0 Kudos
Message 7 of 7
(3,906 Views)