Spectrum Software
spacer
Industrial Strength Simulation
select:

divider

 

News:

Spectrum Software has released Micro-Cap 11, the eleventh generation of our SPICE circuit simulator.

For users of previous Micro-Cap versions, check out the new features available in the latest version. For those of you who are new to Micro-Cap, take our features tour to see what Micro-Cap has to offer.

 

divider

 

Centralizing Component, Shape, and Model Files

 

When multiple Micro-Cap users are working together, a common need is to share models among all of the users. If the Micro-Cap installations are on the local drives of each of the users, there are two main methods for exchanging models. The first method requires that the library or macro file be passed to each user manually, and then the component and shape information would need to be imported by the individual user. This method can be a bit tedious depending on the number of users who need access to the model. The second method, which will be the procedure covered in this article, is to create a shared directory where the users can centralize all of their component, shape, and model files in.

The most obvious requirement for centralizing files is that there is a shared location which all of the users have access to. For this article, the shared directory will be:

Z:\MCAP\

The second requirement is that all the data to be shared needs to be in new files not just appended to the files distributed with Micro-Cap. This is typically the case with library files that contain the model information. However, many users who add data in the Component or Shape editors input the data into the Standard.cmp (component file) and the Standard.shp (shape file). For centralizing the component and shape information, the users would need to create new CMP and SHP files to store the component and shape data.

Shape files
The shape (.SHP) files contain all of the shape information that Micro-Cap uses and are created and maintained through the Shape Editor. To create a new shape file, access the Shape Editor under the Windows menu. Click on the New File icon, and a New File dialog box will appear. Change the Save In field so that it points at the shared directory the files will be centralized in. In this case, the path would be Z:\MCAP\. Give the file the desired name, and then click the Save button. A new SHP file will be created in the shared directory. Any new shapes should be created in this file.

If the user has already created shapes prior to sharing the files, the technique to centralize them will depend on which file the shapes are located in. One possibility is that the shapes were created in a separate shape file from the Standard.shp file that is distributed with Micro-Cap. In this case, the first step is to select the shape file from the drop down list box right below the Shape Editor toolbar. Click the Remove File icon. This command removes the shape file from memory. Now the shape file will need to be moved over to the shared directory. Any of the normal Windows operating system file movement operations can be used to do this. Once the file has been moved to the new directory, click the Open File icon in the Shape Editor, and load the shape file from the new directory.

The other possibility is that the shapes were created in the Standard.shp file. First, create a new shape file in the shared directory as described above. Then select the Standard.shp file in the drop down list box below the toolbar. Select a shape that needs to be shared. Click on the Select All icon, and then click the Copy icon. In the drop down list box, select the new shape file. Click the Add button. Make sure that the name assigned to the shape is the same name as defined in the Standard.shp file. Click the Paste icon. Drag the entire shape so that it matches the grid alignment of the copy in the Standard.shp file. The shape's location should visually line up when switching between the two files. If the grid alignment is off, the shape will appear offset in the schematics. Return to the Standard.shp file and delete the instance of the shape in that file. Micro-Cap will use the first instance of a shape it finds so deleting the shape ensures that it will find it in the new shape file. Repeat the copy and paste process for all the user created shapes that need to be shared.

All other users who want access to this shape file will need to use the Open File icon in the Shape Editor to load the shape file into their copy of Micro-Cap. When a shape file is either created or opened by a user, the file will be loaded into their copy of Micro-Cap whenever the program loads until the file is manually removed by the user through the Remove File icon in the Shape Editor. Clicking on the drop down list box right below the Shape Editor toolbar lets you switch between the shape files that are currently loaded.

When loading both a shape and a component file from another user, the shape file must be the first one loaded since the component file will have references to its corresponding shape file. If this is done out of order, no error message will appear. However, any components that reference a shape that is not loaded will have its shape set to a default shape which is typically the battery.

Component files
The component (.CMP) files contain all of the component information that Micro-Cap uses and are created and maintained through the Component Editor. To create a new component file, access the Component Editor under the Windows menu. Click on the New File icon, and a new file will be added to the component tree on the right side of the editor. The file will initially be located in the same directory as the MC8.EXE file and called New.cmp. To change the path and name of the file, highlight the file reference in the component tree. The path and file name will now be available for editing. In our case, we would change the reference to something such as:

