Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with NI-488.2 code and sending commands via GPIB

I have set up a test program that talks to different measurement equipment (scopes, power supplys and other meters). I use the NI-488.2 drivers  with visual basic  but using the "send" and "recieve" command  and it has worked with all except one peice of equipment. This piece requires  a carriage return and a linefeed or new line at the end of each command. They are the ascii characters 13 and 10. I found that the NI-488.2 only send a new line command at the end of each statement. Is there a way to send both or a way to send a carrage return at the end. Also the equipment with send a carrige return and a New line command at the end and i have trouble recieving both. Is there a fix to this problem too.

Message Edited by NELfc on 10-04-2005 01:49 PM

Message Edited by NELfc on 10-04-2005 01:49 PM

0 Kudos
Message 1 of 2
(3,119 Views)

I believe you are using Send() function with a termination mode that automatically
sends an LF.  In this case passing "*IDN?" string to the function physically
sends "*IDN?" + chr(10).  To physically send "*IDN?" + chr(13) + chr(10),
pass a string that explicitly appends a CR, such as "*IDN?" + chr(13).

Alternativa way is give NLend value at the final parameter of Send(),
specifying LF and EOI to be sent automatically.

As for receiving, there is no problem for reading termination, as every response
string does include an LF at the final byte.

 
0 Kudos
Message 2 of 2
(3,102 Views)