LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to use shift register with array of string?

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

 

0 Kudos
Message 1 of 20
(4,674 Views)

Would like to help but I'm not using LV2011

0 Kudos
Message 2 of 20
(4,661 Views)

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.

0 Kudos
Message 3 of 20
(4,660 Views)
0 Kudos
Message 4 of 20
(4,650 Views)

Snippet - Insert 127.png

 

Is this what you're trying to do?

0 Kudos
Message 5 of 20
(4,644 Views)

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

0 Kudos
Message 6 of 20
(4,642 Views)

Try this:

 

Interleave Arrays.png

 

The only issue you have here is for the length since it is limited to a sibgle byte.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 7 of 20
(4,639 Views)

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.

0 Kudos
Message 8 of 20
(4,634 Views)

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

0 Kudos
Message 9 of 20
(4,628 Views)

Type Cast Man wants in on the action.

 

JoinNumbersExample.png

Message 10 of 20
(4,627 Views)