02-15-2006 05:31 PM
Hello David,
From your last post, I believe there are three different issues you're asking about:
1) ResourceManager.FindResources() returns a null rather than an empty array when there are no resources available.
2) Using CEC GPIB under visa, SendInterfaceClear causes a timeout if no resources are present.
3) The CEC GPIB and NI-488.2 drivers can not coexist.
I saw a post from a while back about the second issue, but I couldn't find any references on the forum to the first one. Since I'm currently the lead developer for the VISA .NET library, though, I'll put my two cents in on it. I can understand your point about preferring an empty array to a null value for the return type of this method. I think that what makes a better return value in this case depends somewhat on what you intend to do with the value once it is returned. If you want to check and see if you have any resources, i think (resources != null) is a little more obvious than (resources.Length != 0). It is also a standard practice across a lot of the .NET Framework to return a null reference when there are no values to return. Also, now that it's released and been in deployment for some time, changing the returned value would introduce a breaking change in the API's behavior. Customers currently checking for null would now have to change their code to check for an empty string array instead. We try very hard not to introduce breaking changes in our API's across version, unless it is to fix incorrect behavior.
I can't really speak to the second and third items, as they are issues with the CEC driver, which I know very little about. In fact, I do not believe that CEC GPIB is officially supported under NI-VISA yet. I would suggest posting these questions to the Instrument Control forum, where the GPIB experts are more likely to see it and be able to respond. Also, I have asked a representative from the GPIB team to respond to your questions about interoperability between NI-488.2 and CEC GPIB.
02-15-2006 05:36 PM
I'm not sure exactly what you mean by "Another thing that troubled me is how to clear the interface and teh device for bringing the system to a predictable state." Are you looking for the commands to send to the device, like "*RST" to reset the device's state and "*CLS" to clear its status bytes, or are you looking for something lower level on the gpib bus? You might want to post that question on the Instrument Control forum with a little more detail about what you're after.
Glenn
02-16-2006 09:56 AM
David,
On 2 and 3 that Glenn mentions above, you'll need to contact CEC support. I thought they did officially support NI-VISA, but they may or may not be aware of your SendInterfaceClear() issue. With respect to coexistence with NI-488.2, I do know that the CEC driver does have an issue with this at the moment. It is not recommended to install both NI-488.2 and the CEC GPIB driver on the same system.
Thanks,
Scott B.
GPIB Software
02-16-2006 10:13 AM
02-16-2006 10:27 AM