You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Some models of JoeScan Scanners of the JS20 and JS25 Series (JS-20 X2, JS-20 X3, JS-25 X2, JS-25 X3) have more than one laser, each of which can be separately addressed and read out. Example 8 shows how to do that in On-Demand mode using the GetProfile(int laserIndex) function.

 

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using JoeScan.JCamNet;

namespace Examples
{
    class Program
    {
        static void Main(string[] args)
        {
            Scanner scanner = Scanner.Connect(new IPAddress(new byte[] { 192, 168, 1, 152 }), 0);
            TextReader parametersReader;
            using (parametersReader = File.OpenText("param.dat"))
            {
                    scanner.SetParameters(parametersReader.ReadToEnd(), true);              
            }
            // this will only work on an X2 or X3 model!
            if (scanner.LaserCount < 2)
            {
                System.Console.WriteLine("Demo code only for models with multiple lasers.");
                return;
            }
            for (int i = 0; i < scanner.LaserCount; i++)
            {
                Profile p = scanner.GetProfile(i);
                System.Console.WriteLine("Laser {0}: Profile contains {1} points.", i,p.Count);
            }
        }
    }
}
Reading out multiple lasers in Synchronized Mode is only supported when configured with the TimeStaggeredScanning keyword.
  • No labels