Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

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?
0 Kudos
Message 1 of 6
(3,660 Views)
YES. \r
0 Kudos
Message 2 of 6
(3,643 Views)

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
0 Kudos
Message 3 of 6
(3,637 Views)
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.
0 Kudos
Message 4 of 6
(3,614 Views)

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.

0 Kudos
Message 5 of 6
(3,610 Views)
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.
0 Kudos
Message 6 of 6
(3,569 Views)