0

Source file organization strategies, and use within Editor 8.0 Projects

During recent User Group meetings, a topic came up for discussion that is very important to consider for everyone interested in using Projects within MET/CAL Editor 8.0. Before importing or converting procedures to *.mc files for use within the new Editor, I recommend creating a "scratch" directory to use for testing and discovering how the Editor now stores procedures as text source files by default. Once you are comfortable with how the new Editor handles procedures as *.mc files, I recommend developing a strategy for how you want these files to be organized on your hard drive which complies with your company's quality system.

Many customers may elect to use subprocedures to maximize the re-use of procedure source code. Using a subprocedure to display your Copyright is an excellent example that I like to use. Here is an example of a directory structure that may help keep your source files organized, any or all of the layers can be optional:

.\subs_common\
.\subs_reference\manufacturer\model_family\model\
.\uut\manufacturer\model_family\model\remote_interface\

By keeping common subprocedure code as universal as possible, the source files can be placed as high up the directory path chains as possible, and the code can be reused over and over again. This can decrease both development and maintenance time.  Once the files are organized as desired, they can be added to any Editor 8.0 Project by right-clicking the Project within the Solution Explorer, then selecting Add > Existing Item (or use Shift+Alt+A).  This creates a link to the existing file, and any edits will be saved to the original location.  This also means that the next time any Project with a link to this same file is opened, it will reflect all changes made previously (e.g. the Copyright year).  It is important to note that changes to the procedure *.mc files will not be reflected into those procedures are Published to a proc.dir, or a new procedure package is Published ( either *.pkm or *.pxe).

11 comments

Date Votes
0
Avatar
Chad D.

 

After receiving questions and comments on this subject, I thought it may be helpful to create a graphic to go along with the text description above.  Please find the PDF diagram using this link.
0
Avatar
Chad D.

I received another great question related to this subject, and wanted to share my responses for the benefit of the community:

Question:

How can you batch-update several projects that are using the same sub-procedure?  This being one of the advantages with projects and solutions from what I understood...

Today I’ve taken them one by one and remove/deleted the obsolete version, right-click the projects and manually add the updated ver.  ...I’m sure there must be a more efficient method, right?

Answer:

Adding procedures to a project creates a pointer from the project to the text file source, it does not replicate the file.  If you add one common subprocedure’s *.mc file to each of your projects, and then update the contents of that file and save it (within the Editor, or even Notepad), each project automatically reflects the update as soon as that *.mc file is saved.  The procedure(s) can then be published to update the proc.dir, or the project(s) can be published to create a new procedure package.

Follow-up question:

Follow you on the pointer issue, however what you say implies that you do need to re-compile (re-build/publish) each project one by one, correct?  I was simply hoping there were a method to batch-updated all projects or solutions at one shot.

Follow-up answer:

If you are working with the traditional proc.dir, select the procedure or procedures that were edited and click Build > Publish Selected Procedures.  This will update the proc.dir with the changes, just like saving the procedure did in version 7.3 and earlier.

If you need to produce updated packages (PKM or PXE), select the Solution that contains all of the Projects which you want to rebuild.  Click Build > Build Solution to build every Project within the Solution, or click Build > Batch Build to select some or all of the Projects within that Solution which need to be rebuilt.

The build progress can be observed in the Editor’s Output window (View > Output).  The build will place the output for each Project into a temporary bin directory, which will be located one directory below each Project.  Each bin directory will contain the new package, and may also contain other files depending on the Projects’ property settings.  It sounds like you have organized your Projects in a logical fashion, which should make it easy to locate the new packages by using the search function in Windows Explorer.  Using Explorer, navigate to a parent directory that is above all Projects which were just rebuilt.  Perform a search, including subdirectories, for *.pkm to find all PKM files, *.pxe for PXEs, *.zip for project zip archives, etc.  Windows Explorer will display a list of all of the new packages, which should be copied or moved from the temporary bin directories to a more permanent location.  The contents of the bin directory are automatically wiped out each time a build is performed, which includes every time Debug Mode is started.

0
Avatar
Patrick Butler

Thanks for sharing that detailed information. I can see where I messed up with my strategy. I was creating standalone solutions, basically one project per solution. I need to reorganize things into solutions. What is the best way to take existing projects and put them into solutions so I can take advantage of batch build?

0
Avatar
Chad D.

Hi Pat, it sounds like you can keep all of the existing work that you have in place, where one Solution contains one Project.  This is perfectly fine, and sometimes even desired!  In order to build a structure similar to the diagram above with a stacked heirarchy of Solutions, you will want to create a new, blank Solution at whichever "level(s)" you choose.  Once a blank Solution is created, you can then add as many existing Projects to it as you like.  Here are the steps to use:

  1. In the Editor, click File > New > Project.
  2. A New Project dialog opens up, and should display two Installed Templates in the left pane of the window.  Select the Blank Solution template.
  3. Before proceeding, note that steps 4 and 5 will use existing folders if they already exist, or create new folders where they do not.  See below for an example, plus a tip.
  4. In the Name field near the bottom, enter the desired Solution name.
  5. In the Location field near the bottom, either enter the path where you want the blank Solution to reside, or click the Browse button and browse to the desired location for your Solution.
  6. Click OK to create the new blank Solution.
  7. To add existing Projects, from the Editor's Solution Explorer, right-click on the Solution and select Add > Existing Project.
  8. Browse to the existing Project, select it, then click Open to add it to your Solution.
  9. Repeat Steps 7-8 to add as many Projects as you like to your Solution.

