I'm new to IVI drivers (started using them last week) and I have a problem with the RangeCheck initialization option.
In order to get used to IVI drivers, I used the example that comes with the IVI-COM AgilentE36xx driver (on my computer it's located at C:\Program Files\IVI Foundation\IVI\Drivers\AgE36xx\Examples\VS.NET\Cpp\Example1).
I have been able to do all I wanted except getting an out-of-range error when passing an out-of-range value to a function. I set the RangeCheck init option to true but I did not get any error in simulation neither with the hardware connected.
Attached is the code (from the Agilent example) but modified in a way that it should throw an out-of-range error when setting the voltage at the following line: spOutput1->VoltageLevel = 1000; // ... why no error.
Still it's executing fine. Can anyone point me to what I'm not doing correctly.
You are using Simulate=true option, isn't it the cause?
If out-of-range error is not generated with real hardware connection, try to capture the VISA I/O log.
In OptionString, you are specifying both QueryInstrStatue=true and RangeCheck=true, so even if range-check facility has passed the 1000V value, the instrument shall generate an SCPI error if a "VOLT 1000" command is sent. Try to see what is reported by *ESR? or SYST:ERR? query, which shall be automatically sent after the VOLT command.
If the instrument still accepts 1000V value as a coerced MAX value without error, the IVI-COM driver may not generate exception.
Yes, you are right, the simulation option needs to be false to allow for range checking. If QueryInstrStatue=true, you only get an instument error pop-up window asking to use the ErrorQuery() command to get the specific error. If QueryInstrStatue=false, you have to use the ErrorQuery() command to read the specific error from the instrument.
When I send the 1000 V command, the instrument always beep (no matter what is the value of QueryInstrStatue) so I assume that the command is sent to the instrument and not filtered by the driver itself.
Good, the IVI-COM driver is apparently skipping range check facility. I believe this is because the IVI driver covers all the E3600 series models, supporting different volt & amps values and the driver designer skipped this portion to avoid complexity of implementation. In fact, when implementing an IVI-COM driver with Nimbus, it is easy to program fixed range check min/max values, but implementing dynamically changing ranges depending on the connected model type will require somehow complex codes to be written.