| 
  |
| . | 
   
      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 Release NotesInstallationThe 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. 
 Important File LocationsThe following table lists important files and their installed locations: 
 
 Downloading MechaWare Models to the ControllerThe MechaWare VxWorks package is distributed with the MechaWare Model Download Library, which contatins two files:  These functions are used to read and write MechaWare models from  meiMWModelDataDownloadOverviewDownloads MechaWare models to the controller. Prototypelong meiMWModelDataDownload(MPIControl control, MWData *mw, long mapFile) Parameters
 
 meiMWModelFileReadOverviewReads the specified  Prototypelong meiMWModelFileRead(long file, MWData *mw) Parameters
 
 meiMWModelFileWriteOverviewWrites an  Prototypelong meiMWModelFileWrite(long file, MWData *mw) Parameters
 Sample CodeThe following sample code illustrates the use of the MechaWare model download library. An bin file,  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;
}
      
  | 
  ||||||||||||||||||||||||||||||||||||||||||||||
| | | Copyright © 2001-2021 Motion Engineering |