Discusiones sobre Productos NI

cancelar
Mostrando los resultados de 
Buscar en lugar de 
Quiere decir: 

problemas con el puerto serie....

No recibo datos por puerto serie con labview 2013, con hercules pruebo el puerto y recibo perfecto de un APC220; con Labview no..., esta bien configurado el puerto, esta perfecto chequeado con el MAX, no se por donde seguir...., todo en windows 11.....; agradezco el auxilio....!!!!

0 kudos
Mensaje 1 de 17
2.308 Vistas

Do you get any error messages?

Could it be that the port is still in use by other software?

0 kudos
Mensaje 2 de 17
2.304 Vistas

I don't receive any error, nor is the port used by another software....; thanks for answering...

0 kudos
Mensaje 3 de 17
2.284 Vistas

when I place the "close" inside the "do loop", I receive some ascii code that has nothing to do with the plot....dat:......

0 kudos
Mensaje 4 de 17
2.283 Vistas

without the "write" it's the same...

0 kudos
Mensaje 5 de 17
2.281 Vistas

I recommend to watch Tim's presentation about serial communications.

 

You are writing to the device, checking bytes at port a nanosecond later when nothing has come back yet, then obviously read nothing. Does your data have a termination character? Use it!

 

Why not place an indicator at the "bytes at port" wire? Why not create an error indicator inside the loop? What is the value of the control named "Numeric"? What's in the string wired to the write function? Why do you call the output "data in"? Good programming starts with giving terminals reasonable names!

altenbach_0-1685120572106.jpeg

 

0 kudos
Mensaje 6 de 17
2.274 Vistas
Thank you...!!! Thank you very much for all your observations. I still don't get anything...., I'm new to this. excuse my mistakes...
0 kudos
Mensaje 7 de 17
2.256 Vistas

So what is the message protocol that you are sending on the other end?  Is that device sending the data with a termination character?  For Arduinos, that is done for you if you use the Serial.WriteLn() command (it appends the line feed).  If that is the case, then get rid of the Bytes At Port and just tell the VISA Read to read more bytes than you ever expect in a message (I tend to use 50, my generic library uses 1024).  This will allow your VISA Read to read the entire message.  This will also remove the need for the wait inside of the loop.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 kudos
Mensaje 8 de 17
2.221 Vistas
Thank you for your observations, they are all valid. I think the problem is that I use a CP210x rs232 to usb converter...; I try to take the data from an apc 220..., I'm going to change the interface and see what happens....
0 kudos
Mensaje 9 de 17
2.215 Vistas

@jabognz wrote:
I try to take the data from an apc 220...

That device is just a pass-through.  What is on the other side of the APC220?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 kudos
Mensaje 10 de 17
2.200 Vistas