09-08-2009 04:50 PM
I hope you'll forgive the newbie question, but my education is in aerospace engineering and not computer science...
I have a verified specification document which tells me that in order to command a data source to begin transmitting data, I need to send it the following command via UDP:
|
1 byte 1 byte 2 bytes n bytes |
||||
|
COMMAND |
01 |
00 |
Command Code = 8016 |
Data |
Where the data field is ignored for this command.
My best understanding of this situation would be to use the Byte Array to String function on an array of U8s which looks like this:

where the network order is big endian. However, I have some functioning, inherited code which interfaces with the same data source and issues a start data command using an array which looks like this:

In classic style, the author of this code has retired and I'm the only other LabVIEW programmer. I'm not savvy enough to tell whether this array accomplishes the same task and it's my limited understanding of bytes which is causing the confustion or if this command is combined with another command or what.
Any insight, leading questions, or valuable commentary is appreciated.
Solved! Go to Solution.
09-08-2009 05:00 PM
Your figures didn't make it through. Can you try attaching them to a post directly?
In general, yes, The Byte Array to String is one function that can be used in this case.
09-08-2009 05:05 PM
Weird. The images are showing up in my browser (Firefox) I just cut and pasted them so that might be causing some issues. I don't have them saved as files (seemed silly), but this should help. The images are of two U8 arrays with elements in the following order:
First image: 1, 0, 80, 16
Second image: 1, 0, 0, 80, 0, 0, 0, 1, 0, 0, 0, A
Cheers,
Andrew
09-08-2009 05:17 PM
You can't cut and paste images. They need to be inserted by using the Insert Picture tool in the message toolbar.
As for your question: the second array is correct because the third portion of that command is the actual command code, which is a 16-bit value. This means two bytes. That's what the 0, 80 (third and fourth element in list) are. 0 is the high-order byte and 80 is the low-order byte. The data part depends on the actual command code. You'll need to check your documentation as to the command code and its data payload. Off-hand I'd say it's sending two 32-bit numbers.
09-08-2009 05:47 PM
I think I'm starting to understand how bits, bytes, and such behave with LabVIEW. Kind of confusing without a solid background in computing...
According to the documentation-when using the startup command--there is no data payload required; it is ignored by the data source. My only guess for those elements remaining after the 4th element are that they are simply placeholders so that the data source know this is a completed command or that the original programmer copied the array from one of the other commands (which required the data payload) and those are just residual values he knew were ignored and never bothered to delete. It would be in keeping with the just-get-it-done approach this programmer favored.
Thanks for the assistance. I think I can interpret the other commands for this data source now.
Cheers.