LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help in rs232 serial communication

Thank you for your response.

 

I'm livin South korea, in my country ' \ '  is convert to ' W with a line ' through it.

0 Kudos
Message 11 of 16
(915 Views)

Hi

 

I change rs232 communication to usb communication and It works.

 

But it just work few second and I head to timeout error.

 

Here's my screenshots.work few second.PNGerror occur.PNGblock dia.PNG

0 Kudos
Message 12 of 16
(898 Views)

@odoria wrote:

Hi

 

I change rs232 communication to usb communication and It works.

Sounds like a cabling problem. RS-232 is commonly refered to as "resolder pin 2 to 3 and 3 to 2". Another possible problem is that your device might require a certain logic level on the RTS and/or DTR line before it will respond.

 

Actually looking at the manual it seems the RS-232 option is meant to be used to connect a printer to the device. So aside from the fact that the connector is most likely wired to connect to a DCE rather than a DTE port, the internal processor is likely not setup to expect commands on this port but only to send out commands to a printer!

 

But it just work few second and I head to timeout error.

 

Here's my screenshots.


You are hammering the device with maximum speed with commands. Most devices do not like to be treated that way. Put at least a delay in the loop of a second or more.

 

Even better yet, put the send and receive function inside a case structure controlled by a boolean button on the front panel set to "latch when released" mechanical action. Don't forget to put a reasonable delay of at least 100ms to a few 100ms in the empty FALSE case, otherwise your loop will tend to do VERY VERY fast absolutely nothing and make the front panel feel unresponsive. 

Rolf Kalbermatter
My Blog
0 Kudos
Message 13 of 16
(890 Views)

Thanks for your help.

 

Now I can get data from sound level meter,(its thanks to you 😄 )

 

but I have one question about it.

 

When I send a message, I can't get data at once, I  take it three times. (Echo->Result Code-> Request)

 

I'm curious if it can't be helped according to the manual.

 

first.PNGsecond.PNGthird.PNGcapture.PNG

0 Kudos
Message 14 of 16
(861 Views)

Why are you using Bytes at Serial Port again?????

 

When you try to talk to a device, you really absolutely should forget that you ever saw that property! It has no place in any reasonable instrument communication ever! Use of that property for instrument communication will always result in extra problems that you then have to solve with extra unneccessary code to work around those problems, until your communication VI gets so complex that nobody can understand and debug it anymore!

Rolf Kalbermatter
My Blog
Message 15 of 16
(846 Views)

@odoria wrote:

When I send a message, I can't get data at once, I  take it three times. (Echo->Result Code-> Request)


Then read 3 times each time you write a command.

 

And as already stated, you should (almost) never use the Bytes At Port to tell VISA Read how many bytes to read.  Because your device has a termination character and you have the termination character enabled, you just tell the VISA Read to read more bytes than you ever expect in a message and the read will end when the termination character is read.


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
Message 16 of 16
(837 Views)