LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

combining arrays

Hello

I have created 52 1d arrays. These arrays are used to produce 26 letters on a oscilloscope, one array for the x-axis and one array for the y-axis. The x-axis array is plugged into a daq on one channel and the y-axis is plugged into another channel. My supervisor for this project has told me that if i was to use a case structure it would take too long in choosing the letters to use. The idea was to be able to produce a message on the oscilloscope. I thought that i could enter a word on a string input then it would produce it on a oscilloscope.

 

Is there a way i could combine different arrays depending on the lenght of the string and what characthers i have selected into one whole array which could then output to the oscilloscope creating an array which contains the co-ordinates for all the characters

 

Thanks

Catherine Brown

0 Kudos
Message 1 of 4
(2,635 Views)

Catherine,

 

1. A case structure is quite fast.  Either you misunderstood your supervisor or your supervisor does not understand.  Now, if you are doing something time consuming inside some or all of the cases, that is a different issue.

2.  Are all of the arrays the same length?  If so a simple Index Array inside a for loop can get you the data faster than your DAQ card can send it to the scope.  Convert the text you want to display to an array of U8, subtract the appropriate number to shift the numerical values of the ASCII to match the start index of your letter array. Easy. Fast. Simple.  If the arrays are of different lengths,it is a bit more complicated but not too much.

 

Lynn

Message 2 of 4
(2,626 Views)

1) Originally i had the idea of having 26 cases in a case structure which is inside a for loop. My supervisor felt that for each iteration of the loop where the case structure would change to a new letter would take too long. It wouldn't be instantaneous. Do you know how i could go about having a string input where i could write a message into the case structure where it would write on the osciloscope then output next letter of the message.

2)The arrays are different length. Could you give an example of the array displaying the letters in a U8 array.

 

Thanks

Catherine Brown

0 Kudos
Message 3 of 4
(2,614 Views)

Please post what you have tried so far.  It is often easier (and you learn more) to suggest fixes to what you have tried rather than to guess what someone else really wants.  Include data for several or all of the letters.

 

I am pretty busy today and will not have much time to put together an example.

 

Look at the image below which shows the String to Byte Array function.

 

LynnString to Byte array.png

0 Kudos
Message 4 of 4
(2,601 Views)