Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Agilent 6812B AC Power Source does not work with IVI class driver

Solved!
Go to solution
Solution
Accepted by dblok

Here is the 32-bit DLL with the additional Serial settings.  Make sure to add  the DLL to the path below

If on a 32-bit system \Program Files\IVI Foundation\IVI\Bin 

 

        /* Configure VISA Serial I/O */
        viCheckErr( viGetAttribute(io, VI_ATTR_INTF_TYPE, &iInterfaceType));

        /* Configure for RS232 (Serial) */
        if(iInterfaceType == VI_INTF_ASRL)
        {
            viCheckErr( viSetAttribute (io, VI_ATTR_TERMCHAR, '\n'));
            viCheckErr( viSetAttribute(io, VI_ATTR_TERMCHAR_EN, VI_TRUE));   
            
            viCheckErr( viSetAttribute(io, VI_ATTR_ASRL_END_IN, VI_ASRL_END_TERMCHAR));
            viCheckErr( viSetAttribute(io, VI_ATTR_ASRL_END_OUT, VI_ASRL_END_TERMCHAR));
            
            //viCheckErr( viSetAttribute (io, VI_ATTR_ASRL_FLOW_CNTRL, VI_ASRL_FLOW_DTR_DSR));   commented out couldn't find documentation in manuals for flow control
            viCheckErr( viSetAttribute(io, VI_ATTR_ASRL_BAUD, 9600));
            viCheckErr( viSetAttribute(io, VI_ATTR_ASRL_PARITY, VI_ASRL_PAR_EVEN));
            viCheckErr( viSetAttribute(io, VI_ATTR_ASRL_STOP_BITS, VI_ASRL_STOP_TWO));
            viCheckErr( viSetAttribute(io, VI_ATTR_ASRL_DATA_BITS, 7));                      
            
        }

        /*- Identification Query ------------------------------------------------*/

Message 11 of 13
(2,703 Views)

Thanks jjp377!  I'll give this a try tomorrow.

0 Kudos
Message 12 of 13
(2,694 Views)

Well, I got it to work finally.  The DLL did not work as is for me, but I was able to remove the attribute settings for the comport that could be setup in NI MAX and left the TERMCHAR settings as is.  I rebuilt the DLL and tried it out and it worked.

 

We have been working with NI in parallel with posting this on the forum and NI did reply back with the following:

 

"I spoke with some colleagues about the IVI driver in question. It appears, as far as we can tell, that NI did not develop it. Because of this it would be unlikely we would make any updates to it. It doesn't appear that there is any simple configuration step that we were missing either. One sugguestion offered is that the driver will likely work using GPIB. If switching from RS-232 is an option for you I would recommend trying this.  I'm sorry for the unfortunate news, and especially for the time it took to get it to you. Please let me know if you have any questions or if there is anything else I can do for you!"

 

I will post the updated DLL I used in case someone else needs to use it in the future.  Thanks for all the help!

 

0 Kudos
Message 13 of 13
(2,651 Views)