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: 

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,396 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,394 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
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 3 of 5
(3,371 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,348 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,344 Views)