01-14-2008 04:28 PM
01-14-2008 04:41 PM
Try setting your string indicator to Hex display, by right clicking on it and selecting that option from the popup menu. The data comes in, and if the hex value relates to a non-printable character by way of the ASCII table, then it will look like garbage.
Then the question is how do you want to work with the values that came in? Do you want to work with the characters? do you want to convert the string characters to their equivalent as a string that displays their hex values? Most likely you want to work with the actual numerics. Use the string to byte array function to convert the string characters to a U8 numeric array. It is under the string then the conversion pallette.
If you do serial write and do a serial read of 144 bytes, you should not lose any data as long as you have a long enough timeout setting for the other device to be able to send the 144 bytes. You may want to put a slight wait statement between the two statements to allow enough time for the other device to send the 144 bytes and have them loaded into the serial buffer. Then,
01-14-2008 05:24 PM
Thanks Ravens Fan,
That did the trick, but now the data seems to somehow be scrambled:
When I use Docklight, I get this (which is correct):
81 01 03 0E 02 02 08 EB 08 00 00 00 00 00 00 FF 65 00 00 12 2A 00 00 0A 00 13 13 3B 09 39 48 00 00 00 00 00 00 00 00 03 84 94 5C 08 48 0F 02 AB FF 09 A2 0F FF 09 94 02 5E 09 A2 09 A2 0F FF 09 93 0B 5E 09 B4 00 00 7B
The "81" is a sync word that is always found at the beginning of the 72 byte sequence. When I use my VI, I get this:
0013 133B 0939 4800 0000 0000 0000 0003 8494 5C08 480F 02AB FF09 A10F FF09 9402 5C09 A209 A20F FF09 940B 5E09 B400 0067 8101 0221 0802 08EB 0800 0000 0000 00FF 6500 0012 2A00 000A
Note that some of the values may have changed btwn the 2 runs that created the data streams above, but note that the "8101" comes as the 25th word in the sequence using the LabVIEW VI.
Any ideas?
Thanks again.
01-15-2008 08:43 AM
01-15-2008 10:00 AM
01-15-2008 11:13 AM
01-15-2008 12:20 PM
01-15-2008 12:40 PM
Here I simplified the VI code, but it is still functionally the same.
And it does look like you have the character 0A in your string, so I thing that is the source of the problem.
01-15-2008 03:45 PM
12-20-2014 06:13 AM
Hi,
may be i am going on different track.But I am ryt now working with docklight only.I am facing an issue as follows:
From docklight i am sending an string 02 0B 10 1A 00 38 FF B1 10 67 03 But i am receiving it with some garbage data on my serial device as follows: 02 0B 10 1A 00 38 FF FF FF FF FF FF FF B1 10 67 03
So i am getting the extra FF in my received string which is unwanted.
02 0B 10 1A 00 38 FF "FF FF FF FF FF FF" B1 10 67 03
Please guide on this.