
60
(c) Spectrum Instrumentation GmbH
Julia Programming Interface and Examples
Software
Julia Programming Interface and Examples
Driver interface
The driver interface contains the following files. The files need to be included in the julia project. Please do not edit any of these files as they
are regularly updated if new functions or registers have been included.
file spcm_drv.jl
The file contains the interface to the driver library and defines some needed constants. All functions of the Julia library are similar to the above
explained standard driver functions.
file regs.jl
The regs.jl file defines all constants that are used for the driver. The constant names are the same names compared to the C/C++ examples.
All constant names will be found throughout this hardware manual when certain aspects of the driver usage are explained. It is recommended
to only use these constant names for better readability of the programs:
file spcerr.jl
The spcerr.jl file contains all error codes that may be returned by the driver.
Examples
Examples for Julia can be found on USB-Stick in the directory /examples/julia. The directory contains the above mentioned include files and
some examples, each of them working with a certain type of card. Please feel free to use these examples as a base for your programs and
to modify them in any kind.
hDevice::Int64 = spcm_hOpen(sDeviceName::String)
Cvoid spcm_vClose(hDevice::Int64)
dwErr::UInt32, lValue::Int32 = spcm_dwGetParam_i32(hDevice::Int64, lRegister::Int32)
dwErr::UInt32, llValue::Int64 = spcm_dwGetParam_i64(hDevice::Int64, lRegister::Int32)
dwErr::UInt32 = spcm_dwSetParam_i32(hDevice::Int64, lRegister::Int32 ,lValue::Int32)
dwErr::UInt32 = spcm_dwSetParam_i64(hDevice::Int64, lRegister::Int32, llValue::Int64)
dwErr::UInt32 = spcm_dwDefTransfer_i64(hDevice::Int64, lBufType::Int32, lDirection::Int32,
dwNotifySize::UInt32, pDataBuffer::Array{Int16,1},
qwBrdOffs::UInt64, qwTransferLen::UInt64)
dwErr::UInt32 = spcm_dwDefTransfer_i64(hDevice::Int64, lBufType::Int32, lDirection::Int32,
dwNotifySize::UInt32, pDataBuffer::Array{Int8,1},
qwBrdOffs::UInt64, qwTransferLen::UInt64)
dwErr::UInt32 = spcm_dwInvalidateBuf(hDevice::Int64, lBufType::Int32)
dwErr::UInt32, dwErrReg::UInt32, lErrVal::Int32, sErrText::String = spcm_dwGetErrorInfo_i32(hDevice::Int64)
const SPC_M2CMD = Int32(100) # write a command
const M2CMD_CARD_RESET = Int32(1) # 0x00000001 # hardware reset
const M2CMD_CARD_WRITESETUP = Int32(2) # 0x00000002 # write setup only
const M2CMD_CARD_START = Int32(4) # 0x00000004 # start of card (including writesetup)
const M2CMD_CARD_ENABLETRIGGER = Int32(8) # 0x00000008 # enable trigger engine
# ...
Содержание M2p.59 Series
Страница 190: ......