From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

como mantener ultimo valor leido de variable en puerto serial

Estoy diseñando un panel de control para mostrar el valor leido de la temperatura ambiente y la de un horno de fundicion que alcanza hasta las 1200 y el vi preliminar montado en labview  V9.0 funciona bien obteniendo el valor de las variables que envia el equipo de forma remota desde el horno a través de un enlace inalambrico de baja velocidad, ahora bien dado que la transmision serial inalambrica se ve afectada por el ruido no llega constantemente el valor de la variable y es inestable la cantidad de datos recibidos, por ejemplo, deberian recibirse datos cada 1 seg pero dado el elevado ruido en el ambiente se obtienen datos entre 3Seg y 5 o 6 Seg, explicandolo de otra forma, en algunos momentos el sistema recibe constantemente la data cada segundo, pero en algunos momentos varia y los recibe a intervalos de 5 seg.

 

Ahora bien, cuando el vi recibe el dato al momento de espera el vi coloca en 0 la variable leida, dado que nunca llego y asi lo grafica, por lo tanto las gráficas mostradas aparecen picos de temperatura y luego 0 Grd y asi lo hace sucesivamente en vez de mostrar una linea continua de temperatura sin saltos bruscos a cero.

 

Atte.

Andres Mathison

 

0 Kudos
Message 1 of 8
(3,233 Views)

Hello Amathison

 

I've took a look at your code, but I could not understand how your VI reads the temperature every second.

Because there is no loop structure in your code. So, how do you timing your VI?

 

Regards,

 

Plínio Costa
Application Engineering
National Instruments Brazil

 

----------------------------------------------------------------------------------------------------------------------------------------------------------

 

Hola Amathison

He echó un vistazo a su código, pero no podía entender cómo su VI lee la temperatura cada segundo.

Debido a que no existe una estructura de loop en el código. Así que, ¿cómo medir el tiempo de su VI?

Saludos,

 

Plínio Costa
Application Engineering
National Instruments Brazil



Plínio Costa
Senior Techinical Support Engineer
National Instruments Brazil



0 Kudos
Message 2 of 8
(3,224 Views)

Hello Plínio, thanks for just helping me to try to solve this little problem.

 

I just do not use loop structure because this than i use it is just working, but it does not hold the last value receive from equipment.

 

I took a example of labvew that is "Basic Serial Write and Read.vi" and i adjust or modify to take the word that i send serially and take the values and graph this values, but when i dont receive the word for some noise in the air or something else, the vi put "0" in the value and graph "0" then the graph show some high and low lines, not the normal temp graphical that i would like to get.

 

I am reducing the vi to get the minimal funtions in the screen to try to solve by myself but i dont.

 

I am sending this new vi. The word that´s receive this vi like input, for example is "TA24TB35" where the value after "TA" is the ambient temperature and the value after "TB" is the termocouple temperature and the graphical value is the add of this two values.

 

I am sending too the vi working with some temperautres being graphic and showing the spaces between the temperatures registered.

 

thanks

Best regards

Andres Mathison

Venezuela

 


Download All
0 Kudos
Message 3 of 8
(3,211 Views)

Hello Amathison

I need to understand your application better.

So how exatly do your instrument communicate with LV? Is it a synchronous ou asynchronous communication, because in your first VI you was asking for data (asynchronous communication) and in the second one you just read data all the time (without regard to the timing).

Lastly, ensure that your problem is not in the instrument communication. For that, take a look what you are getting from the instruments using the VISA Test Panel in MAX or use a third-party serial monitor.

Regards,

 

Plínio Costa
Application Engineering
National Instruments Brazil

 

Plínio Costa
Senior Techinical Support Engineer
National Instruments Brazil



0 Kudos
Message 4 of 8
(3,206 Views)

Hello Plínio

 

Thanks for the time that you tray to help me

 

Between LV and Microcontroler unit i am using asynchronous communication.

 

When i began with this project i receive the informacion like a word very well but i do not think that it was be to me a nightmare to try to look how get the exactly code to "cheat" the graphical interfase when they do not receive nothing then it get the last value receve and show it until the receiver get the new value receive.

 

I am sending to you what the receiver gets in the rs232 port with MAX.

 

 

0 Kudos
Message 5 of 8
(3,195 Views)

Hello again,

 

Sorry for the delay to answer.

 

In the second VI you had sent to me, you was not using an asynchronous communication. Because in that case you was not asking for the temperature, you was just reading all the time (even without timming your while loop). In an asynchronous communication first you need to send a word asking for the information.

 

About "to cheat" the graphical interface, you can compare the temperature value received and discard all the wrong information before plotting.

 

Regards,

 

Plínio Costa
Application Engineering
National Instruments Brazil

 

Plínio Costa
Senior Techinical Support Engineer
National Instruments Brazil



0 Kudos
Message 6 of 8
(3,170 Views)

Hello Plinio

 

Thanks for response.

 

I just solve the problem using SHIFT REGISTER and i use a formula node to put some little code to get the last value readed from the serial interfase and graph this value.

 

I just made it like i want, i mean, when i received the value from serial interfase i graph this value and hold this value until the equipment receive new data.

 

I really do not know if i am using asynchronous because the wireless interfase is just one way, i mean, then tramsitter does not receive no one ask word from the receiver, it just always send word with the information that i use, for example, a bip that it is used in VOR of air traffic controller.

 

 

Best Regards

 

 

Andres Mathison

Electronic Engineer

Valencia, Venezuela.

Download All
0 Kudos
Message 7 of 8
(3,167 Views)

So when your server sends words from time to time, ie. in specific frenquency, in this case your using a synchronous communication.

 

Ultimately, I'm glad you solved your problem.

 

Regards,

 

Plínio Costa
Application Engineering
National Instruments Brazil

 

 

 

 

 

 

 

 

 

Plínio Costa
Senior Techinical Support Engineer
National Instruments Brazil



0 Kudos
Message 8 of 8
(3,162 Views)