Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leeooox/nimvisa
nim wrapper for VISA instrument control libaray
https://github.com/leeooox/nimvisa
Last synced: about 2 months ago
JSON representation
nim wrapper for VISA instrument control libaray
- Host: GitHub
- URL: https://github.com/leeooox/nimvisa
- Owner: leeooox
- License: mit
- Created: 2020-10-27T09:24:03.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2020-11-04T07:26:01.000Z (almost 4 years ago)
- Last Synced: 2024-04-23T22:27:19.564Z (5 months ago)
- Language: Nim
- Size: 22.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-nim - nimvisa - Wrapper for NI-VISA instrument control library. (Hardware / Backups)
README
# nimvisa
nimvisa is C wrapper for NI-VISA instrument control libraryAs I cannot find a visa library for Nim, I decided to do it by myself.
**visa_wrapper.nim** is the FFI of C wrapper of NI-Visa to Nim
**nimvisa.nim** is high level based on visa_wrapper and inspired by [pyvisa](https://github.com/pyvisa/pyvisa). Only necessary procs(function) are implemented, and others to be done later when necessary.
## Installation
```shell
nimble install nimvisa
```## Testing your installation
```nim
let rm = newResourceManager()
echo rm.list_resources() # print all the resources.
```## Example
```nim
import nimvisa
# an example to control Rigol DP832 DC power supply by USB cable
let rm = newResourceManager()
echo rm.list_resources()
let my_instrument = rm.open_resource("USB0::0x1AB1::0x0E11::DP8C185151484::INSTR")
echo my_instrument.query("*IDN?")
my_instrument.write(":APPL CH1,0.6,0.4") # set channel 1 to 0.6V and current limitation to 0.4A
echo my_instrument.query(":APPL? CH1")
rm.close()
```As limited bandwidth, I only implemented it on windows10 64-bit system.