sydney Posted April 13, 2010 Report Share Posted April 13, 2010 I have UDP data packets based on a cluster containing 2 I32s and 5 SGL values: call this cluster type X. The data packet itself is an array of 16 elements where each element is composed of 2 I32 values, followed by 4 separate clusters of type X, and this is followed by an array of 12 elements of the type X cluster. So this total packet size is 7296 bytes. I have previously worked with data packets containing an array of 32 SGLs or DBLs and used the unflatten VI to recover the array as well as reconstruct data packets consisting of data for a simple, non-nested cluster. I tried making a template of the data that I wanted to retrieve from the data packet, but that does not seem to work at all because of the complexity of the data in the packet. Anyone have an ideas how to parse out this data? Quote Link to comment
jdunham Posted April 13, 2010 Report Share Posted April 13, 2010 I have UDP data packets based on a cluster containing 2 I32s and 5 SGL values: call this cluster type X. The data packet itself is an array of 16 elements where each element is composed of 2 I32 values, followed by 4 separate clusters of type X, and this is followed by an array of 12 elements of the type X cluster. So this total packet size is 7296 bytes. I have previously worked with data packets containing an array of 32 SGLs or DBLs and used the unflatten VI to recover the array as well as reconstruct data packets consisting of data for a simple, non-nested cluster. I tried making a template of the data that I wanted to retrieve from the data packet, but that does not seem to work at all because of the complexity of the data in the packet. Anyone have an ideas how to parse out this data? The flatten and unflatten functions should be able to handle any data type. You should be able to make this packet into a typedef cluster and use it to flatten data for sending over UDP and unflattening data received from UDP. Maybe if you post some code or diagram screenshots we could see where you are going astray. Quote Link to comment
Phillip Brooks Posted April 14, 2010 Report Share Posted April 14, 2010 I have UDP data packets based on a cluster containing 2 I32s and 5 SGL values: call this cluster type X. The data packet itself is an array of 16 elements where each element is composed of 2 I32 values, followed by 4 separate clusters of type X, and this is followed by an array of 12 elements of the type X cluster. So this total packet size is 7296 bytes. I have previously worked with data packets containing an array of 32 SGLs or DBLs and used the unflatten VI to recover the array as well as reconstruct data packets consisting of data for a simple, non-nested cluster. I tried making a template of the data that I wanted to retrieve from the data packet, but that does not seem to work at all because of the complexity of the data in the packet. Anyone have an ideas how to parse out this data? What is the source of your UDP data? Is it a LabVIEW application, or a custom device? Quote Link to comment
Rolf Kalbermatter Posted April 15, 2010 Report Share Posted April 15, 2010 What is the source of your UDP data? Is it a LabVIEW application, or a custom device? Good observation. If it is not LabVIEW the arrays will throw a wrench into the wheels. LabVIEW expects for any array in a bytestream an int32 telling it how many elements will follow. For creating a fixed size array you have to resort to a cluster of that type with as many cluster elements as you want to have fixed size array elements. Quote Link to comment
sydney Posted April 30, 2010 Author Report Share Posted April 30, 2010 I discovered a nice little string function where the byte stream is converted to byte values which made comparing WireShark's values and what flatten to string and unflatten to string were really doing behind the scene gave me all the information that I needed to do the parsing using these flattened and unflatten functions correctly. Incidentally, I am using both tcpip and udp messages to communicate with embedded software done using WindRiver so I am not talking to any NI hardware at all, but I am providing the GUIs needed to run the remote microcontroller using these protocols to control the data acquisition and processing at the other end of the system. Thanks for the comments. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.