LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending New Line character after command

Solved!
Go to solution

I have a text box where I enter the command   *IDN?\n   (includes termination character) and send it to my equipment...nothing happens. I then send *IDN?<ENTER><ENTER> (hit ENTER key twice) and I get the response I wanted. And it only works if I hit the ENTER key twice. What's up with that? Thanks.

0 Kudos
Message 1 of 5
(3,984 Views)

Is it possible your device doesn't respond to the *IDN? request but instead responds to an empty request?  By that I mean what if you sent ABCD<ENTER><ENTER>, does the device respond with what you want?  *IDN? is somewhat common but not not all devices respond properly to it.

0 Kudos
Message 2 of 5
(3,982 Views)
Solution
Accepted by topic author BiggyD

@BiggyD wrote:

I have a text box where I enter the command   *IDN?\n   (includes termination character) and send it to my equipment...nothing happens. I then send *IDN?<ENTER><ENTER> (hit ENTER key twice) and I get the response I wanted. And it only works if I hit the ENTER key twice. What's up with that? Thanks.


Also make sure that you have special characters turned on when typing the \n.  Otherwise it is interpreted as \\n.  Right click the control to change the display mode.

Capture.PNG

aputman
Message 3 of 5
(3,959 Views)

The *IDN?  command is a request for the device's identification. The command works fine if I send

*IDN?|<ENTER><ENTER>   I get back the identification string I expected. Otherwise, if the command fails, I get a blank... nothing.

0 Kudos
Message 4 of 5
(3,936 Views)

YES! That's the problem. It was driving me crazy. I right clicked on the text box and chose  '\' Codes Display   and now it works as advertised. Thanks.

0 Kudos
Message 5 of 5
(3,932 Views)