I have a system setup and working where if I send a query to the system, such as DIS?, the device will reply with the display value as expected. However, if I send a command, such as *RST, I can see the device reset, but the system does not respond as expected. I tried a few different GPIB commands. I am using Visual Basic 6.0 for this with the National PCI-GPIB card, talking to a ILX-Lightwave Powermeter. Any help will be greatly appeciated. Thanks...
What do you mean by respond as expected? A command will not respond. It is not a query such as DIS? that will respond with an answer. If you mean the device is not responding to the command as you would expect, remember that the *RST command is a common command and all instruments that support this command will not act the same. Resetting a power meter is different from resetting a bit error detector. See the manual for the device for a definition of what the 'known state' of the rst mode. Maybe i have misunderstood your question. If so, comment on this answer and i will be happy to try again to answer your question.
1 more thing, keep in mind that not all devices support all the 488.2 common command set. I programmed for one device that had a table of the com mon commands and did not support all of them (the table showed which were not supported) go figure.
Thanks for your response. To further clarify. I attached a small bit of code (which is mostly the National Sample code, slightly changed). I am not very familiar with GPIB at all and am not sure if I am even using the correct commands. Essentially what happens is I can do a DIS? command in a timer successfully forever, when I send a command, such as DIS 0 (to turn the display off), that works great too. However, the next time I run the DIS? timer or DIS 0 that worked before I get error: ibsta=HC100 and iberr =6 (EABO). Which as I am sure you know is a device timeout. This error is generated on the first GPIB call after the DIS 1 is sent. If you can give me more assistance with this I would greatly appreciate it. Since I am under heavy t ime constraints, I can even send you a small amount of compensation for your time. Thanks again.
This is true : if you send a command (not a query) like DIS 0, then do a read, you will get a timeout because there is nothing coming back.
I see in your code you are writing, then testing to see if what you wrote had a '?' at the end. This is to see if you just wrote a query and need to read. You then read what's coming back if there was a '?'. in theory, using this code and the string "DIS 0" should work. Seems to me you are executing the read function though. That would account for DIS? always working, DIS0 working the first time, then a timeout. What happens is the device gets the DIS 0, turns off the display, gets a command to read, while your code is waiting to get something back or timeout you send another command (any command) and this f ails. This is because there is nothing for the device to send back to the read, it's not failing on the next command (or query). give some time for timeout, then send the next command and it will work right.
As for the problem, look for other code that always calls read after write. Or look for some other process appending a '?' to SendCommand variable. Or are you really putting the value in ilwrt into the SendCommand variable correctly?