none
espelho mfd que não faz nada RRS feed

  • Pergunta

  • ola estou tetando fazendo o espelho mfd porem simplesmente não acontece nada, estou usando esse codigo:

     

    using System;

    using System.Collections.Generic;

    using System.ComponentModel;

    using System.Data;

    using System.Drawing;

    using System.Linq;

    using System.Text;

    using System.Windows.Forms;

    using Bematech;

    using Bematech.Fiscal.ECF;

    using Bematech.Fiscal.ECF.CupomFiscal;

    using Bematech.Fiscal.ECF.OperacoesNaoFiscais;

    using Bematech.Fiscal.ECF.RelatoriosFiscais;

    using Bematech.Fiscal.ECF.Informacoes;

    using System.Runtime.InteropServices;

    using System.IO;

    using Bematech.Fiscal.GerenciamentoDados;

     

    namespace Loja.UIWindows

    {

        public partial class EspelhoMFDFomr : Form

        {

            public EspelhoMFDFomr()

            {

                InitializeComponent();

            }

     

     

     

            [DllImport("BemaFi32.dll")]

            public static extern void Bematech_FI_EspelhoMFD(string cNomeArquivoDestino, string cDadoInicial, string cDadoFinal, string cTipoDownload, string cUsuario, string cChavePublica, string cChavePrivada);

     

     

     

            [DllImport("sign_bema.DLL", EntryPoint = "setLibType", SetLastError = false,

                 CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]

            public static extern Int32 setLibType(Int32 type);

     

     

            [DllImport("sign_bema.DLL", EntryPoint = "genkkey", SetLastError = false,

                 CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]

            public static extern Int32 genkkey([MarshalAs(UnmanagedType.VBByRefStr)] ref string pubkey,

               [MarshalAs(UnmanagedType.VBByRefStr)] ref string privatekey);

     

     

     

            [DllImport("sign_bema.DLL", EntryPoint = "generateEAD", SetLastError = false,

                 CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]

            public static extern Int32 generateEAD(string filename, string publicKey, string privateKey,

                    [MarshalAs(UnmanagedType.VBByRefStr)] ref string ead,

                    Int32 sign);

     

            [DllImport("sign_bema.DLL", EntryPoint = "validateFile", SetLastError = false,

                 CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]

            public static extern Int32 validateFile(string filename, string publicKey, string privateKey);

     

     

     

            public void gerar()

            {

                  string pubKey = "D0DDC7FAE1D4B9C9BF233F7C85AE3470DD93C342C96A670514EA98B84198D77FCCFB3F4ACBEDB5C993A272C74CB34F25EE235C45480924121DD77E620BE48ECB674E320C85A31EE8DCE2B332565A2F8F4B1932B2ACD9C8A6702EF95897B6A1ACB94068D8AB56B74DDB15BFFBEC3D45742EBF9825F0F9464C51A7ED05B13C7ED5";

             string privKey = "EF152BD8DC29E3DBB63685C25CEDCA47464754404264E7EDCCA72718E1D64F1EEE44940E239043DEB129FEA0EB423CAEC4F8C2D7B18A84790D553C2AE2D38B7FDFA5428955469832A82F8A945421B74C871581043CE1E231ABBDF04F3FA9233D70E4F9D0863554AB88F5C04543AABF187E0B248623B96DBE631603BCF9AE2FAB";

     

                if (escolha == true)

                {

     

     

     

                    Bematech_FI_EspelhoMFD("C:\\Users\\Thiago\\Desktop\\ESPELHOMFD.txt", data_ini_text.Text, data_final_text.Text, "D", usuario_text.Text,"D0DDC7FAE1D4B9C9BF233F7C85AE3470DD93C342C96A670514EA98B84198D77FCCFB3F4ACBEDB5C993A272C74CB34F25EE235C45480924121DD77E620BE48ECB674E320C85A31EE8DCE2B332565A2F8F4B1932B2ACD9C8A6702EF95897B6A1ACB94068D8AB56B74DDB15BFFBEC3D45742EBF9825F0F9464C51A7ED05B13C7ED5","EF152BD8DC29E3DBB63685C25CEDCA47464754404264E7EDCCA72718E1D64F1EEE44940E239043DEB129FEA0EB423CAEC4F8C2D7B18A84790D553C2AE2D38B7FDFA5428955469832A82F8A945421B74C871581043CE1E231ABBDF04F3FA9233D70E4F9D0863554AB88F5C04543AABF187E0B248623B96DBE631603BCF9AE2FAB");

                }

                else

                {

                    Bematech_FI_EspelhoMFD("C:\\Users\\Thiago\\Desktop\\ESPELHOMFD.txt", coo_ini_txtcoo_ini_txt.Text, coo_final_text.Text, "C", usuario_text.Text, pubKey, privKey);

     

                }

            }

     

     

            private void EspelhoMFDFomr_Load(object sender, EventArgs e)

            {

     

     

     

     

            }

     

            private void label3_Click(object sender, EventArgs e)

            {

     

            }

     

            private void maskedTextBox1_MaskInputRejected(object sender, MaskInputRejectedEventArgs e)

            {

     

            }

     

            private void label2_Click(object sender, EventArgs e)

            {

     

            }

           public Boolean escolha;

            private void escolha_data_CheckedChanged(object sender, EventArgs e)

            {

                escolha = true;

            }

     

            private void escolha_coo_CheckedChanged(object sender, EventArgs e)

            {

                escolha = false;

            }

     

     

     

            private void button1_Click(object sender, EventArgs e)

            {

                gerar();

            }

     

            public string SetLength(int Tamanho)

            {

                int i;

                string Retorno = "";

                for (i = 0; i < Tamanho; i++)

                    Retorno = Retorno + " ";

                return (Retorno);

            }

     

        }

    }



    Software Lagos Automação Comercial Cabo Frio - RJ
    segunda-feira, 7 de fevereiro de 2011 16:55

Respostas

  • Boa tarde!

    Tenho um software que roda em qualquer impressora Bematech, entre outras.

    Fiz o teste no emulador e deu o mesmo erro. Troquei o emulador por uma Bematech Térmica MP-4000 TH FI e executei o espelho e rodou de primeira. Ou seja, no meu caso o problema foi o Emulador. Inclusive retorna o mesmo código de erro da função Bematech_FI_DownloadMFDPorCOO: 3

    T+

    quarta-feira, 9 de fevereiro de 2011 16:56

Todas as Respostas

  • Boa tarde!

    O método  Bematech_FI_EspelhoMFD tem o retorno da execução. Armazene este retorno e poste aqui pra gente ver.... outra coisa, ative o log da bematech e poste também o arquivo de configuração BemaFI32.ini.

    http://partners.bematech.com.br/bemacast/2010/02/edicao-50-arquivo-mfd-e-espelho-mfd-novas-funcoes/

    T+

    segunda-feira, 7 de fevereiro de 2011 17:05
  • ;----------------------------------------------------------------------------;
    ;                                                                            ;
    ;  BEMAFI32.INI                                                              ;
    ;  Ver 5.10.6.5 - Janeiro/2010                                                 ;
    ;                                                                            ;
    ;  Arquivo de inicializacao da dll BemaFI32 para as impressoras fiscais      ;
    ;  MP-20 FI II, MP-40 FI II, MP-2000 FI TH, MP-2100 TH FI, MP-3000 TH FI     ;
    ;  MP-4000 TH FI, MP-6000 FI TH, MP-6100 TH FI, MP-7000 TH FI, MP-25 FI e    ;
    ;  MP-50 FI                                                                  ;
    ;                                                                            ;
    ;----------------------------------------------------------------------------;

    [Sistema]
    Porta=COM3
    Path=C:\
    Status=0
    Retorno=0
    StatusFuncao=0
    ControlePorta=1
    ModeloImp=BEMATECH
    ConfigRede=0
    ModoGaveta=0
    Log=0
    LogDiario=0
    CrLfVinculado=0
    CrLfGerencial=0
    TimeOutGerencial=40
    EmulMFD=0
    StatusCheque=
    CalculoIcmsCupom=0
    ForceWTSClient=1
    RetriesWTSCmd=3
    HabilitaRFDImpMFD=0
    GerarRFD=0


    [ModoRemoto]
    IP=
    Porta=


    [MFD]
    Impressora=0
    StatusErro=1
    TimeOutZ=99


    [Opcional]
    Favorecido=
    Cidade=


    [SoftwareHouse]
    COO=
    NumeroAplicativo=
    CNPJ=
    IE=
    IM=
    RazaoSocial=
    NomeAplicativo=
    Versao=
    Linha1=
    Linha2=


    [ECF]
    IM=
    UF=


    [Formato]
    ;    +------------------------------------- coluna do valor numerico
    ;    |  +---------------------------------- coluna extenso 1
    ;    |  |  +------------------------------- coluna extenso 2
    ;    |  |  |  +---------------------------- coluna favorecido
    ;    |  |  |  |  +------------------------- coluna da cidade
    ;    |  |  |  |  |  +---------------------- coluna do dia 
    ;    |  |  |  |  |  |  +------------------- coluna do mes
    ;    |  |  |  |  |  |  |  +---------------- coluna do ano
    ;    |  |  |  |  |  |  |  |  +------------- linha do valor numerico
    ;    |  |  |  |  |  |  |  |  |  +---------- linha do extenso 1
    ;    |  |  |  |  |  |  |  |  |  |  +------- linha do extenso 2
    ;    |  |  |  |  |  |  |  |  |  |  |  +---- linha do favorecido
    ;    |  |  |  |  |  |  |  |  |  |  |  |  +- linha da cidade/data
    ;    |  |  |  |  |  |  |  |  |  |  |  |  |
    000=51,04,01,05,06,60,65,81,01,06,08,11,14
    001=51,10,01,06,18,50,54,71,02,05,08,10,12
    003=49,08,01,05,18,52,55,72,01,05,07,09,12
    004=52,09,01,05,18,50,53,72,02,06,09,11,13
    006=56,10,01,05,15,43,48,72,01,06,08,10,13
    008=56,17,01,07,18,50,55,71,03,06,09,11,13
    021=52,12,01,04,18,49,53,71,02,07,09,11,13
    022=52,07,01,04,15,44,49,71,02,06,08,10,13
    024=51,07,01,05,18,48,52,72,01,05,07,09,12
    027=51,10,01,06,18,50,54,71,02,05,08,10,12
    028=55,06,01,05,18,50,53,71,01,05,08,10,12
    029=55,12,01,04,18,50,55,72,01,06,08,10,13
    031=51,10,01,06,18,50,54,71,02,05,08,10,12
    032=51,10,01,06,18,50,54,71,02,05,08,10,12
    033=48,17,01,06,18,46,50,71,02,06,08,11,13
    034=49,14,01,04,15,45,57,71,01,05,07,09,11
    035=51,10,01,06,18,50,54,71,02,05,08,10,12
    036=51,10,01,06,18,50,54,71,02,05,08,10,12
    037=51,10,01,06,18,50,54,71,02,05,08,10,12
    038=56,10,01,04,18,51,56,72,02,07,10,12,14
    039=51,10,01,06,18,50,54,71,02,05,08,10,12
    041=56,09,01,04,18,54,61,72,03,07,09,12,14
    047=52,08,01,05,18,47,50,72,01,05,07,10,12
    048=51,10,01,06,18,50,54,71,02,05,08,10,12
    059=50,15,01,05,18,55,59,72,01,05,07,09,11
    070=54,05,01,05,18,48,52,72,02,06,08,10,12
    104=56,13,01,04,18,48,53,72,01,04,07,10,12
    106=52,12,01,05,18,52,55,71,02,07,09,11,13
    151=54,06,01,04,18,47,52,71,01,05,07,10,12
    153=51,09,01,05,18,51,55,72,01,05,08,10,13
    168=53,05,01,05,18,54,57,71,02,06,08,11,13
    200=52,06,01,05,18,47,52,71,01,05,07,10,12
    201=52,11,01,04,18,47,51,71,01,05,07,09,11
    206=56,14,01,06,18,53,56,72,01,06,08,10,13
    207=50,04,01,05,18,48,52,71,02,06,08,11,13
    211=48,11,01,05,18,52,56,71,03,07,09,12,14
    215=55,06,01,05,18,51,54,71,02,05,08,10,13
    220=56,09,01,05,18,49,53,71,02,05,08,10,12
    230=50,12,01,05,18,54,58,71,02,05,08,10,13
    231=52,12,01,05,18,53,58,72,02,06,08,10,12
    237=50,01,01,04,18,50,54,71,02,06,09,11,14
    244=48,14,01,04,18,49,53,71,03,06,09,11,13
    254=51,09,01,05,18,53,56,71,01,05,08,11,14
    275=51,07,01,04,18,46,52,68,03,08,10,12,14
    282=56,12,01,05,18,50,54,71,02,06,08,10,13
    291=51,10,01,06,18,50,54,71,02,05,08,10,12
    294=51,10,01,06,18,50,54,71,02,05,08,10,12
    302=51,07,01,05,18,47,51,71,02,06,08,10,13
    308=51,10,01,06,18,50,54,71,02,05,08,10,12
    320=54,06,01,04,18,48,51,72,02,05,08,10,13
    334=54,06,01,04,18,54,57,71,02,06,08,10,12
    341=54,08,01,05,18,50,54,72,02,06,09,12,15
    346=54,12,01,05,18,54,57,71,02,05,08,10,12
    347=53,15,01,04,18,47,51,72,02,06,09,11,14
    351=52,14,01,05,18,55,58,72,01,05,07,10,12
    353=52,07,01,05,18,53,58,71,02,05,07,10,12
    356=51,10,01,06,18,50,54,71,02,05,08,10,12
    369=47,07,01,05,18,51,55,71,02,06,08,10,12
    370=52,06,01,05,18,47,50,71,01,05,07,10,12
    372=51,07,01,04,18,46,49,71,02,06,08,11,13
    376=54,07,01,04,18,54,58,72,02,06,08,10,12
    388=46,09,01,06,18,48,52,72,02,06,09,11,14
    389=52,06,01,05,18,53,58,72,02,07,09,12,14
    392=49,12,01,05,18,54,58,72,02,05,07,11,13
    394=51,05,01,05,18,51,55,71,01,05,07,09,13
    399=54,12,01,04,18,52,57,72,01,05,07,10,12
    409=55,12,01,04,23,52,58,71,04,07,09,11,13
    415=54,12,01,06,18,50,54,72,03,07,10,12,14
    420=54,08,01,04,18,50,54,72,02,06,08,10,13
    422=51,10,01,06,18,50,54,71,02,05,08,10,12
    424=51,10,01,06,18,50,54,71,02,05,08,10,12
    434=56,08,01,05,18,50,54,72,02,06,09,11,13
    453=54,12,01,05,18,51,56,72,03,07,10,12,14
    456=48,11,01,05,18,47,50,71,02,06,08,10,12
    464=51,10,01,06,18,50,54,71,02,05,08,10,12
    472=53,12,01,05,18,50,53,71,02,06,09,10,14
    477=55,08,01,05,18,52,57,72,03,07,09,11,14
    479=53,07,01,05,18,50,53,71,02,06,08,10,12
    483=52,08,01,05,18,47,50,71,02,05,07,09,11
    487=58,17,01,05,18,48,52,72,02,06,08,11,13
    494=51,09,01,05,18,50,53,71,02,06,08,10,13
    602=56,10,01,03,18,47,52,66,02,05,07,10,13
    603=51,10,01,06,18,50,54,71,02,05,08,10,12
    607=51,09,01,05,18,53,56,72,02,05,08,10,12
    610=55,15,01,05,18,53,58,71,01,06,08,10,12
    630=49,05,01,05,18,47,52,71,01,06,08,10,13
    718=51,07,01,05,18,48,53,71,01,06,08,10,13
    756=51,10,01,06,18,50,54,71,02,05,08,10,12
    995=51,10,01,06,18,50,54,71,02,05,08,10,12
    996=51,10,01,06,18,50,54,71,02,05,08,10,12
    998=80,03,01,04,22,54,60,80,03,05,06,08,10


    [FormatoYanco]
    999=61,12,02,03,23,50,61,78,04,09,13,18,22,10
    000=38,03,03,03,00,11,35,78,12,17,22,26,31,05
    001=61,12,02,03,23,50,61,78,04,09,13,18,22,10
    003=60,14,02,04,26,54,63,78,12,22,31,44,53,05
    004=62,10,00,01,19,47,60,78,08,22,35,44,53,05
    006=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    007=61,10,01,02,19,47,60,76,04,09,14,18,22,10
    008=59,17,05,06,25,53,62,78,07,11,16,20,24,10
    020=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    021=62,10,00,01,19,47,60,78,08,22,35,44,53,05
    022=61,15,03,06,25,53,61,78,07,21,30,39,52,05
    024=62,10,00,01,19,47,60,78,08,22,35,44,53,05
    026=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    027=61,10,00,01,20,47,60,78,04,09,15,18,22,10
    028=61,10,01,01,20,47,60,78,04,09,15,18,22,10
    029=63,13,01,03,26,53,62,78,07,25,35,44,56,05
    030=62,10,00,01,19,47,60,78,03,09,14,18,21,10
    031=61,17,03,05,22,50,60,78,13,23,37,46,54,05
    032=62,11,00,01,20,47,60,78,07,21,35,44,53,05
    033=56,15,02,04,22,49,59,78,05,11,14,18,23,10
    034=62,10,00,01,20,47,60,78,07,23,36,45,54,05
    035=62,10,00,00,22,49,60,78,04,09,15,18,22,10
    036=62,12,02,03,23,50,61,78,07,16,29,39,48,05
    037=62,10,00,01,20,47,60,78,07,22,35,44,54,05
    038=60,11,01,02,22,50,60,78,12,26,39,49,58,05
    039=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    041=60,11,02,04,26,53,63,77,07,11,16,20,24,20
    043=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    047=62,10,00,01,20,47,60,78,07,22,35,44,54,05
    048=59,10,01,02,22,49,59,78,11,26,35,44,57,05
    059=62,10,00,01,20,47,60,78,07,22,35,44,54,05
    070=62,10,00,01,20,47,60,78,07,21,35,44,53,05
    104=59,17,02,03,27,54,64,78,04,09,13,17,20,10
    106=63,13,02,03,25,53,62,78,08,26,34,49,57,05
    109=62,10,00,01,19,47,60,78,08,22,35,44,53,05
    111=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    113=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    116=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    148=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    150=62,11,00,01,20,47,60,78,07,21,35,44,53,05
    151=61,12,02,02,23,50,60,78,07,21,30,39,48,05
    152=63,11,00,01,20,47,60,78,04,09,15,18,22,10
    153=64,13,02,04,25,52,62,78,04,09,15,18,22,10
    164=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    165=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    166=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    168=59,11,01,02,24,51,62,78,12,26,35,44,53,05
    171=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    175=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    184=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    200=58,12,01,02,24,52,59,78,08,25,39,52,65,05
    201=59,14,02,03,21,48,60,78,12,21,30,39,52,05
    202=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    204=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    205=61,10,00,01,18,47,60,78,08,24,38,47,55,05
    206=59,17,02,03,26,54,64,78,11,21,30,39,52,05
    207=62,11,01,02,20,47,61,78,04,09,14,18,22,10
    208=62,07,10,00,01,20,47,60,78,22,35,44,53,05
    209=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    210=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    211=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    212=61,10,01,02,20,47,60,78,04,10,15,19,22,10
    213=62,10,00,01,20,47,60,56,78,07,22,35,44,05
    214=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    215=57,16,02,04,22,49,60,78,12,26,35,44,52,05
    216=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    217=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    219=62,10,00,01,19,47,60,78,08,22,35,44,53,05
    220=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    221=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    222=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    223=62,10,00,01,19,47,60,78,08,22,35,44,53,05
    224=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    225=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    226=61,10,00,01,19,47,60,78,08,22,35,44,53,05
    229=62,10,00,01,19,47,60,78,08,22,35,44,53,05
    230=60,14,01,02,26,53,63,78,11,26,35,44,57,05
    233=62,10,00,01,19,47,60,78,08,22,35,44,53,05
    237=58,13,00,02,22,50,61,78,06,11,16,20,23,10
    239=62,10,00,01,19,47,60,78,08,22,35,44,53,05
    242=62,10,00,01,19,47,60,78,08,22,35,44,53,05
    251=62,10,00,01,19,47,60,78,08,22,35,44,53,05
    252=62,10,00,01,19,47,60,78,08,22,35,44,53,05
    254=62,10,00,01,19,47,60,78,07,22,35,44,53,05
    267=62,10,00,01,20,47,60,78,03,09,15,18,21,10
    275=59,11,04,03,23,51,60,78,05,13,18,22,25,20
    291=57,16,03,04,23,49,59,78,06,11,15,18,22,10
    294=60,14,02,04,27,54,63,78,12,21,31,44,53,05
    334=61,13,02,03,24,54,64,78,04,09,13,16,20,10
    341=58,11,03,04,25,53,62,78,04,11,16,20,25,10
    347=59,14,01,03,26,53,63,78,10,25,35,44,56,05
    351=62,16,01,03,26,53,62,78,07,21,32,40,52,05
    353=70,01,01,01,36,54,63,80,02,06,10,14,17,10
    361=62,10,00,01,20,47,60,78,07,22,35,44,53,05
    366=59,15,02,02,23,50,61,78,12,25,39,48,57,05
    369=61,12,02,03,23,50,62,78,08,21,35,44,53,05
    389=61,13,04,04,26,54,63,78,13,30,40,53,61,05
    392=60,14,02,03,21,48,60,78,11,25,34,43,56,05
    399=62,21,05,06,26,53,63,78,04,09,13,18,22,10
    409=57,19,04,06,23,51,61,78,07,13,16,20,23,10
    412=62,11,00,01,20,47,60,78,09,21,34,44,54,05
    415=61,16,03,04,25,53,62,77,05,11,16,20,23,10
    434=61,14,03,09,24,51,61,78,05,09,14,18,23,10
    477=62,13,03,06,26,53,61,78,07,12,16,22,25,10
    479=61,13,01,03,22,50,60,78,04,09,13,17,22,10
    605=60,13,02,04,26,54,63,78,12,21,30,44,53,05


    [Copia]
    Banco=
    Valor=
    Favorecido=
    Cidade=
    Data=
    ImpressaoVerso=
    Linhas=
    Mensagem=


    [RelatorioTipo60]
    COOInicial=
    COOFinal=
    GTInicial=
    GTFinal=


    [TEF]
    REQ=C:\TEF_DIAL\REQ
    RESP=C:\TEF_DIAL\RESP
    STATUS=0
    LINHAS=74
    BYTES=0
    VIAS=1


    [CONFIG]
    InicioDia=0
    DATARED=
    TOTSUPR=
    MOEDASING=Real
    MOEDAPLU=Reais


    [ReducaoYanco]
    GT=
    COO=
    CANC=
    ACRE=
    DESC=
    ALIQ=
    SANG=
    SUPR=
    TOTPARC=
    TOTNSUJ=
    CONTNSU=
    CONTOPN=
    NUMALIQ=
    DATAMOV=


    [Info]
    StampVinculado=
    StampGerencial=




    ps estou suando o emulador da impressora fsical


    falou

    Software Lagos Automação Comercial Cabo Frio - RJ
    segunda-feira, 7 de fevereiro de 2011 19:31
  • Boa tarde!

    Na seção MFD, a propriedade Impressora tem que ser igual a 1.

    [MFD]
    Impressora=1

    Se não der certo, poste o log da bematech. Para ativar  o log só habilitar as propriedades como abaixo na seção [Sistema]

    Log=0
    LogDiario=0

    T+
    segunda-feira, 7 de fevereiro de 2011 19:59
  • onde fica o log?, ativei, porem nada acontece, o que esta acontecendo?
    Software Lagos Automação Comercial Cabo Frio - RJ
    segunda-feira, 7 de fevereiro de 2011 20:17
  • mudei meu codigo para esse:

     

    using System;

    using System.Collections.Generic;

    using System.ComponentModel;

    using System.Data;

    using System.Drawing;

    using System.Linq;

    using System.Text;

    using System.Windows.Forms;

    using Bematech;

    using Bematech.Fiscal.ECF;

    using Bematech.Fiscal.ECF.CupomFiscal;

    using Bematech.Fiscal.ECF.OperacoesNaoFiscais;

    using Bematech.Fiscal.ECF.RelatoriosFiscais;

    using Bematech.Fiscal.ECF.Informacoes;

    using System.Runtime.InteropServices;

    using System.IO;

    using Bematech.Fiscal.GerenciamentoDados;

     

    namespace Loja.UIWindows

    {

        public partial class EspelhoMFDFomr : Form

        {

            public EspelhoMFDFomr()

            {

                InitializeComponent();

            }

     

     

     

            [DllImport("BemaFi32.dll")]

            public static extern void Bematech_FI_EspelhoMFD(string cNomeArquivoDestino, string cDadoInicial, string cDadoFinal, string cTipoDownload, string cUsuario, string cChavePublica, string cChavePrivada);

     

     

     

            [DllImport("sign_bema.DLL", EntryPoint = "setLibType", SetLastError = false,

                 CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]

            public static extern Int32 setLibType(Int32 type);

     

     

            [DllImport("sign_bema.DLL", EntryPoint = "genkkey", SetLastError = false,

                 CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]

            public static extern Int32 genkkey([MarshalAs(UnmanagedType.VBByRefStr)] ref string pubkey,

               [MarshalAs(UnmanagedType.VBByRefStr)] ref string privatekey);

     

     

     

            [DllImport("sign_bema.DLL", EntryPoint = "generateEAD", SetLastError = false,

                 CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]

            public static extern Int32 generateEAD(string filename, string publicKey, string privateKey,

                    [MarshalAs(UnmanagedType.VBByRefStr)] ref string ead,

                    Int32 sign);

     

            [DllImport("sign_bema.DLL", EntryPoint = "validateFile", SetLastError = false,

                 CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]

            public static extern Int32 validateFile(string filename, string publicKey, string privateKey);

     

     

     

            public void gerar()

            {

     

                string pubKey = "D0DDC7FAE1D4B9C9BF233F7C85AE3470DD93C342C96A670514EA98B84198D77FCCFB3F4ACBEDB5C993A272C74CB34F25EE235C45480924121DD77E620BE48ECB674E320C85A31EE8DCE2B332565A2F8F4B1932B2ACD9C8A6702EF95897B6A1ACB94068D8AB56B74DDB15BFFBEC3D45742EBF9825F0F9464C51A7ED05B13C7ED5";

                string privKey = "EF152BD8DC29E3DBB63685C25CEDCA47464754404264E7EDCCA72718E1D64F1EEE44940E239043DEB129FEA0EB423CAEC4F8C2D7B18A84790D553C2AE2D38B7FDFA5428955469832A82F8A945421B74C871581043CE1E231ABBDF04F3FA9233D70E4F9D0863554AB88F5C04543AABF187E0B248623B96DBE631603BCF9AE2FAB";

     

     

     

                // if (escolha == true)

                // {

               // int iRetorno = BemaFI32.Bematech_FI_EspelhoMFD(@"C:\\Users\\Thiago\\Desktop\\ESPELHOMFD.txt", data_ini_text.Text, data_final_text.Text, "D", usuario_text.Text,pubKey,privKey);

                int iRetorno = BemaFI32.Bematech_FI_EspelhoMFD(@"C:\\Users\\Thiago\\Desktop\\ESPELHOMFD.txt", "000100", "000200", "c", "1", pubKey, privKey);

     

                BemaFI32.Analisa_iRetorno(iRetorno);

                if (iRetorno == 1)

                {

                    MessageBox.Show("Arquivo gerado!");

                }

     

                else

                {

                    MessageBox.Show("erro");

     

                }

                //  Bematech_FI_EspelhoMFD("C:\\Users\\Thiago\\Desktop\\ESPELHOMFD.txt", Convert.ToString(data_ini_text.Text), Convert.ToString(data_final_text.Text), "D", Convert.ToString(usuario_text.Text),"D0DDC7FAE1D4B9C9BF233F7C85AE3470DD93C342C96A670514EA98B84198D77FCCFB3F4ACBEDB5C993A272C74CB34F25EE235C45480924121DD77E620BE48ECB674E320C85A31EE8DCE2B332565A2F8F4B1932B2ACD9C8A6702EF95897B6A1ACB94068D8AB56B74DDB15BFFBEC3D45742EBF9825F0F9464C51A7ED05B13C7ED5","EF152BD8DC29E3DBB63685C25CEDCA47464754404264E7EDCCA72718E1D64F1EEE44940E239043DEB129FEA0EB423CAEC4F8C2D7B18A84790D553C2AE2D38B7FDFA5428955469832A82F8A945421B74C871581043CE1E231ABBDF04F3FA9233D70E4F9D0863554AB88F5C04543AABF187E0B248623B96DBE631603BCF9AE2FAB");

     

                /*  else

                  {

                      Bematech_FI_EspelhoMFD("C:\\Users\\Thiago\\Desktop\\ESPELHOMFD.txt", coo_ini_txt.Text, coo_final_text.Text, "C", usuario_text.Text, pubKey, privKey);

     

                  }*/

            }

     

     

            private void EspelhoMFDFomr_Load(object sender, EventArgs e)

            {

     

     

     

     

            }

     

            private void label3_Click(object sender, EventArgs e)

            {

     

            }

     

            private void maskedTextBox1_MaskInputRejected(object sender, MaskInputRejectedEventArgs e)

            {

     

            }

     

            private void label2_Click(object sender, EventArgs e)

            {

     

            }

            public Boolean escolha;

            private void escolha_data_CheckedChanged(object sender, EventArgs e)

            {

                escolha = true;

            }

     

            private void escolha_coo_CheckedChanged(object sender, EventArgs e)

            {

                escolha = false;

            }

     

     

     

            private void button1_Click(object sender, EventArgs e)

            {

                gerar();

            }

     

     

            public string SetLength(int Tamanho)

            {

                int i;

                string Retorno = "";

                for (i = 0; i < Tamanho; i++)

                    Retorno = Retorno + " ";

                return (Retorno);

            }

     

        }

    }

     

     

     

     

    porem agora ele fala que tem erro de execussão.


    Software Lagos Automação Comercial Cabo Frio - RJ
    segunda-feira, 7 de fevereiro de 2011 22:01
  • percebi que mesmo usando o codigo de exemplo que o suporte da bematech me mandou da o mesmo erro. sera pq estou usando o emulador?
    Software Lagos Automação Comercial Cabo Frio - RJ
    terça-feira, 8 de fevereiro de 2011 00:20
  • Bom dia!

    O log fica no C:\ de acordo com seu arquivo de configuração.

    Execute somente este comando e coloca o log aqui pra gente ver.

    Quanto a ser o Emulador, vc teria que ligar no suporte da Bematech pra verificar se funciona este comando com o emulador.

    T+

     

    terça-feira, 8 de fevereiro de 2011 10:24
  • Olá Thiago,

    Sim, estas operações tbm funcionam com o Emulador e percebi no seu arquivo .ini que a chave EmulMFD está desativada. É assim mesmo que esta chave precisa ficar quando realiza operações com a MFD do Emulador e a comunicação com ele é realizada via cabo serial com pinagem específica ou através de porta virtual. Nosso pessoal de suporte usa nos testes com o Emulador o programa VirtualSerialPort que vc baixa na WEB.

    Se desejar, entre em contato com nosso suporte exclusivo via 0800 644 7277 ou por email suporte@bematech.com.br para que o pessoal possa lhe orientar.

    Ats,
    André Munhoz

    terça-feira, 8 de fevereiro de 2011 10:32
  • o log não esta aparecendo, deve ser algo na configuração, porque o mesmo erro ocorre no meu codigo e no codigo de exemplo da bematech, se alguem puder me ajudar vou ficar grato

     

    obrigado a todos que estao me ajudando aki.


    Software Lagos Automação Comercial Cabo Frio - RJ
    terça-feira, 8 de fevereiro de 2011 16:10
  • Oi Thiago,

    O log é ativado pelas chaves Log e LogDiario iguais a 1.

    Entre em contato com nosso suporte ou me passe seu telefone de contato em PVT para que possamos verificar melhor o que está ocorrendo.

    Ats,
    André Munhoz
    andre.munhoz@bematech.com.br

    terça-feira, 8 de fevereiro de 2011 16:39
  • 2011-02-09 13:36:04 - ----------------------------------------------------------------------- 

    2011-02-09 13:36:04 - Bematech_FI_LeInformacoesConfiguracao 

    2011-02-09 13:36:04 - Versão BemaFI32.Dll: 5,10,8,0

    2011-02-09 13:36:04 - Versão BemaMFD.dll: 1,0,2,0

    2011-02-09 13:36:04 - Versão BemaMFD2.dll: 1,0,3,0

    2011-02-09 13:36:04 - path: C:\Users\Thiago\Desktop

    2011-02-09 13:36:04 - Log: 1

    2011-02-09 13:36:04 - LogDiario: 1

    2011-02-09 13:36:04 - Status: 0

    2011-02-09 13:36:04 - Retorno: 0

    2011-02-09 13:36:04 - ControlePorta: 1

    2011-02-09 13:36:04 - StatusFuncao: 0

    2011-02-09 13:36:04 - ModeloImp: BEMATECH

    2011-02-09 13:36:04 - ModoGaveta: 0

    2011-02-09 13:36:04 - EmulMFD: 1

    2011-02-09 13:36:04 - StatusCheque: 0

    2011-02-09 13:36:04 - Porta: DEFAULT

    2011-02-09 13:36:04 - StatusErro: 1

    2011-02-09 13:36:04 - TimeOutZ: 99

    2011-02-09 13:36:04 - Impressora: 1

    2011-02-09 13:36:04 - TimeOutGerencial: 40

    2011-02-09 13:36:04 - CrLfVinculado: 0

    2011-02-09 13:36:04 - Gerencial: 0

    2011-02-09 13:36:04 - ForceWTSClient: 1

    2011-02-09 13:36:04 - RetriesWTSCmd: 3

    2011-02-09 13:36:04 - Software House - COO: 0

    2011-02-09 13:36:04 - Software House - NumeroAplicativo: 0

    2011-02-09 13:36:04 - Software House - CNPJ: 0

    2011-02-09 13:36:04 - Software House - IE: 0

    2011-02-09 13:36:04 - Software House - IM: 0

    2011-02-09 13:36:04 - Software House - RazaoSocial: 0

    2011-02-09 13:36:04 - Software House - NomeAplicativo: 0

    2011-02-09 13:36:04 - Software House - Versao: 0

    2011-02-09 13:36:04 - Software House - Linha1: 0

    2011-02-09 13:36:04 - Software House - Linha2: 0

    2011-02-09 13:36:04 - ECF - IM: 0

    2011-02-09 13:36:04 - ECF - UF: 0

    2011-02-09 13:36:04 - GerarRFD: 1

    2011-02-09 13:36:04 - CalculoIcmsCupom: 0

    2011-02-09 13:36:04 - HabilitaRFDImpMFD: 1

    2011-02-09 13:36:04 - Retorno Bematech_FI_LeInformacoesConfiguracao: OK

    2011-02-09 13:36:04 - ----------------------------------------------------------------------- 

    2011-02-09 13:36:04 - Bematech_FI_EspelhoMFD 

    2011-02-09 13:36:04 - Parâmetros: C:\Users\Thiago\Desktop\ESPELHOMFD.txt|000003|000003|C|1|||

    2011-02-09 13:36:04 - Bematech_FI_DownloadMFD 

    2011-02-09 13:36:04 - Parâmetros: 2|000003|000003|C:\Users\Thiago\Desktop\Download.MFD|1

    2011-02-09 13:36:04 - Bematech_FI_DownloadMFDPorCOO 

    2011-02-09 13:36:04 - Retorno Bematech_FI_DownloadMFDPorCOO: 3

    2011-02-09 13:36:04 - Retorno Bematech_FI_DownloadMFD: 3

    2011-02-09 13:36:04 - Retorno Bematech_FI_EspelhoMFD: -1 - Erro de execucao na funcao Bematech_FI_DownloadMFD:  


    Software Lagos Automação Comercial Cabo Frio - RJ
    quarta-feira, 9 de fevereiro de 2011 16:37
  • Boa tarde!

    Tenho um software que roda em qualquer impressora Bematech, entre outras.

    Fiz o teste no emulador e deu o mesmo erro. Troquei o emulador por uma Bematech Térmica MP-4000 TH FI e executei o espelho e rodou de primeira. Ou seja, no meu caso o problema foi o Emulador. Inclusive retorna o mesmo código de erro da função Bematech_FI_DownloadMFDPorCOO: 3

    T+

    quarta-feira, 9 de fevereiro de 2011 16:56
  • confirmaram comigo que o emulador nao faz essa função, valeu e obrigado por tudo
    Software Lagos Automação Comercial Cabo Frio - RJ
    • Sugerido como Resposta João Marlon quinta-feira, 27 de dezembro de 2012 19:42
    quarta-feira, 9 de fevereiro de 2011 16:58
  • Testei aqui e, realmente, não funciona com o Emulador. Obrigado pela ajuda.
    quinta-feira, 27 de dezembro de 2012 19:43