Applications

The C3Dserver installation includes several useful applications, complete with source code that can be complied into fully functional applications - allowing almost any programmer to be writing programs to access C3D files within a few hours of installation - just declare a few variables and call a single function to create a C3D file that can be read by anyone.

A free VB C3D file editor

A simple C3D file editor written in Visual Basic is included with the C3Dserver. This provides an essential tool for developers allowing C3D files to be edited and viewed and demonstrating C3D file access functions via the C3Dserver. The installation includes a user manual enabling first time users to explore the C3D file format.

The free VB C3D file editor is written in Visual Basic with all file access provided via calls to the C3Dserver and is supplied with complete Visual Basic source code using the C3Dserver. This is an excellent demonstration of the C3Dserver in a real world application.

C3Dserver VB integration

The C3Dserver installation includes sample Excel files that demonstrate how the C3Dserver can be used in the Microsoft macro application environment.

C3Dserver test software

In addition to sample applications, the C3Dserver installation installed source code and executable "test harness" software applications that demonstrate the creation of C3D files from scratch (with C++ source code) and a Visual Basic software test harness allowing the user to demonstrate and verify each of the C3Dserver functions.

In both cases full application source code is supplied to demonstrate each of the C3Dserver functions.

MATLAB access

The C3Dserver is available as 32-bit and 64-bit versions - both versions provide identical C3D access functions. If you have installed the C3Dserver on a computer with a 32-bit operating system then you will only be able to run 32-bit applications and the 64-bit C3Dserver DLL will not be installed.

If you install the C3Dserver on a computer with a 64-bit operating system then seperate 32-bit and the 64-bit DLLs will be installed allowing the C3Dserver to be used with both 32-bit and 64-bit applications.

The 64 bit DLL will be installed as C:\Program Files\Common Files\Motion Lab Systems\C3Dserver\c3dserver64.dll

The 32-bit DLL will be installed in C:\Program Files (x86)\Common Files\Motion Lab Systems\C3Dserver\c3dserver.dll

By default, all of the supplied MATLAB example code is written for the 32-bit environment using c3dserver.dll - if you are working in a 64-bit environment then you will need to edit the supplied example code. To use the 32-bit C3Dserver simply copy the C3Dserver MATLAB\C3D directory to your MATLAB path. Choose a variable name (for example: 'test'), and type at the MATLAB prompt:

>> test = c3dserver

A COM object variable 'test' is now loaded. Once loaded, the C3DServer functions are considered 'methods' of the class COM.C3DServer_C3D. The status and version of C3DServer you are using will be displayed (access is limited in evaluation mode). There are several MATLAB functions that will show you the 'methods' (ie. functions) available through C3DServer. For example, type any of the following:

>> methods(test) ; invoke(test) ; methodsview(test)

The M-files can now be used as typical MATLAB functions to open, save, create, or close a *.c3d file. For help, type: help 'function name'. To open a file, type:

>> openc3d(test)

Also notice additional arguments for increased flexibility in some of the functions and with access to all of the functions in C3Dserver, users can now write additional MATLAB functions (similar to those M-files in the toolbox) to perform operations on the data in C3D files.

Please Note: The BYTE byScaled arguments for functions in the C3Dserver manual must be input into MATLAB code as a string (ie. in single-quotations). As an example, the final argument in the following code needs to be in single quotation marks thus"

>> xyzpos = test.GetPointData(0, 0, test.GetVideoFrame(0), ‘1’);

LabVIEW access

Incorporating the C3D server into LabVIEW is simple using the ActiveX VIs. These VIs are found on the Functions Palette under Connectivity –> ActiveX.

  1. Place the “Automation Open” VI on the block diagram.
  2. Create a refnum control input. On the front panel, right click the refnum control and choose Select ActiveX Class -> Browse, then browse to the C3DServer.dll (Generally under C:\WINDOWS\system32).
  3. Get an invoke node from the ActiveX palette and wire the refnum into it. Right click on the Method and you will be able to choose from any of the C3D server functions.
  4. Wire inputs and outputs as needed.
  5. Finish with the “close reference” VI.

Note that a lot of the functions can be run in parallel, without passing the refnum sequentially. However, error checking may require sequential code. An example VI supplied in the LabVIEW directory when the C3Dserver is installed - this reads the 3D marker coordinates and associated labels from a .C3D file into LabVIEW. It was written using LabVIEW 8.2.