09-30-2008 07:08 AM
Hi.
The only way I can communicate with my GPIB instrument, is through the "communicate with instrument" button in MAX. That means the ibwrt. None of the VISA VI's are working.
Here is the commands send through the NI-488.2 communicator(in MAX):
171. ibwrt(UD0, "I0001..", 7 (0x7))
Process ID: 0x00000FEC Thread ID: 0x00000E54
Start Time: 13:10:55.679 Call Duration 00:00:00.817
ibsta: 0x100 iberr: 0 ibcntl: 7(0x7)
Here is the commands send through the 488.2 VI's:
61. GPIB Write (30, "I0001\r\n", 0,1000)
Process ID: 0x00001320 Thread ID: 0x00001338
Start Time: 14:00:24.138
I cant find any function/VI that works.
The instrument I need to control is "listening only´" motor controller. "I0001\r\n" increment step motor by 1and "I-0001\r\n" decrement step motor by 1. That is the only commands i need!
Are there anyway that I can implement the ibwrt in my program?
Thanks in advance.
/Jens
10-01-2008 04:03 AM
Hi Jens,
Are you using a NI-GPIB board or a 3.rd party board for connection to your motor controller? You can't use NI-488.2 GPIB commands if you are using a 3.rd party board. However you should be able to use NI-VISA functions.
First try to communicate to your instrument in MAX. After you scan for instruments, click on your instrument and open a VISA session to it. On the basic I/O tab execute a write of *IDN? (if applicable to the particular instrument) then a read. This should return the instrument's description. If this does not work or you do not have VISA, you can right click on your GPIB interface and select Interactive Control to use GPIB commands.
This guide walks you through using the Interface Bus Interactive Control (ibic). If you can establish communication in MAX, you can then try running a simple application to establish communication between LabVIEW and GPIB. Use the example LabVIEW<->GPIB.vi, located in examples\instr\smplgpib.llb. Try a simple command to the instrument, like *IDN? again. If you still receive errors with GPIB, you may have a configuration problem. Open the GPIB configuration utility (Windows: Explore GPIB; Mac: NI-488 Config; Sun: ibconf; HP-UX: ibconf). Verify that the settings match your hardware settings. Exit the configuration utility and run the ibic utility again.
http://www.ni.com/support/gpib/max/ibic.htm
Similar documents can also be found here: http://www.hit.bme.hu/~papay/edu/GPIB/ibic.htm
Please let me know if this helps.
Thanks!
10-03-2008 04:58 AM
Hey
Thank you for your respons. I managed to get it to work using the GPIB(not VISA) VI. I tried that several times without success, but the problem was that i send my commands followed by \r\n - not working. But by using mode 3 in stead of mode 0, the VI automatically added \r\n which made it work. Small adjustments makes the differens:-).
Sincerely
Jens
10-03-2008 01:01 PM
My guess is that you did not have the string control/constant set for '\' Codes Display (just right click on the control/constant) so you were not sending them correctly.