Example:

Name: "My Sample Solution"
Location: "C:\temp"
This will create a Solution at "C:\temp\My Sample Solution\My Sample Solution.mcsln".

Here is a tip for using a slightly more advanced method to insert a Solution into a directory structure that is already in place, where I don't want the Editor to create any new directories:

  1. Using the same basic steps outlined above, first use the Location Browse button to select the path where I want my Solution (the *.mcsln file) to reside.
  2. After browsing to the path and making a selection, it will be inserted into the Location field for you.
  3. Select the last branch of the Location field (the folder past the final backslash), cut it (using Ctrl+X), then paste it into the Name field (using Ctrl+V).
  4. This method will result in your Solution being placed into an existing directory, with a Solution name that matches the folder you placed it in.
  5. To fix the Solution name, from the Editor's Solution Explorer, right-click the Solution and select Rename.
  6. Enter the name of the Solution as you would like it to appear.  Note: this does not change the location where the Solution is stored, it will only rename the Solution within the Editor's Solution Explorer, and also automatically rename your *.mcsln file.
0
Avatar
Chad D.

I wanted to share another tip for saving time when creating solutions farther up the pyramid.  If you build from the bottom up, you can effectively merge the lower level solutions into the higher level solutions by doing the following:

  1. Create or open the destination solution.  This will be the higher level solution in the pyramid.
  2. Select File > Open Project/Solution.
  3. In the dialog window that opens, you should see Options available at the bottom.  Select "Add to solution".
  4. Browse to the lower level source solution that you wish to merge into your destination solution.  Select it and click Open (or just double-click it).

All projects from your source solution have now been added to your destination solution!

0
Avatar
Jerral Plowman

Chad,

I'm trying to grasp the benefit of using solutions and/or projects. If for example I have 500 executable procedures that reference a shared "Copyright" .mc file and I make changes to it then build it, I have to re-publish 500 procedures individually  for the changes to take effect? Is there a way to mass/batch publish .pxe's?

0
Avatar
Chad D.

Hi J., in MET/CAL 8.0 and 8.1, right-click the highest level solution containing the projects you want to build, then select Build Solution.  This will sequentially build every project in the solution, which places the PXE (and other files) in each project's bin directory.  Once the Build Solution operation has finished, use Windows search to locate all of the new *.pxe files within your source directories.

MET/CAL 8.2 provides a new Automated Build tool which eliminates the requirement to have Solutions in place to support the operation described above.  This new tool allows you to select the directory containing all projects (.mcproj files) you wish to build and specify an output directory for the build operations.  The Editor will load each project file it encounters during the scan and attempt to perform a “multi” build.  A multi build is the equivalent of setting the Project Property for "Publishing > Publish file type" to "multi".  This build process produces the following output into the selected directory:

  1. One .pxe file package.
  2. One .zip of the project source.

  3. One manifest describing the contents of the packages.

When the Automated Build completes, the output directory will also contain a log of the projects that built successfully and projects that failed to build.

0
Avatar
francois lamarche

when I want to start running calibrations under 8, the first thing that happens is it tells me my 9500b calibrator

is out of cal. I want to add a calibration like the I used to be able to do in metcal6... to no avail

 

Anybody knows where to enter the received 9500b's calibration information?

 

0
Avatar
Wynand van Staden

Hi francoisL,

Depending whether you run MetTeam or MetCal 8.

Under MetTeam if it does not exist add the 9500b as an asset. Then on the Edit Asset screen, go to the Scheduled Services box and add the calibration information.

Under Met/Track, if it does not exist add the calibrator as a new instrument using the Add Inventory Record Icon. Then on the Instrument Browser screen, under the Calibration tab, add the calibration data.

Irrespective of the program used, you also need to configure the calibrator:

Metcal/Editor – under the TOOLS drop down, select Configure Instrument or use F12 and add the calibrator, don’t forget to configure your IEEE-488 Boards if you are using GPIB;

Or use

Metcal/Runtime – use CONFIGURE drop down to configure the calibrator and/or GPIB-488. 

0
Avatar
Wynand van Staden

Hi francoisL,

Depending whether you use MetTeam or MetTrack:

Under MetTeam if it does not exist add the 9500b as an asset. Then on the Edit Asset screen, go to the Scheduled Services box and add the calibration information.

Under Met/Track, if it does not exist add the calibrator as a new instrument using the Add Inventory Record Icon. Then on the Instrument Browser screen, under the Calibration tab, add the calibration data.

Irrespective of the program used, you also need to configure the calibrator:

Metcal/Editor – under the TOOLS drop down, select Configure Instrument or use F12 and add the calibrator, don’t forget to configure your IEEE-488 Boards if you are using GPIB;

Or use Metcal/Runtime – use the CONFIGURE drop down to configure the calibrator and/or GPIB-488. 

0
Avatar
Chad D.

I just found that the PDF I referred to above linked to our old Community Forum, which is now offline. I hosted the PDF in a new location and updated the link. Here it is again for convenience: MET/CAL Source Code Directory Structure Diagram.

Please sign in to leave a comment.