LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data saving from PIC code

Hi All

 

I'm having a problem transferring data from a PIC to LabView via RS232. I have 2 bytes of data per data point which are in binary. As the most significant byte only uses the 2 LSB's I'm running into those control charcters from ASCII. Also, I cannot successfully change the charcters transferred back to an ASCII No. to represent my data. It seems that the read vi doesn't like me transmitting a binary byte. I've tried the Type Cast VI but with no success. Broken wires due to data type mismatch. Any help would be greatly appreciated

 

 

 

hot live sex cam sites: live sex cams , nude cams , live cam girls
0 Kudos
Message 1 of 3
(1,026 Views)

Post your VI, easier to help that way.

 

Do you have a termchar enabled for your communication? Termchar with binary data could cause the packet to be read prematurely. 

0 Kudos
Message 2 of 3
(1,007 Views)

Binary data...

 

Turn OFF the Termination Character.  If a byte just happens to match the termination character, the read will stop.  This happens quite a bit with binary formatted data.

 

As far as converting your data, I prefer to use the Unflatten From String since it has an additional option to handle the Endianness of the data source.

 

Another possible issue you may have is how are you synchronizing your messages?  How do you know you have the bytes in the right order?  You will typically want some type of message frame to ensure you got the correct data.  This will involve a start character and preferably some type of checksum/CRC at the end.  You may want to check out this video for a lot more details: VIWeek 2020/Proper way to communicate over serial


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 3
(981 Views)