LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

word array to string

Hello to all,
 
Is there a method to convert a word array to string similar to the Byte array to string function?
 
 
Thanks-N-Advance
FD
0 Kudos
Message 1 of 10
(14,479 Views)

Dont think so...but you could break the word into bytes to use that function then concatenate the strings...assuming the word is in byte order, otherwise I think you'd have to force it in some manner anywasy since a character is a byte...

________________________________________________________

Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
________________________________________________________
0 Kudos
Message 2 of 10
(14,474 Views)
You don't really need a new function, since a simple Type Cast will do the trick:




Message Edited by smercurio_fc on 04-25-2008 12:50 PM
Message 3 of 10
(14,450 Views)

smercurio,

 

I tried doing that with no success.

BTW how do you attach an image to a post?

 

Thanks

FredTest

0 Kudos
Message 4 of 10
(14,368 Views)

Try again Fred, and look at the value you have in your word x4CD3 when it should be x4C3D.

 

________________________________________________________

Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
________________________________________________________
0 Kudos
Message 5 of 10
(14,353 Views)
The red dot on the Byte Array to String function tells me that there datatype coercion going on. You need to set the datatype of the array elements to U8. They're probably set to the default of I32. Note: This is just for the upper array. The other array should obviously be U16.

To attach an image to the post:
  1. Get the image. I use Code Capture Tool.
  2. Paste the path to the file in the textbox in the "Attachment" section that appears below the message creation box.
  3. Submit the post. (Note: If you preview the post, the attachment gets lost and you'll need to specify it again.)
If you then want to insert the image in the body of the post:
  1. Go over to the "Options" menu that appears on the right just above the message body. This is a dropdown menu. Select "Edit".
  2. When you get the edit screen you'll see the URL for your image, as it's been uploaded to the NI servers.
  3. Right-click on the URL and select "copy link" (or something to that effect, depending on your browser).
  4. Where you want to embed the picture click on the "Insert an image" button (yellow square with a mountain) in the toolbar right above the message entry area.
  5. Paste in the URL.
  6. Re-submit the post.


Message Edited by smercurio_fc on 05-07-2008 02:40 PM
Message 6 of 10
(14,347 Views)

@TWGomez wrote:

Try again Fred, and look at the value you have in your word x4CD3 when it should be x4C3D.


That won't fix it. The problem is with the datatype of the array elements, as I indicated in my response.
Message 7 of 10
(14,338 Views)
All you need is a typecast (unless you have issues with byte order).
 


Message Edited by altenbach on 05-07-2008 12:52 PM
Message 8 of 10
(14,331 Views)


altenbach wrote:
... (unless you have issues with byte order).

If you want little endian, use "flatten to string" as follows:

 


Message Edited by altenbach on 05-07-2008 12:56 PM
Message 9 of 10
(14,324 Views)
altenbach said

All you need is a typecast (unless you have issues with byte order).
Quite true. I was just showing how the typecast would give you the same U8 array that the user was initially trying with the Byte Array to String function.


Message Edited by smercurio_fc on 05-07-2008 03:01 PM
Message 10 of 10
(14,317 Views)