jro1952 Posted Thursday at 12:16 AM Report Posted Thursday at 12:16 AM Hola, necesito AYUDA, soy entusiasta de temas técnicos, autodidacta, jubilado, pero con la mente intentando hacer cosas nuevas para mi conocimiento. El asunto es asi: desde un arduino controlo una placa Esp32 Cam, a la cual le ordenó sacar una foto y enviármela al serial port, la cual recibo correctamente, con su encabezado EB91 (ADJUNTO ARCHIVO). Genere un .vi con el cual pretendo primero, leer la trama, filtrar y guardar en un archivo binario con extensión. jpg. Aquí empieza mi problema; veo la trama correctamente filtrada pero no logro guardarla, a pesar de varios intentos.(Adjunto el vi). Genere un .vi para guardar como texto y lo hace correctamente. (Adjunto el .vi y su trama adquirida). Si alguien puede ayudarme será bienvenida su mano. Espero este claro el planteo. Gracias por su tiempo. Labview version 10, con windows vista, ya se del siglo pasado..bue es lo que hay...jajterminal.txtRECEPCIONFOTOTet.viterminalTrama.txtRECEPCIONFOTOBin.vi Quote
Rolf Kalbermatter Posted Saturday at 10:33 PM Report Posted Saturday at 10:33 PM (edited) On 9/3/2026 at 2:16 AM, jro1952 said: Hola, necesito AYUDA, soy entusiasta de temas técnicos, autodidacta, jubilado, pero con la mente intentando hacer cosas nuevas para mi conocimiento. El asunto es asi: desde un arduino controlo una placa Esp32 Cam, a la cual le ordenó sacar una foto y enviármela al serial port, la cual recibo correctamente, con su encabezado EB91 (ADJUNTO ARCHIVO). Genere un .vi con el cual pretendo primero, leer la trama, filtrar y guardar en un archivo binario con extensión. jpg. Aquí empieza mi problema; veo la trama correctamente filtrada pero no logro guardarla, a pesar de varios intentos.(Adjunto el vi). Genere un .vi para guardar como texto y lo hace correctamente. (Adjunto el .vi y su trama adquirida). Si alguien puede ayudarme será bienvenida su mano. Espero este claro el planteo. Gracias por su tiempo. Labview version 10, con windows vista, ya se del siglo pasado..bue es lo que hay...jajterminal.txtRECEPCIONFOTOTet.viterminalTrama.txtRECEPCIONFOTOBin.vi I haven't looked at the VIs yet but could it be that you use the Write to Text File node and have not disabled the convert EOL option on it? If you want to write binary data, it is usually better to use the according Write to Binary File instead, but here you must not forget to wire a FALSE to the prepend array of string size input if the binary data is already the final format you need in the file. Edited Saturday at 10:34 PM by Rolf Kalbermatter Quote
jro1952 Posted yesterday at 12:27 AM Author Report Posted yesterday at 12:27 AM Hola, gracias por su respuesta, el archivo de texto lo realice para verificar que los datos recibidos sean los correctos. Los datos que recibo es una foto, los envia la Esp32 via arduino, la intención es recibirlos, archivarlos en un file jpg y luego levantarlos y presentarlos en una solapa dedicada. Verificare sus indicaciones y me mantengo atento a su revisión de mis .Vi Gracias por su atención 👍 Quote
ShaunR Posted 1 hour ago Report Posted 1 hour ago I don't have an Arduino to hand but here is a quick and dirty conversion of your dump file so you can see how it would be done. Not much in the JPG to look at though str2jpg.zip Quote
Rolf Kalbermatter Posted 44 minutes ago Report Posted 44 minutes ago (edited) Shauns code is more robust than just scanning the lines. But you should NOT use Bytes at Serial Port ever (with a few very rare exceptions that you are unlikely to ever encounter)! This is the default presentation that everybody should watch who is trying to implement serial port communication in LabVIEW: https://labviewwiki.org/wiki/VIWeek_2020/Proper_way_to_communicate_over_serial Once you fixed the serial port communication, by using the termination character properly that you already enabled in the Serial Port Init by default, and simply removing the Byte at Port completely and instead wire a large number like 512 to the byte to read input, your main problem is this part of your code. You should replace this with this part of Shaun's code: Your code currently only converts the first two hex parameters of every received byte sequence and with your Bytes at Serial Port function you frequently won't receive an entire line, so only convert part of it. The remainder will be read in the next iteration but totally throw the Match Regular Expression function off the tracks as it does not see the expected line header. Edited 43 minutes ago by Rolf Kalbermatter Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.