09-01-2022 03:06 PM
Hello
I'm facing troubles while building U8 array into Grayscale image through VISA READ from Arduino
1st problem I built this VI to store an array of data (0-255) one dimension then reshapes it to the image size i want which is 120x160 but I cant connect it to the input of flatten pixmap.
2nd problem I used a delay to print each U8 so it will take time that might be 32mins to build the image so can someone help me to get an easier way to build it faster? like taking multiple of U8 bytes in each loop instead of waiting that much ( i can't do it since i can only deal with one byte each )
Solved! Go to Solution.
09-01-2022 05:27 PM
Hello Joseph,
Regarding your first problem, the reason why the wire gets broken is due to data type incompatibility. The U8 function takes a numeric input, while you are inputting a string input, therefore, you are getting your wire broken. In order to avoid this, you should convert your string input into a numeric input using any LabVIEW built-in function like Decimal String to Number.
In order to be able to answer your second question, could you share with us the next points:
If any of the information above was useful at all, please kudos to my answer.
Best regards.
09-01-2022 05:41 PM
How do you know if you are getting the correct three bytes, and not, say, two bytes from one value and one byte from the next one?
09-01-2022 06:14 PM
Hello, thanks for helping me with my first problem , about the second one I'm sure I'm mistaken with the data type "3 byte" but as far as ik that I'm only able to see what is being written in via serial as " string" and max is 255 so I thought one byte represents each digit since I'm only sending pixel per pixel and here comes my problem it will be slow to build that 120*160 array that's why I asked if there a faster way to build it or a better way to send data and extract each pixel in one element in that array also the libraries you mentioned can't help me building the image
09-02-2022 04:09 AM
Hello Joseph,
first of all you should explain what kind of data is coming from your arduino. I suppose, you are programming the arduino firmware yourself, so you should be able to explain this.
To clarify the vocabulary I think, it could help you to read this:
https://forums.ni.com/t5/LabVIEW/Complete-String-Conversion-Tutorial/m-p/4245188
Some things to mention:
09-02-2022 04:48 AM
Some more notes:
The "reshape array" function is very fast, so there is no performance issue at this point.
Place a probe at the array wire where the received values are stored and see whether the expected values are there.
To check the picture function, you could do something like this: