Generally that error means you are passing your function invalid values, but from what you posted everything looks fine to me. Have you tried running any of the shipping examples that use ildev? For example the Devquery example? You can usually find these examples in the following directory.
Yes, I tried the example code from the Max 2.0 CD. The problem I found is the return value is not -1 or error msg if the function call could not find any GPIB device.
Was it the ildev call in the example that was returning this error? Also, have you tried communicating with the device through other methods, such as through Measurement and Automation Explorer?
Well, it looks like this isn't going to be solved by a quick solution. Could you resummarize for me exactly what is going on, including the version of NI-488.2 you are using, exactly what program you are running, and exactly what error you are obtaining? Also, you could run NI Spy in the background to obtain a Spy capture so we could know exactly what is going on at the driver level. Once we have all of these details, we can more accurately troubleshoot this issue.
If RTV.bPS(0) = True Then Call ibdev(0, 1, 0, T10s, 1, 0, RTV.nGpib1%) Sleep (10) If ibsta And EERR Then Call MsgBox("GPIB Device 1 Setup Error!", vbCritical, "GPIB Error") frmLogo.MSComm1.PortOpen = False Sleep (50) End End If End If
The condition expression "ibsta And EERR" was always FALSE, no matter the GPIB device is on or off of power.
In order to get a better idea of what is going on at the driver level, I'd love to see an NI Spy capture. NI Spy is a utility that logs all of the calls made to NI-488.2, NI-VISA, and many other National Instruments drivers. Here is a tutorial that discusses NI Spy:
Please take a Spy capture while your program is running and attach the file to your next post so that we can better troubleshoot what is going on behind the scenes. I look forward to continuing to assist you in this.