NI Home > Community > NI Discussion Forums

Instrument Control (GPIB, Serial, VISA, IVI)

Showing results for 
Search instead for 
Do you mean 
Reply
Member
SSteve
Posts: 22
0 Kudos

Sending <cr> in NI-488.2 Communicator

Is it possible to send a carriage return (or line feed) after the "Send String" in the NI-488.2 Communicator?
Member
KEN_IU
Posts: 4
0 Kudos

Re: Sending <cr> in NI-488.2 Communicator

YES. \r
Member
TV_Enable
Posts: 115
0 Kudos

Re: Sending <cr> in NI-488.2 Communicator

Hi Steve,

 

Thank you for your post.  Take a look at this KnowledgeBase article.  If you look at the bottom of the page, you will see that when reading a command through the NI-488.2 Communicator in MAX, the applet scans for any character that seems to be binary data. The alphanumeric, carriage-return, and line-feed characters are not considered binary data.  Thanks again for your post, and feel free to post again if you have anymore questions!

 

Regards,

 

Todd V. 

National Instruments
Applications Engineer
NI Prototyping Community
Member
KEN_IU
Posts: 4
0 Kudos

Re: Sending <cr> in NI-488.2 Communicator

Hello again. I apologize for the very brief reply earlier. I tried communicating with my Acton SP300i in the MAX applet "GPIB comminucator," as I believe it is called. Assuming this is the same applet as the IEEE4882 communicator (I think it is), I can tell you that I had success appending the carriage return character by typing '\r' after the command(s) I wanted to send. This is fine for this communicator, but if you want to send the machine a carriage return in your VI, make sure you append a carriage return character to your command string by selecting it from your controls and concatenating it to your commands. I spent about two days troubleshooting this fact.
Knight of NI
Dennis_Knutson
Posts: 34,100
0 Kudos

Re: Sending <cr> in NI-488.2 Communicator

In order to send a CR or LF, you can of course use the constants from the string palette. You can also use \r or \n as long as you right click on your string control/constant and select '\' Codes Display. If you don't take this basic step, all that you are sending is the separate characters '\' and 'r'. Beginners often make this mistake and there are numerous threads on this subject.

 

p.s. You might want to start using VISA instead of the low level GPIB functions. VISA is more portable and is the recomended API.

Member
SSteve
Posts: 22
0 Kudos

Re: Sending <cr> in NI-488.2 Communicator

Thanks for your replies, Ken & Dennis. Using '\r' and '\n' in the NI-488.2 Communicator applet in MAX does seem to send CR and LF. I'm trying to troubleshoot GPIB communication with an SRS SR530 amplifier. I'm not sure if the amp is broken or if I'm sending incorrect commands. The manual says it needs to see a CR or LF after every command, so I wanted to make sure that was happening. Now that I've confirmed that, I'm on to the next step of trying to figure out why the error light on the unit blinks every time I send a GPIB command.