LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCPIP communication with instrument worked only once, failed for the second time ...

Solved!
Go to solution

The \r\n should be a part of the IDN?  or immediately after,  and BEFORE you try to read the response.

 

I don't know how much I would trust a device with a manual that refers to a "bite"  rather than a "byte".Smiley Frustrated

0 Kudos
Message 11 of 17
(627 Views)

@William1225 wrote:

After I read wiebe@CARYA's message, I was wondering what if I sending "/r/n" between the two querying process(just like the processes in the Putty, I sent the first command and got the response, and pressed "Enter" key and sent the second command...??), it somehow works.


The suggestion was to add the "/r/n" to the query string.  Due to the long wait, I would not be surprised if the instrument is timing out waiting for that "/r/n" and just taking the string it had received up to then for the initial response.

 


@William1225 wrote:

Since I read the manual and found it mentioning waiting time is 50ms, so that I added 50ms and 100ms that time and failed.

20190710009.PNG


That looks like a serial (UART) bus information.  Is there another section for Ethernet and TCP/IP?


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 12 of 17
(621 Views)

Hi wiebe@CARYA,

 

Yes, I had tried "*IDN?\r\n", "*IDN?\r", and "*IDN?\n", but none of them works.

But when I sent "\r\n" between the two querying processes, it works.

 


How would this work if the device doesn't have ethernet? You'd still be expecting 50 characters, and they won't come in...

I do not understand this words, if the device doesn't have ethernet, I can't connect the device and an error would happen in the "TCPIP Open Connection"...


0 Kudos
Message 13 of 17
(615 Views)

Hi billko,

 

Thanks to your suggestion, I can try this way tomorrow 🙂

0 Kudos
Message 14 of 17
(608 Views)

@RavensFan  已寫:

The \r\n should be a part of the IDN?  or immediately after,  and BEFORE you try to read the response.

 

I don't know how much I would trust a device with a manual that refers to a "bite"  rather than a "byte".Smiley Frustrated


bite...... I didn't notice that.... Smiley LOL

0 Kudos
Message 15 of 17
(602 Views)

@crossrulz  已寫:


That looks like a serial (UART) bus information.  Is there another section for Ethernet and TCP/IP?


Hi crossrulz,

No, I found no information for Ethernet, TCP/IP in that manual.

http://www.saelig.com/supplier/preen/adg-l-series-user-manual-saelig.pdf

Perhaps it was designed for RS-232 originally, and the Ethernet protocol is developed recently.

0 Kudos
Message 16 of 17
(598 Views)

@William1225 wrote:

 


How would this work if the device doesn't have ethernet? You'd still be expecting 50 characters, and they won't come in...

I do not understand this words, if the device doesn't have ethernet, I can't connect the device and an error would happen in the "TCPIP Open Connection"...



This string that is send, is send to all protocols, serial, ethernet, usb, etc. No ethernet was a poor example.

 

Point was that without a \r\n at the end, there is no way for a client (nor the server) to reliably communicate. How would the client (or server) know the string is finished? It can't. Except when there is a defined end termination character, and that is usually \r\n for this kind of protocol (SCPI or SCPI-ish).

 

So if the device (or a replacement device) doesn't have the serial interface, the string won't be 50 characters. The protocol needs \r\n to communicate...

0 Kudos
Message 17 of 17
(572 Views)