04-26-2011 06:37 PM
Hi,
After I download latest NI-VISA 5.0.3, my VBA code doesn't work anymore. There is an error message
" VI_NULL : constant expression required" in below command
stat = viOpen(defaultRM, "TCPIP::xx.xx.xxx.xx::5000::SOCKET", VI_NULL, VI_NULL, sesn)
I don't know what number is proper for this VI_NULL.
Also I want to remove latest VISA version and use old one (4.6.2) . How could I do that? NI-VISA can't be removed as a normal software.
Thanks
04-26-2011 07:45 PM
The syntax is explained in the NI-VISA help and of course you can uninstall it. Select 'National Instruments Software' and see the list.
04-26-2011 10:00 PM
Thanks. I know how to uninstall the VISA.
But I still get that error message about VI_NULL. Any idea what happens?
On the same PC, I updatedTekVISA . Then when I update NIVISA to latest version, NIVISA renamed original VISA32.dll to be tek.visa32.dll. I includeVISA32.dll in my VBA code and see the error message for VI_NULL .
04-27-2011 07:27 AM
Try the VB keyword NULL.
04-27-2011 11:38 AM
Thanks.
I changed VI_NULL to be NULL
stat = viOpen(defaultRM, "TCPIP::xx.xx.xxx.xx::xxxx::SOCKET", Null, Null, sesn)
and an error meassge pops up " Invalid use of NULL".
Do we need modify the viOpen command?
05-03-2011 05:46 PM
VI_NULL is a constant defined in the file visa32.bas which is included with NI-VISA. We should make sure that visa32.bas is included in the VB project and that the file still exists where the project thinks it's located. This file could be installed in different locations over time -- latest install of NI-VISA may have installed it in a place different than the VB project expects it.
After search for visa32.bas and load it into VB project, the code has no more error