|
|
luagpib OverviewA library for the lua programming language to access measurement instruments via the GPIB bus.The package contains a compiled lua interpreter. It does not require any other software besides an installed GPIB card supporting the NI488 standard. Example-- ***************************************************************
-- * Load GPIB dll interface
-- ***************************************************************
require('gpib_libloader')
-- ***************************************************************
-- * Query *IDN? response
-- ***************************************************************
local h=ibdev(0, 19) -- board 0 addr 19
ibwrt(h, "*IDN?")
print(gpib.ibrd(h))
-- ***************************************************************
-- * Clean up
-- ***************************************************************
ibloc(h) -- return local control
ibonl(h, 0) -- close instrument connection
gpib.shutdown() -- unload DLL
Download the example here DownloadDownload the whole package here (contains executable and source)Using luagpibA lua interpreter is included in the bin directory.Run it from the command line, and give for example the test.lua program as a 2nd argument: When no GPIB card is found, an error message as shown results. If the necessary drivers are not found, there will be a different error about a missing DLL. ReferenceA good description of the gpib functions can be found from the linux-GPIB documentation.At least Agilent and National Instruments cards are shipped with a command reference in the software package.
compiling luagpibLuagpib is compiled using Mingw on Windows.From the command line, type
By default it compiles against the included lua 5.1 interpreter. It also works with wxlua, if the lua dll and the headers are replaced with their wxLua counterparts. © Markus Nentwig 2007-2008 The content of this page is provided without any warranty and may not be reproduced without permission. Comments? Questions?Please send me a mail! mnentwig@elisanet.fi |