.

MechaWare VxWorks Package

 

This page includes release notes for the MechaWare VxWorks Package and instructions on how to use MechaWare with the current release of the MPI VxWorks package.

Table of Contents

  1. Release Notes
    1. Installation
    2. Important File Locations
  2. Downloading MechaWare Models to the Controller

Release Notes

Installation

The MPI VxWorks package must be installed before installing the MechaWare Vxworks development package. The installations must be performed in the order indicated in the table below and in their default installation paths.

Order Installation File Path
1 MPI_Release_03.04.12_WinNT.zip C:\MEI
2 MPI_Release_03.04.12_VxWorks5.5.zip C:\MEI
3 MechaWareRelease_03.02.03.zip (Win Installer)

C:\MEI

4 MechaWare_03.02.03_VxWorks_Development_Package.zip C:\
Important File Locations

The following table lists important files and their installed locations:

Filename Description Path
mdl2mw.o MechaWare Model Downloader (see MechaWare Model Downloader for full documentation) C:\MEI\XMP\bin\VxWorks\
sample_modelLoader.c Sample C code utilizing the MechaWare Model Download Library. C:\MEI\MechaWare\Samples\C\

 

Downloading MechaWare Models to the Controller

The MechaWare VxWorks package is distributed with the MechaWare Model Download Library, which contatins two files: MwLoader.a (the object library) and MwLoader.h (library header). The object library contains three functions:

  1. meiMWModelDataDownload
  2. meiMWModelFileRead
  3. meiMWModelFileWrite

These functions are used to read and write MechaWare models from .bin files (which can be generated using the -save option in mdl2mw) and download the models to the controller. The following documentation provides an API reference for the library and sample code illustrating the library's use in an application.

meiMWModelDataDownload

Overview

Downloads MechaWare models to the controller.

Prototype
long meiMWModelDataDownload(MPIControl control, MWData *mw, long mapFile)
	  
Parameters
Parameter Description
MPIControl control
MPI control object
MWData *mw
Pointer to a MechaWare intermediate file data structure (defined in MwLoader.h). There are no user modifiable members of this structure.
long mapFile

Optional file handle for writing map files. This should normally be NULL(0) for any OS except Windows.

 

meiMWModelFileRead

Overview

Reads the specified .bin file into an MWData data structure.

Prototype
long meiMWModelFileRead(long file, MWData *mw)
	  
Parameters
Parameter Description
long file
A handle to the .bin file to read from.
MWData *mw
Pointer to a MechaWare intermediate file data structure (defined in MwLoader.h). There are no user modifiable members of this structure.

 

meiMWModelFileWrite

Overview

Writes an MWData data structure to the specified .bin file.

Prototype
long meiMWModelFileWrite(long file, MWData *mw)
	  
Parameters
Parameter Description
long file
A handle to the .bin file to read from.
MWData *mw
Pointer to a MechaWare intermediate file data structure (defined in MwLoader.h). There are no user modifiable members of this structure.

 

Sample Code

The following sample code illustrates the use of the MechaWare model download library. An bin file, inputfile.bin, is read in with meiMWModelFileRead and then downloaded onto the controller with meiMWModelDataDownload. The intermediate data structure, mw, is modified and then written out to outfile.bin with meiMWModelFileWrite.

This sample code file is included in: C:\MEI\MechaWare\Samples\C\sample_modelLoader.c

#include "stdmpi.h"
#include "stdmei.h"
#include "MW.H"

#include "MwLoader.h"
#include "apputil.h"

MWData 			mw;


int	main(int	argc,
        char	*argv[])
{
  MPIControl		control;	/* motion controller handle */
  MPIControlType	controlType;
  MPIControlAddress	controlAddress;
  long returnValue;
  
  long			argIndex;
  long 			infile, outfile;
  char* 		infilename = "inputfile.bin";
  char* 		outfilename = "outputfile.bin";
  
  /* Parse command line for Control type and address */
  argIndex =
    argControl(argc,
         argv,
         &controlType,
         &controlAddress);

  
  control = mpiControlCreate(controlType, &controlAddress);
  returnValue = mpiControlValidate(control);
  msgCHECK(returnValue);
  
  returnValue = mpiControlInit(control);
  msgCHECK(returnValue);

  infile = meiPlatformFileOpen(infilename, 
           MEIPlatformFileModeREAD | MEIPlatformFileModeBINARY);

  returnValue = meiMWModelFileRead(infile, &mw);
  msgCHECK(returnValue);

  returnValue = meiMWModelDataDownload(control, &mw, NULL);
  msgCHECK(returnValue);

  mw.ModelCount = 3;
  outfile = meiPlatformFileOpen(outfilename, 
            MEIPlatformFileModeWRITE | MEIPlatformFileModeBINARY);

  returnValue = meiMWModelFileWrite(outfile, &mw);
  msgCHECK(returnValue);

  return returnValue;
}

 

       Legal Notice  |  Tech Email  |  Feedback
      
Copyright ©
2001-2021 Motion Engineering