04-24-2015 02:07 PM
Buenas tardes, estoy leyendo por el puerto serial usando VISA los datos de 5 sensores, pero todos se mezclan al usar visa, no se como discriminar los datos en LabView sin tener esos confilctos con los datos.
Ejemplo:
Al serial llega:
10
15
89.3
-15
-98.23
Y al querer imprimirlos se mezclan todos y aparecen esos valores en orden randomico, alguien podria ayudarme? muchas gracias.
Solved! Go to Solution.
04-24-2015 02:34 PM
04-24-2015 02:45 PM
04-24-2015 02:50 PM - edited 04-24-2015 02:54 PM
I'm doing it, for example if a writte a "g" in Labview the LAbview Read de GPS, but if I writte a "H" the Labview Reads Humidity , but i'm sending "g" and "H" all time and the information mix with other. I tried to Wriite " L" for Latitude, "l" for Longitude, but I've the same problem all information mix.
04-24-2015 03:24 PM
04-25-2015 09:49 PM
Don't use Bytes at Port. It is very likely you'd get incomplete messages.
Do your messages have a termination character? If so, use that to read a sufficiently large number of bytes and the read will terminate automatically when you get it.
If you have confusion about what data goes with what message, then use a letter or some other code at the beginning of your response in the Arduino code. Then you can parse that out and be sure you are getting the right piece of data you are expecting.
04-27-2015 07:48 PM
No, i just have numerical data, I send a letter like "L" and arduino response is 78.09826, and I'm doing it for all data.
This is my LabView code:
04-27-2015 07:57 PM
Make sure your device sends a termination character such as the new line/linefeed character. Then just read a very large number of bytes. The VISA read will terminate when it gets the termination character and you will know you have a complete message. That allows you to get rid of that whole inner while loop.
04-27-2015 08:00 PM
For example I can program on Arduino to send " , " at in the end of the data 78.02932, but how do I do that LabView understand it? Can you help me please?
04-27-2015 08:19 PM