Galil DMC32 OSU
 All Files Functions Pages
Operating System Upgrade (OSU)
Attention
This is the initial beta release of this library. Library operation and especially the contents of registry.xml are subject to change. Please contact softw.nosp@m.ares.nosp@m.uppor.nosp@m.t@ga.nosp@m.lilmc.nosp@m..com with questions and concerns.

This library is intended for existing applications that used software based on the legacy C DMCWIN32 library for Windows XP and earlier. If such an application must be upgraded to Windows 7, 8, or 8.1, DMC32 OSU can be used on these O.S. upgrades. An alternate library, gclib, is recommended for users able to change their source.

Note
DMC32OSU is not a full port of the original library. Rather, it includes the most popular functions of the original. See the updated Dmccom.h for the supported functions. If more functions are required, please contact softw.nosp@m.ares.nosp@m.uppor.nosp@m.t@ga.nosp@m.lilmc.nosp@m..com.

Required DLLs

DMC32OSU was built using MSVC2013 and requires run-time components available in the Visual C++ Redistributable Packages for Visual Studio 2013. On machines that don't already have Visual Studio 2013 installed, the required files can be installed from Microsoft. Be sure to install the appropriate architecture (x86 or x64).

DMCClose()

Attention
As with the original library, DMC32 OSU requires that DMCClose() be called whenever a program is finished with a controller. This includes when a program closes. A rule of thumb is that for every DMCOpen() call on a given connection, a DMCClose() call should be found on every code path.

Windows Registry

The legacy version stored controller information and connection options in the Windows Registry. This data store has been replaced with storage to the file registry.xml.

About registry.xml

The use of the Windows Registry for controller information is replaced with the use of an XML file. The function calls which previously required an index into the registry enumeration will instead index into the XML hierarchy at the number attribute. The XML file must be in the working directory of the executable and have the file name registry.xml or DMCERROR_RESOURCE will be returned from DMCOpen(). The version tag of the XML file must match the XML_VERSION definition in dmc32.dll or error DMCERROR_RESOURCE will be returned on DMCOpen(). See the examples directory for an example registry.xml.

The address tag

The file registry.xml contains an address tag which determines connection options. The following table documents the options for dmc32osu.

address switch Meaning Arguments (default), other options Examples
--address Simple address to hardware valid IP, COM_, GALILPCI_ --address COM1
-a shorthand for --address -a GALILPCI1
{no switch} --address is implicit for any lone token 192.168.0.42
--baud Baud rate (115200), valid baud... COM2 --baud 19200
-b shorthand for --baud COM3 -b 38400
--command Command-and-response socket protocol (TCP), UDP 192.168.0.42 --command TCP
-c shorthand for --command 192.168.0.42 -c UDP
--direct Connect directly. REQUIRED for this version of dmc32osu.-a GALILPCI2 --direct
-d shorthand for --direct GALILPCI2 -d
--handshake Serial Handshake mode (HARDWARE), NONE COM1 --handshake NONE
--p1 Primary port for command-and-response traffic (23), valid port number 192.168.0.42 --p1 5000
--p2 Secondary port for unsolicited traffic (23), valid port number 192.168.0.42 --p2 5000
--subscribe Subscribe to messages, data records, and/or interrupts (NONE), MG, DR, EI, ALL 192.168.0.42 --subscribe MG
-s shorthand for --subscribe 192.168.0.42 -s DR -s EI
--timeout timeout in ms (5000), 0-65535 192.168.0.42 --timeout 5000
-t shorthand for --timeout GALILPCI2 -t 500
--unsolicited Unsolicited socket protocol (UDP), TCP, NONE 192.168.0.42 --unsolicited TCP
-u shorthand for --unsolicited 192.168.1.42 -u NONE

Interrupts

Interrupts are not exposed to the user in dmc32osu. Setting -s EI or -s ALL will not provide interrupt access.

CFI

The legacy version of DMC32.dll defaulted to receiving unsolicited messages on the primary TCP handle. This is not recommended, but is supported in the OSU. Set the sendcfi tag value to true to send CFI over the primary command-and-response handle at connection.

Installed Files

A typical installation looks like the following.

C:\Program Files (x86)\Galil\dmc32osu>tree
Folder PATH listing
Volume serial number is F43C-483A
C:.
├───bin
│   ├───x64
│   └───x86
├───doc
│   └───html
│       └───search
├───examples
│   ├───mingw
│   └───msvc
│       ├───2012_11.0
│       │   └───dmc32osu_example
│       │       └───dmc32osu_example
│       └───2013_12.0
│           └───dmc32osu_example
│               └───dmc32osu_example
└───lib
    ├───x64
    └───x86

bin

The bin directory contains the binary runtime (dmc32.dll) for both x86 and x64 architectures. The executable must have the correct dmc32.dll in its path at runtime. Note that if SmartTerm or any other legacy library was installed on the system previously, the legacy dll may be in the path. On x64 systems, check C:\windows\SysWOW64 for dmc32.dll. This is the old version and should be removed or renamed. To ensure you are using the correct dll, use DMCVersion and check for "(OSU)". The following are sample outputs.

Galil Motion Controller DMC4020 Rev 1.2b (OSU) 192.168.0.43
Galil Motion Controller DMC1846 Rev 1.0c (OSU) GALILPCI1
Galil Motion Controller DMC4020 Rev 1.2b (OSU) COM1

The dll has been exported with the same ordinals as the legacy library. If the application uses only functions supported in the new Dmccom.h, recompilation may not be necessary.

doc

The doc directory contains this documentation.

examples

The examples directory contains an example registry.xml as well as example projects for various compilers.

Warning
Before using the examples, copy the files to a user location such as C:\Users\user\Documents. Failing to do so may cause source files to be deleted upon dmc32osu uninstallation.

lib

The lib directory contains linker files (dmc32.lib) for both x86 and x64 architectures, and the header file Dmccom.h. The compiler needs to know the location of the header file and the linker should include dmc32.lib.

Technical Support

For help with dmc32osu, please email softw.nosp@m.ares.nosp@m.uppor.nosp@m.t@ga.nosp@m.lilmc.nosp@m..com, or call Galil Applications.