03-23-2012 11:44 AM
Hello everyone
I am trying to convert string to byte array, append length of the string before the whole array and insert 127 between each values in array.
eg i want abcd string to be displayed as
4 (which is length of abcd)
127
97 (a)
127
98 (b)
127
99
127
100 (d)
127
the vi I designed is working only for index 0.
I dont know why it isnt working for other indices.
Any kind of help will be truly appreciated
Thanks
Sarkar
03-23-2012 12:16 PM
Would like to help but I'm not using LV2011
03-23-2012 12:17 PM
What are you actually trying to do? This formatting scheme seems a bit weird.
Drop your flat sequence structure. It's not doing anything.
Why not autoindex over your byte array and append the 127 after each?
Then insert string length and the 127 at the beginning.
03-23-2012 12:36 PM
This might help
03-23-2012 12:40 PM
Is this what you're trying to do?
03-23-2012 12:43 PM
Pardon me I am not very familiar with LV jargons. But isnt that precisely what i am doing! The vi is actually a subvi of my program. Its supposed to pass string with its length to uart through db9 connector. Its working only if i specify the input index as 0.
Thanks for replying
03-23-2012 12:46 PM
Try this:
The only issue you have here is for the length since it is limited to a sibgle byte.
03-23-2012 12:53 PM
I like Mark's solution better than mine.
What are you talking to over the UART?
I'm not sure I understand why you have to pass an index at all.
You should be able to use VISA Write to send strings to your device.
03-23-2012 12:57 PM
Yes precisely. Thanks a ton. Hey how did you get the second index wire in the insert into array function!? It will be great if you can post the vi
Sarkar
03-23-2012 12:57 PM
Type Cast Man wants in on the action.