03-23-2012 01:04 PM - edited 03-23-2012 01:05 PM
@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.
03-23-2012 01:06 PM
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
03-23-2012 01:11 PM
@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.
03-23-2012 02:51 PM
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
03-23-2012 03:07 PM
Actually the OID values are getting repeated not the length of the messages
03-23-2012 04:10 PM
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.
03-25-2012 02:13 AM
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?
03-25-2012 04:48 AM
I am using this to accept strings. I am sure there must be other simpler ways.
03-25-2012 01:17 PM
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.
03-26-2012 12:50 PM
Oh Tables! thats new to me. Will learn and post the vi i make. Thanks 🙂