06-13-2024 12:13 PM - edited 06-13-2024 12:43 PM
I have all the ASCII characters read from a binary file I already populated. My next step is a user being able to type out a string and each letter (a page in the 3d array) showing up in order that it was typed in and than can be cycled through. An example is a user types out BEN this will produce 3 pages from the 3d 5x7 matrix that are in order of the capital ascii characters.
06-13-2024 12:23 PM
I would start with a few basic tutorials to eliminate all the race conditions and greedy loops.
06-13-2024 12:25 PM
Where would I find these tutorials and do they cost money?
06-13-2024 12:38 PM
Check the learning resources at the top of the forum.
(I am currently at a conference and will look at your code later.)
06-13-2024 03:46 PM
For a tutorial on race conditions I would recommend this short 12 minute video:
https://www.youtube.com/watch?v=9T1pqnGt9kU
The solution they show, using a FGV, is one of the (but not the only!) solutions to fix race conditions.
The whole channel is basically abandoned (last video made 8 years ago) but they did a pretty good job explaining things well in short videos and the content still holds up.
06-13-2024 03:56 PM
Instead of a 3D array, create a 1D array of clusters, each containing a 2D array of booleans. Much easier to manage.
06-13-2024 08:12 PM - edited 06-13-2024 08:13 PM
Here's one possibility. You can easily change the LEDs in each cluster to an 2D array of 24 booleans (e.g. 5x8)
06-13-2024 09:58 PM
You failed to attach your display-copy.txt (or similar) file. Once you have th2 3D array, you can just index into it.
Here's a highly simplified version that has a 3D array with just numbers corresponding to the plane index.
06-14-2024 12:04 PM - edited 06-14-2024 12:46 PM
Thank you altenbach and Kyle97330 for your advice and help. I finally figured it out by using a for loop inside a for loop (definitely not the most efficient way but the string will not go past 8 characters leading to no worry with efficiency). If I were redoing this vi I would most likely use the 1d array of clusters containing the 2d arrays as recommended by altenbach. Also, the Display - Copy.txt file is just a binary file containing the cluster of the matrix and the character array connected to the individual 2d matrix that I wrote to a binary file in the original vi. I will attach here incase anyone stumbles upon this discussion. The point of the attached vi is you write any string and it populates the matrix with the pages of the characters that were inputted that you can then tab through.
I also add a blank character at the last index for the character matrix as I forgot to add when inputting them in the original vi I attached.
If you have a more efficient way I would love to see as I am interested in what I could do better.
06-14-2024 01:56 PM - edited 06-14-2024 02:09 PM
@Harthion wrote:
Thank you altenbach and Kyle97330 for your advice and help. I finally figured it out by using a for loop inside a for loop (definitely not the most efficient way but the string will not go past 8 characters leading to no worry with efficiency). r.
I don't even try to understand what you are saying. A FOR loop is one of the most efficient structures (However, your outer FOR loop does nothing useful and just repeats the same operation N times.)
If you want us to play with your VI, you need to also attach the "text" file. And yes, it can be dramatically simplified.
Of course it is a really bad idea to have a binary file with a *.txt extension. Bad form! (Also give it a better name than "Display - Copy.txt")