LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to use shift register with array of string?


@chips wrote:

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



@chips wrote:

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


He posted a VI snippet as did Darin and I. You should be able to click on the snippet and open it directly in LabVIEW. Firefox has issues with snippets but Explorer should work fine.



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
0 Kudos
Message 11 of 20
(1,140 Views)

I am building an input interface for user with lots of inputs(strings, boolean, numeric). So i have converted all to an array of bytes. I am using VISA functions to communicate with fpga via uart and thus i need to include 127(= 0111 1111) for start and stop bits for UART to recognize my data bytes. 

 

The input index is the index where the strings begin in the array

0 Kudos
Message 12 of 20
(1,136 Views)

@chips wrote:

I am building an input interface for user with lots of inputs(strings, boolean, numeric). So i have converted all to an array of bytes. I am using VISA functions to communicate with fpga via uart and thus i need to include 127(= 0111 1111) for start and stop bits for UART to recognize my data bytes. 

 

The input index is the index where the strings begin in the array


It is very unclear what you are trying to do with the index. I think you need to post a good example of what exactly you mean and how you want to use it. There is no need for an index of any kind in the example you included in the first post. I suspect though that both Darin's and my solution would work equally as well on a particial string simply by adding an array subset before our code.



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
0 Kudos
Message 13 of 20
(1,131 Views)

Hi all. Thanks for your reply.

 

Mark, I have attached the vi. I intend to accept n number of msgs with n number of OIDs from the listbox. And to get the required format for parsing, I need to append OID_1 lenmsg_1 msg_1 OID_2 .... lenmsg_n msg_n

I am getting the final appended array as       OID_1 lenmsg_1 msg_1 lenmsg_1 OID_2.............

Now i am not able to figure out why that extra length is getting appended while your code gives the required pattern

 

Download All
0 Kudos
Message 14 of 20
(1,122 Views)

Actually the OID values are getting repeated not the length of the messages

0 Kudos
Message 15 of 20
(1,117 Views)

Based on your description, here is what I think you want. I cleaned some things up and corrected some mismatched data types in eg.vi. I also modified the order of teh data since you indicated it was the OID (which I assumed was the index value from the list box), the length and then the data. You didn't mention if your needed the 127 between the OID and the length so I left it out. This would be trivial to add if needed.

 

I think your problems were all of the type mismatches that you had. I32, U8, U32, etc. Everything needs to be U8.

 

Also, from a UI perspective I would be very annoyed if I selected 10 OIDs and had ten popup dialog boxes. I would suggest you find a better way for your users to enter the data.

 

 



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
Download All
0 Kudos
Message 16 of 20
(1,107 Views)

Thanks Mark. My program is working as required.

And regarding the popup dialog boxes, I thought thats the best way since the user can input any string he desires. Yes it would be better if there was one single dialog box accepting n inputs where n is a numeric control. Is there any possible means to do that?

 

0 Kudos
Message 17 of 20
(1,090 Views)

I am using this to accept strings. I am sure there must be other simpler ways.

0 Kudos
Message 18 of 20
(1,087 Views)

Wouldn't it be much easier to simply use a table. You could use a multiselection table and get both the selection and the strings without all the extra code and chance for errors. For instance, you miss the last string if the user doesn't hit a return at the end. I think this will be a common error for you.



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
0 Kudos
Message 19 of 20
(1,079 Views)

Oh Tables! thats new to me. Will learn and post the vi i make. Thanks 🙂

0 Kudos
Message 20 of 20
(1,057 Views)