Type Library (DLL) for C/MRI Visual Basic Applications

 

The CmriVB.dll is a library of APIs (Application Programming Interface) that allow an application written in Visual Basic to easily communicate with the serial-based C/MRI (Computer Model Railroad Interface) system from JLC Enterprises, Inc.  This DLL will permit communication with the C/MRI from any computer running the Windows 95 or newer operating system.  You will find that this code looks radically different from the original QBASIC C/MRI code, but don't let this alarm you as it is actually quite simple once you look it over.  Full communications port functionality has been built into the DLL, leaving only the necessary serial port, USIC configuration components and the USIC APIs exposed to make the DLL functional.

 

CmriVB.dll Features

  • The CmriVB.dll supports the 24-bit Legacy USIC, SMINI USIC and 32-bit SUSIC nodes types.

  • Integrated communications port functionality, therefore, no need to use MSComm or Xmcomm Controls.

  • The DLL was written with Microsoft’s Visual C++ 6.0 using Microsoft’s COM (Component Object Model) platform interface standard.   COM technology allows a seamless integration between the Visual C++ platform and the Visual Basic development environment.  In addition, using the C++ language allows the processor intensive encoding and decoding of the USIC protocol to execute faster, versus an all BASIC coded routine, since less language interpretation takes place with C++.

  • The CmriVB DLL is structured so that bit packing/unpacking within your application is no longer necessary.  You can now read or write the status of each individual data line directly.  Please note, however, that bit packing/unpacking does have its advantages in that you can quickly read and write multiple data lines with a single variable.  If you prefer, you can perform localized bit packing and unpacking inside your application’s real-time loop, but this will slightly impact execution speed.

  • In addition, you no longer need to calculate Card Type (CT) values, since these values are now calculated within the CmriVB.DLL based upon the node configuration data setup by the user.  This includes not needing to calculate the CT values for the SMINI oscillating signals.

  CmriVB TypeLib The accompanying download contains a sample copy of the CmriVB.DLL, VBSimple Visual Basic Source Code and CmriVB.DLL usage documentation.  Note:  The sample copy of the CmriVB.DLL only supports the lower 16 bits (ports A & B) on any type of input and output card.  Please contact me at sfvetter@houston.rr.com for information on how to purchase a copy of the "full version".