1 Reply Latest reply on Jun 20, 2016 1:48 PM by Daniel Silva

    GS1 Datamatrix Codes with Motorola EMDK for .Net

    Christoph Fuss

      I've been trying to read GS1 data matrix codes with the "Motorola EMDK for .net v. 2.7".
      For that I've been using the Symbol(v. 2.5.0.3) and Symbol.Barcode(v. 2.7.0.2) Assemblies and created the following sample code in a Windows Forms Application:

      private global::Symbol.Barcode.Reader _reader;
        
      private global::Symbol.Barcode.ReaderData _readerData;

        
      public Form1()
        
      {
             
      InitializeComponent();

             _readerData
      = new ReaderData(ReaderDataTypes.Text, ReaderDataLengths.DefaultText);

             
      var device = Device.AvailableDevices.FirstOrDefault(d => d.DeviceName != Device.SIMULATE);
             
      if (device == null)
             
      {
                  
      throw new Exception("No Symbol scanner in the system."); //TODO //MSG
             
      }

             
      // Create the reader, based on selected device
             _reader
      = new global::Symbol.Barcode.Reader(device);

             _reader
      .Actions.Enable();

             _reader
      .Changes.Save();

             _reader
      .ReadNotify += new EventHandler(_reader_ReadNotify);

             
      // Start a pending read.
             
      try
             
      {
                  _reader
      .Actions.Read(_readerData);
             
      }
             
      catch (global::Symbol.Exceptions.OperationFailureException)
             
      {
                  
      //_logger.Error("Error, Reader is blocked", ex);,
             
      }
        
      }

             
      private void _reader_ReadNotify(object sender, EventArgs e)
             
      {
             _readerData
      = _reader.GetNextReaderData();

             _reader
      .Actions.Read(_readerData);
        
      }

        
      private void Form1_Closing(object sender, CancelEventArgs e)
        
      {
             _reader
      .Dispose();
        
      }

       

       

       

      I've analyzed the ouput via a breakpoint in the ReadNotify event but I don't get a reasonable result. Its always just the plain code string.
      I would need some kind of indication (via the symbology indentifiers for example) that it is a gs1 datamatrix code or better a result in a useful format.