Z:\MCAP\Shared.cmp

Any new components should be created in this file. When the Component Editor is closed and saved, the Shared.cmp file will then be created in the Z:\MCAP\ directory.

As with shapes, components that the user has already created may be present in a separate component file or in the Standard.cmp file that is distributed with Micro-Cap. If the components were created in a separate component file, the path reference for the file will need to be changed in the Component Editor. Highlight the file reference in the tree on the right. Simply overwrite the old path with the path to the shared directory. When the Component Editor is closed and saved, a new instance of the component file will be created at the path specified. A copy of the file will still exist in the folder it was previously assigned to, but any future changes will only modify the file in the directory pointed to within the Component Editor.

If the components were previously added into the Standard.cmp file, the first step is to create a new component file in the shared directory as described above. In the component tree, components may be moved between files by dragging on a component, and then dropping the component onto the + or - square next to the destination group name or onto a component that already exists within that group. Repeat the move process for all the user created components that need to be shared.

All other users who wish to access the component file will need to use the Open File icon in the Component Editor to load the component file into their instance of Micro-Cap. When a component file is created or opened by a user, the file will be loaded into Micro-Cap whenever the program loads. To prevent a file from loading with Micro-Cap, highlight the file reference in the component tree and then click the Delete icon. Clicking the Delete icon when a file reference is selected will only remove the file from the component library, it does not delete the file from the hard drive.

Library Path
Micro-Cap uses the library path to point to where the macro and library files are stored. The library path may be edited through the Paths option available under the File menu. Multiple paths may be specified by delimiting the paths with a semi-colon. For centralizing files, one path should point at the shared directory while another continues to point to the Library directory that is installed with Micro-Cap. The Model Library field within the Paths dialog box can be specified as:

Z:\MCAP\;C:\MC8\LIBRARY\

Placing Z:\MCAP\ first in the list will give it the highest priority. Whenever Micro-Cap needs a library file or a macro file, it will search all the directories listed here in order from left to right.

Paths dialog box

Macro Files
Save all macro files into the shared directory. As long as the user's Library path above points to the shared directory, Micro-Cap will be able find them.

Library Files
As with the macro files, the library files to be centralized should be copied over into the shared directory. The main difference between library files and macro files is that the library files need to have a reference in the Nom.lib file in order for Micro-Cap to automatically search them when looking for models. A good method for modifying the Nom.lib file for shared files will be explained in the next section.

Nom.lib File
The Nom.lib file is located in the Library directory below the main Micro-Cap folder. It is simply a text file that contains a list of all of the libraries that Micro-Cap will automatically search through when a model needs to be located. Each library should be referenced in this list by using a .lib statement. For the user that creates the entries in the Component Editor, the libraries are automatically added into the Nom.lib when the Import Wizard or Add Part Wizard is used. All the other users who want Micro-Cap to have access to a library file would need to manually add the library reference to their Nom.lib file.

When centralizing library files for multiple users, there is a nice technique available where the library list can be updated globally so that each user does not have to manually add each library to their Nom.lib. For this example, three libraries have been placed in the Z:\MCAP\ shared directory: Andy.lib, Bill.lib, and Tim.lib. A new text file should now be created in the Z:\MCAP\ directory. We'll call it Share.lib. In this file, place .lib statements that reference all of the libraries that are to be shared such as:

.lib "Andy.lib"
.lib "Bill.lib"
.lib "Tim.lib"

Each user would then need to edit their individual Nom.lib file by adding in a reference to the Share.lib such as:

.lib "Share.lib"

so that the Nom.lib will reference the Share.lib file which in turn will reference all of the libraries in the shared directory. Now if a new library is added into the Z:\MCAP\ library, the user just needs to add a .lib statement referencing the library into the Share.lib file. All users who have the Share.lib referenced in their Nom.lib file would then automatically have the new library available to them. Again, the Library Path in the Paths dialog box would need to point at the location the library files are stored at for this method to work. Otherwise, absolute paths would need to be defined for the .lib references.

 
Return to the main Newsletter page