03-08-2010 02:41 PM
I have a USB GPIB from NI that is replacing a Keithly card in an old dos machine. I can talk to all the instruments using the commands I found in the basic program running in dos except for one. It is an LMT I1000 (It's doubtful anyone has heard of it) The guy who developed the GPIB Interface is dead, so I didn't get any help from the manufacturer. The code in Basic works fine, but when I send the same commands through VB.NET, it doesn't work. I can't even get the instrument to go into remote mode and then back out. Here is the code in basic along with comments for what it does:
Rem TURN ON REMOTE MODE (REMOTE 16) 'This turns on a red LED on the display
Print #1, "REMOTE 16"
Rem REQUEST OUTPUT FROM LMT BY SENDING GET COMMAND (TRIGGER 16)
Rem REQUEST STRING FROM DEVICE #16 (LMT) VIA GPIB (ENTER 16)
Print #1, "TRIGGER 16"
Print #1, "ENTER 16"
Input #2, Meas$
Val$ = Mid$(Meas$, 1, 7)
Exp$ = Mid$(Meas$, 9, 3)
Rem RETURN LMT TO FRONT PANEL CONTROL (LOCAL 16) ' This turns the red LED off
Print #1, "LOCAL 16"
Here is what I am sending with VB.NET
GPIBDevice.Write("REMOTE 16") 'This actually does turn the LED on the panel on but so does sending anything over GPIB to it.
GPIBDevice.Write("LOCAL 16") ' Does nothing, along with all the other commands. I've tried sending LF or CR, but LF doesn't do anything and CR seems to cause the equipment to hang.
Is the code in BASIC maybe sending out something differently than the vb.net code would? Is there some way to verify what is being sent out by the basic code?
Thanks for your help!
03-10-2010 09:28 AM
03-10-2010 09:41 AM
Thanks for your reply, and yes, it is strange that the address seems to be included, but that is the actual command sent to the instrument. There are tons of other commands being sent to other newer instruments and all of them work perfectly when I simply copy and paste the command from BASIC to my code in .NET.
I talked to another programmer here and he said that he also ran into the same problem communicating with the instrument and he was forced to use the analog output that the unit has. In my case I cannot do that though because I need to know what the gain is.
That is the instrument I am trying to talk to, but RS-232 is not an option because there is no RS-232 port on this unit. I suppose if I can't get it to work with GPIB I could send the unit back to germany and have it added, but I wanted to know if there are any settings that I can change that might make it work before going that route. I assume it's something pretty simple, but I just don't know what it is.
Thanks!
03-10-2010 09:47 AM
03-10-2010 10:10 AM
The gain is just a numeric value that I need from the instrument that you can't get by using the analog output, so I have to use GPIB. I do have a manual for the instrument, but it does not include any information about programming for it, so all I have to work with are the commands that are being sent via the BASIC program. I am really just wondering if there are any settings for the GPIB that might need to be adjusted to make it work. I am fairly certain that the commands that are being sent are correct.
03-18-2010 04:25 PM
03-19-2010 06:54 AM
03-19-2010 08:21 AM
Here is one suggestion.
Download the the drriver for the gpib card CEC card (KPCI-488)...if you do not have it already.
Not sure how old your card is...it may be quite old. If you have the driver use what you have.
If you want a slightly newer version of the driver, I would try version 7.0. Here is the link for version 7.0 of the driver:
http://www.keithley.com/support/data?asset=10098
Since your card is not an NI card using NI-SPY will do nothing as it only works for NI cards. You can use a GPIB Analyzer to capture if you have access to one.
As for getting a card to work with .NET and newer OS's, the cards current being sold by Keithley are KPCI-488A and KPCI-488LPA. Both are CEC compatible, but the KPCI-448LPA would be my recommendation in that preverves CEC command compatibility including legacy functionality (even master/slave) with a driver that is compatible with all operating systems. So if you can get your code to work with the old card and just need a newer card this is the way to go. Good luck.
03-22-2010 04:34 PM
APPMon will not work with the Keithly card. I thought all of this was on one system.
Do you have 2 seperate systems? One old one with DOS and the Keithly card, and now another one with .NET and the NI card?
Have you had any success on the new system? You can run NI-Spy on the new system to see whawt is actually being sent on the bus.
03-23-2010 06:32 AM