Click or drag to resize

12.3 Example Code in this Manual

Throughout this manual, we present some (fairly) basic examples of common tasks which can be implemented using the functionality of the ClientLib.

However, for the sake of brevity, we omit some repetitive Boilerplate code from most of the examples.

This boilerplate code consists mainly of

  • appropriate using namespace; statements

  • program structure declarations

These need to be added around the actual example code before the example can be successfully compiled and run as a .NET Console App (see: these instructions).

Note  Note

We assume that the SP-ICE-3 Software Package has already been installed.

Boilerplate Code
C#
using System;
using RAYLASE.SPICE3;
using RAYLASE.SPICE3.Utils;
using RAYLASE.SPICE3.ClientLib;

namespace ExampleCode
{
    internal class ExampleProgram
    {
        // 
        // TODO:
        // Substitute your SP-ICE-3 card's real IP address here:
        // 
        private static string CardIP = "192.168.1.1";

        private void ExampleMethod()
        {
            // 
            // TODO:
            // INSERT EXAMPLE CODE HERE.
            // 

        }

        private static void Main( string[] args )
        {
            ExampleProgram ep = new ExampleProgram();
            ep.ExampleMethod();
        }
    }
}

Your mileage will almost certainly vary.

How to compile and run an example using the boilerplate code.
  1. Launch Microsoft Visual Studio 2017.

  2. Create a new project using the "Windows Desktop | Console Application (.NET Framework)" template.

  3. Add project References to ALL of the DLLs in the RAYLASE SP-ICE-3 Software package directory.

  4. Copy the Boilerplate code, and use it to replace the entire contents of the newly created Program.cs file.

  5. Copy the example code, and paste it into the boilerplate at the location marked with:

    C#
    // 
    // TODO:
    // INSERT EXAMPLE CODE HERE.
    
  6. Important note  Important

    Adapt the example code to your system by making any necessary changes now!

  7. Caution note  Caution

    Take all necessary Laser Safety precautions before attempting to run your program.