Author Topic: VisaNS (archived) or NI-VISA .NET API (sparse docs) or PyVISA for new project  (Read 2587 times)

0 Members and 1 Guest are viewing this topic.

Offline jneudorfTopic starter

  • Newbie
  • Posts: 4
  • Country: ca
For a new project, I need to talk to <some generic visa measurement device> to sense currents, and also communicate with my homebrew product (using an FTDI cable) in order to calibrate it.  At the moment, I'm using windows 10, but I'm not totally opposed to using Linux. I presume I'll eventually use something like a Chroma 6310A load, but at the moment, I only have an oscilloscope and RS232 DMM (UT61E); the load is something I'm negotiating to get.

I've found various code to talk to things such as the Rigol DS1102E scope using the VisaNS API, but National Instruments has archived the documentation.  The new NI-VISA .NET API seems to be what NI is pushing these days, but I can't find any examples that use it: they seem to be pushing their $4000 measurement studio to use a wizard to generate wrapper APIs. 

Does anyone have examples using the NI-VISA .NET API? Or should I use one of the other approaches? Which?

For marketing purposes and/or impressing the boss it would be nice if there were a GUI, but it's not REALLY essential.
 

Offline pigrew

  • Frequent Contributor
  • **
  • Posts: 680
  • Country: us
Personally, I use C# with the "new" IVI .Net VISA library. The advantage is that it is compatible with both NI and KeySight VISA software.

I have a (buggy) example on GitHub of a program to control some HP power supplies.
 
The following users thanked this post: jneudorf

Offline JohnPi

  • Regular Contributor
  • *
  • Posts: 158
  • Country: us
I use PyVISA for these types of tasks. It can easily communicate with instruments on GPIB, RS232 or USB. It'll work in Linux, OSX or Windows. You'll have to use Python which has its quirks, but pretty easy to get going.

I suggest you start with INSTRUMENT.query("*IDN?") type statements to confirm connectivity to the VISA gear. For your home-brew RS232 (which won't have VISA), you can send and receive strings via the serial port.
 

Offline dl1640

  • Regular Contributor
  • *
  • Posts: 222
  • Country: cn
i am learning Python and installed Python 2.7 for windows,
i think i will learn PyVisa after i grasped Python fundermantals.
currently i use another api to control instruments (GPIB, RS232, VXI, USBTMC) in vba.
 

Offline petemate

  • Regular Contributor
  • *
  • Posts: 126
i am learning Python and installed Python 2.7 for windows,
i think i will learn PyVisa after i grasped Python fundermantals.
currently i use another api to control instruments (GPIB, RS232, VXI, USBTMC) in vba.

Why python 2.7? It's old and not recommended anymore. Go with 3.7.

Also, another vote for pyvisa.
 

Offline dl1640

  • Regular Contributor
  • *
  • Posts: 222
  • Country: cn
i am learning Python and installed Python 2.7 for windows,
i think i will learn PyVisa after i grasped Python fundermantals.
currently i use another api to control instruments (GPIB, RS232, VXI, USBTMC) in vba.

Why python 2.7? It's old and not recommended anymore. Go with 3.7.

Also, another vote for pyvisa.

thanks,
I just learning with online instructions and intended to start with a relatively older version. and I would probably change to 3.x in the near future.
anyway, there will be no huge project for me, just need to talk to the instruments, data logging, file manipulating etc. 

though VBA works just fine i found Python kind of smarter than vb in syntax.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf