12-04-2024 11:55 AM
good afternoon.
I did que sheme in arduino program and he work good.
As soon as I switch to LABVIEW, the values that appear to me are nothing like those that appear in the Arduino program.
Please help me with this problem.
I send the Arduino code and the labview schematic and some more images of the assembled schematic.
Thanks
12-04-2024 12:05 PM
Ola VascoDuque,
Crie um Indicador das strings lidas pelo VISA (antes de converter pra numero ) e veja o que o labview esta recebendo do Arduino. Seria bom fazer o arduino enviar algum cabecalho pros dados pra garantir que os dados estao sendo lidos apropriadamente ( por exemplo TEMP-XXX,HUM-XXX onde XXX eh o numero), assim, qdo ler no LabVIEW, o program garante que Temperature e humidade estao sendo recebidas apropriadamente. Se o arduino manda os dados antes do computador estar pronto pra ler, as strings vao se acumulando e vc tem dados misturados sem saber o que eh temp e humidade.
12-05-2024 07:50 AM
Os dados continuam a não ser os correspondidos.
Adicionamos os leitores de string.
Vou enviar a imagem do sistema e do LCD com os valores lidos pelo codigo Arduino.
12-05-2024 10:24 AM - edited 12-05-2024 10:27 AM
First let's talk about parsing your serial data. Instead of sending the temperature and humidity as two different things send them together in one string separated by a comma.
Instead of: Serial.println(leituraTemperatura); and Serial.println(leituraHumidade);
Use this: Serial.println(leituraTemperatura","leituraHumidade);
That will send the temperature and humidity separated by a comma.
Then in your LabVIEW use Spreadsheet String To Array and Index Array to parse the string like the example below.
As for your serial communications you should watch this video: VIWeek 2020/Proper way to communicate over serial
VISA Serial defaults to Termination Character enabled and Serial.println() sends a a newline character (ASCII 10, or '\n') at the end of every line sent.
12-06-2024 08:56 AM - edited 12-06-2024 09:00 AM
Qdo vce escrweve a variavel float na porta serial do Arduino, esse dado eh recebido como string on LabVIEW. Experimente mandar uma string com um cabecalho, por ex: "TEMP- 30,5" Atencao que o separador decimal (ponto e virgula) sao diferentes no portugues e no ingles (no labview/arduino).