LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I unflatten from string to an array of strings in labwindows

New to Labwindows so please forgive.  I am trying to use STM to read messages from an existing LabView program.  I am using ClientTCPCB from the example that came with the STM library, but it reads in doubles, I want to read in strings.  I can see that I have the correct number of elements in my receive buffer, but I can't figure out how to convert the receive buffer into an array of char arrays (or strings as it were) something like labview's "unflatten from string" with 1-d array of strings as the type.

0 Kudos
Message 1 of 5
(3,536 Views)

For me STM means scanning tunneling microscope which is obviously not what you are talking about... I haven't heard from a STM library for CVI either, so may be you could better explain your problem for CVI users?

0 Kudos
Message 2 of 5
(3,522 Views)

Simple TCP Messaging see link... if you haven't heard of it, probably can't help.  Thanks anyway.

 

 

http://zone.ni.com/devzone/cda/epd/p/id/6227

0 Kudos
Message 3 of 5
(3,511 Views)

Ah, interesting, and thanks for the link!

0 Kudos
Message 4 of 5
(3,509 Views)

So I figured it out... from the lack of info on the web and forums I doubt it will be useful to anyone else, but will post a brief solution.

 

So I dumped the raw bytes to a file to look at how they are packed.  The first 4 bytes (int) is the number of strings in the message.  The next 4 bytes (int) are the number of chars that follow, then the corresponding chars, sans any null term character, then the very next int would be the number of chars in the next string and so on and so forth.  So I ended up writing my own charArrUnflatten function.  Anyway, after all this I might try to recode everything to use network vars.  Cheers.

0 Kudos
Message 5 of 5
(3,491 Views)