Package: mcculw
InfoContains a Python API for interacting with Measurement Computing’s Universal Library in Windows. SeeGitHubfor the latest source.AuthorMeasurement ComputingAboutThemcculwpackage contains an API (Application Programming Interface) for interacting with the
I/O Library for Measurement Computing Data Acquisition products, Universal Library. This package
was created and is supported by MCC. The package is implemented in Python as a wrapper around the
Universal Library C API using thectypesPython Library.Note: Themcculwexamples included in version 1.0.0 and later are not backward compatible with pre-release
versions of themcculwPython package.  See theExamplessection for more details.mcculwis supported for Universal Library 6.55 and later. Some functions in themcculwpackage may be unavailable with earlier versions of Universal Library. Visithttp://www.mccdaq.com/Software-Downloads.aspxto upgrade your version of UL.mcculwsupports only the Windows operating system.mcculwsupports CPython 2.7 and 3.4+.Themcculwpackage is available onGitHubandPyPI.InstallationInstall Python version 2.7, 3.4, or later fromhttps://www.python.org/downloads/.Install the latest version of InstaCal fromhttp://www.mccdaq.com/Software-Downloads.aspx.Install the the MCC UL Python API for Windows (mcculw) and any dependencies using pip:Open the Windows command prompt: press Win+R, type cmd.exe and press Enter.Upgrade pip to the latest version by entering the following command:pip install --upgrade pipInstall the mcculw library by entering the following command:pip install mcculwNote: If you get a message like “pip is not recognized as an internal or external command…”, or
if you have multiple Python installations, enter the full path to the pip executable, such asC:\Python27\Scripts\pip install –upgrade piporC:\Python27\Scripts\pip install mcculw.
The pip command is in the Scripts subdirectory of your Python install location.ExamplesDownload theexamples zip filefrom themcculwGitHub repository.Unzip the examples to a known location, such as:C:\Users\Public\Documents\Measurement Computing\DAQ\PythonRefer to the knowledgebase articleImporting Python for Windows example programs into an IDEfor detailed instructions on how to import examples into popular IDEs such as Eclipse and Visual
Studio.Note: The latest examples take advantage of themcculw.device_infosubpackage
added in version 1.0.0. Software developed using the props subpackage included in
the examples folder of pre-release versions will continue to work with version 1.0.0
and later of themcculwPython package, but requires the inclusion of the props subdirectory.
See the mcculw GitHubReleasespage for a complete archive of previous releases.UsageThe following is a basic example of using the Universal Library to perform analog input. Further
examples may be found onGitHub.frommcculwimportulfrommcculw.enumsimportULRangefrommcculw.ulimportULErrorboard_num=0channel=0ai_range=ULRange.BIP5VOLTStry:# Get a value from the devicevalue=ul.a_in(board_num,channel,ai_range)# Convert the raw value to engineering unitseng_units_value=ul.to_eng_units(board_num,ai_range,value)# Display the raw valueprint("Raw Value: "+str(value))# Display the engineering valueprint("Engineering Value: "+'{:.3f}'.format(eng_units_value))exceptULErrorase:# Display the errorprint("A UL error occurred. Code: "+str(e.errorcode)+" Message: "+e.message)Support/FeedbackThemcculwpackage is supported by MCC. For support formcculw, contact technical support
throughhttp://www.mccdaq.com/Support.aspx. Please include version information for Python,
Universal Library and themcculwpackages used as well as detailed steps on how to reproduce the
problem in your request.Bugs/Feature RequestsTo report a bug or submit a feature request, please use themcculwGitHub Issuespage.DocumentationDocumentation is available in theUniversal Library Help.