urgentt enregistrement des donnés de vb.net sur excel

Le
Lpfe2014 Hors ligne
Bonjour,
slt, j'ai besoin de vos aide s'il vous plait
Mon projet consiste à acquérir des information venant des capteurs avec un PIC18F4550, afficher ses valeurs sur un afficheur LCD, puis envoyer les avec USB au PC,où je doit faire une interface homme machine sur visual studio. J'ai réussi de faire l'acquisition des grandeurs physiques, l'affichage sur LCD et l'interface de la connexion USB sur visual studio mais je peut pas faire l'enregistrement des données.. le code qur vb.net est le suivant:


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 UsbLibrary;

namespace USB_Term
{
public partial class Form1 : Form
{
byte[] RecievedData = new byte[65];
byte Tam = 0;
byte Onda = 0;
byte Tam0 = 0;
byte Tam00 = 0;
bool statut = false;
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
this.usbHidPort1.ProductId = Int32.Parse("1111", System.Globalization.NumberStyles.HexNumber);
this.usbHidPort1.VendorId = Int32.Parse("1111", System.Globalization.NumberStyles.HexNumber);
usbHidPort1.CheckDevicePresent();
if (statut)
{
toolStripStatusLabel1.ForeColor = Color.Green;
toolStripStatusLabel1.Text = "USB connecté";
}
else
{
toolStripStatusLabel1.ForeColor = Color.Red;
toolStripStatusLabel1.Text = "USB non connecté";
}
}

protected override void OnHandleCreated(EventArgs e)
{
base.OnHandleCreated(e);
usbHidPort1.RegisterHandle(Handle);
}

protected override void WndProc(ref Message m)
{
usbHidPort1.ParseMessages(ref m);
base.WndProc(ref m);
}

private void usbHidPort1_OnDataRecieved(object sender, DataRecievedEventArgs args)
{

if (InvokeRequired)
{
try
{
Invoke(new DataRecievedEventHandler(usbHidPort1_OnDataRecieved), new object[] { sender, args });
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}

}
//
else
{
usbHidPort1_OnSpecifiedDeviceArrived(sender, args);
RecievedData = args.data;
Tam = RecievedData[2];
Onda = RecievedData[3];
label2.Text = Tam.ToString() + "," + Onda.ToString()+"°C";

Tam = RecievedData[4];
Onda = RecievedData[5];
label3.Text = Tam.ToString() + "," + Onda.ToString() + " Bar";


Tam = RecievedData[6];
Tam0 = RecievedData[7];
Tam00 = RecievedData[8];
Onda = RecievedData[9];
label5.Text = Tam.ToString() +Tam0.ToString() + Tam00.ToString()+ "," + Onda.ToString() + " m^3/h";
}

}

private void usbHidPort1_OnDataSend(object sender, EventArgs e)
{

}

private void usbHidPort1_OnDeviceArrived(object sender, EventArgs e)
{

}

private void usbHidPort1_OnDeviceRemoved(object sender, EventArgs e)
{

}

private void usbHidPort1_OnSpecifiedDeviceArrived(object sender, EventArgs e)
{
toolStripStatusLabel1.ForeColor = Color.Green;
toolStripStatusLabel1.Text = "USB connecté";
statut = true;
}

private void usbHidPort1_OnSpecifiedDeviceRemoved(object sender, EventArgs e)
{
toolStripStatusLabel1.ForeColor = Color.Red;
toolStripStatusLabel1.Text = "USB non connecté";
label2.Text = "--,-°C";
label3.Text = "--,-- Bar";
label5.Text = "--,-- m^3/h";
statut = false;
}

private void label1_Click(object sender, EventArgs e)
{

}

private void toolStripStatusLabel1_Click(object sender, EventArgs e)
{

}

private void label2_Click(object sender, EventArgs e)
{

}

private void label6_Click(object sender, EventArgs e)
{

}

}
}

Le problème est que je peut pas faire l'enregistrement de la température, le pression et le débit chaque minute..? il faut utiliser un timer et chaque minute il doit enregistrer ces valeurs sur excel mais je peut pas faire cette tache :(

Aidez moi svp c'est très urgent et merci d'avance..
Vos réponses
Gagnez chaque mois un abonnement Premium avec GNT : Inscrivez-vous !
Trier par : date / pertinence
clive Hors ligne
Le #26460879
Le mardi 27 Mai 2014 à 00:35 par Lpfe2014 :
Bonjour,
slt, j'ai besoin de vos aide s'il vous plait
Mon projet consiste à acquérir des information venant des
capteurs avec un PIC18F4550, afficher ses valeurs sur un afficheur LCD, puis
envoyer les avec USB au PC,où je doit faire une interface homme machine
sur visual studio. J'ai réussi de faire l'acquisition des grandeurs
physiques, l'affichage sur LCD et l'interface de la connexion USB sur visual
studio... mais je peut pas faire l'enregistrement des données.. le code
qur vb.net est le suivant:
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 UsbLibrary;

namespace USB_Term
{
public partial class Form1 : Form
{
byte[] RecievedData = new byte[65];
byte Tam = 0;
byte Onda = 0;
byte Tam0 = 0;
byte Tam00 = 0;
bool statut = false;
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
this.usbHidPort1.ProductId = Int32.Parse("1111",
System.Globalization.NumberStyles.HexNumber);
this.usbHidPort1.VendorId = Int32.Parse("1111",
System.Globalization.NumberStyles.HexNumber);
usbHidPort1.CheckDevicePresent();
if (statut)
{
toolStripStatusLabel1.ForeColor = Color.Green;
toolStripStatusLabel1.Text = "USB connecté";
}
else
{
toolStripStatusLabel1.ForeColor = Color.Red;
toolStripStatusLabel1.Text = "USB non
connecté";
}
}

protected override void OnHandleCreated(EventArgs e)
{
base.OnHandleCreated(e);
usbHidPort1.RegisterHandle(Handle);
}

protected override void WndProc(ref Message m)
{
usbHidPort1.ParseMessages(ref m);
base.WndProc(ref m);
}

private void usbHidPort1_OnDataRecieved(object sender,
DataRecievedEventArgs args)
{

if (InvokeRequired)
{
try
{
Invoke(new
DataRecievedEventHandler(usbHidPort1_OnDataRecieved), new object[] { sender,
args });
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}

}
//
else
{
usbHidPort1_OnSpecifiedDeviceArrived(sender, args);
RecievedData = args.data;
Tam = RecievedData[2];
Onda = RecievedData[3];
label2.Text = Tam.ToString() + "," +
Onda.ToString()+"°C";

Tam = RecievedData[4];
Onda = RecievedData[5];
label3.Text = Tam.ToString() + "," + Onda.ToString()
+ " Bar";
Tam = RecievedData[6];
Tam0 = RecievedData[7];
Tam00 = RecievedData[8];
Onda = RecievedData[9];
label5.Text = Tam.ToString() +Tam0.ToString() +
Tam00.ToString()+ "," + Onda.ToString() + " m^3/h";
}

}

private void usbHidPort1_OnDataSend(object sender, EventArgs e)
{

}

private void usbHidPort1_OnDeviceArrived(object sender, EventArgs e)
{

}

private void usbHidPort1_OnDeviceRemoved(object sender, EventArgs e)
{

}

private void usbHidPort1_OnSpecifiedDeviceArrived(object sender,
EventArgs e)
{
toolStripStatusLabel1.ForeColor = Color.Green;
toolStripStatusLabel1.Text = "USB connecté";
statut = true;
}

private void usbHidPort1_OnSpecifiedDeviceRemoved(object sender,
EventArgs e)
{
toolStripStatusLabel1.ForeColor = Color.Red;
toolStripStatusLabel1.Text = "USB non connecté";
label2.Text = "--,-°C";
label3.Text = "--,-- Bar";
label5.Text = "--,-- m^3/h";
statut = false;
}

private void label1_Click(object sender, EventArgs e)
{

}

private void toolStripStatusLabel1_Click(object sender, EventArgs e)
{

}

private void label2_Click(object sender, EventArgs e)
{

}

private void label6_Click(object sender, EventArgs e)
{

}

}
}

Le problème est que je peut pas faire l'enregistrement de la
température, le pression et le débit chaque minute..? il faut
utiliser un timer et chaque minute il doit enregistrer ces valeurs sur excel
mais je peut pas faire cette tache :(

Aidez moi svp c'est très urgent et merci d'avance..


We () use high quality equipment and materials to produce authentic and fake documents and Banknotes. These Banknotes are highly indistinguishable to touch, feel and naked eyes.This money carries individual serial and by pass security test
including UV-Light and iodine counterfeit pen maker.These notes can be used anywhere tested and approved. We do documents such as passport,ID Cards, Drivers license.All secret features of real passports are carefully duplicated for our Registered and unregistered documents.we are unique producer of quality false and Real documents.We offer only original high-quality Registered and unregistered passports, driver's licenses, ID cards, stamps, Visa, school Diplomas and other products for a number of countries like:USA, Australia, Belgium,Brazil, Canada, Italian,Finland, France, Germany, Israel, Mexico, Netherlands, South Africa,Spain, United Kingdom.
CONTACT OUR SUPPORTERS

General suppor:==========()

Contact e-mails:=====()

-IDs Scan-yes...
-HOLOGRAMS: IDENTICAL
-BARCODES: IDS SCAN
-UV: YES
FAKE IDS WITH FAST SHIPPING - EMAIL SUPPORT
We offer high quality counterfeit bills for the following currencies;
EUR - Euro
USD - US Dollar
GBP - British Pound
INR - Indian Rupee
AUD - Australian Dollar
CAD - Canadian Dollar
AED - Emirati Dirham
ZAR - Rand
CHF - Swiss Franc
CNY - Chinese Yuan Renminbi
MYR - Malaysian Ringgit
THB - Thai Baht

we are able to produce the following items;

REAL BRITISH PASSPORT.
REAL CANADIAN PASSPORT.
REAL FRENCH PASSPORT.
REAL AMERICAN PASSPORT.
REAL RUSSIAN PASSPORT.
REAL JAPANESSE PASSPORT.
REAL CHINESSE PASSPORT.

AND REAL PASSPORT FOR COUNTRIES IN THE EUROPEAN UNION.
REAL DRIVERS LICENSE,I.D CARDS,BIRTH CERTIFATES,DIPLOMATS,MARRIGE CERTIFICATES,AND VISAS.
REGISTERED AND UNREGISTERED BRITISH PASSPORT.
REGISTERED AND UNREGISTERED CANANIAN PASSPORT.
REGISTERED AND UNREGISTERED FRENCH PASSPORT.
REGISTERED AND UNREGISTERED AMERICAN PASSPORT.
REGISTERED AND UNREGISTERED RUSSSIAN PASSPORT.
REGISTERED AND UNREGISTERED JAPANESSE PASSPORT.
REGISTERED AND UNREGISTERED CHINESSE PASSPORT.

REGISTERED AND UNREGISTERED PASSPORTPASSPORT FOR COUNTRIES IN THE EUROPEAN UNION.
Buy Registered and unregistered USA(United States) passports,
Buy Registered and unregistered Australian passports,
Buy Registered and unregistered Belgium passports,
Buy Registered and unregistered Brazilian(Brazil) passports,
Buy Registered and unregistered Canadian(Canada) passports,
Buy Registered and unregistered Finnish(Finland) passports,
Buy Registered and unregistered French(France) passports,
Buy Registered and unregistered German(Germany) passports,
Buy Registered and unregistered Dutch(Netherland/Holland) passports,
Buy Registered and unregistered Israel passports,
Buy Registered and unregistered UK(United Kingdom) passports,
Buy Registered and unregistered Spanish(Spain) passports,
Buy Registered and unregistered Mexican(Mexico) passports,
Buy Registered and unregistered South African passports.
Buy Registered and unregistered Australian driver licenses,
Buy Registered and unregistered Canadian driver licenses,
Buy Registered and unregistered French(France) driver licenses,
Buy Registered and unregistered Dutch(Netherland/Holland) driving licenses,
Buy Registered and unregistered German(Germany) driving licenses,
Buy Registered and unregistered UK(United Kingdom) driving licenses,
Buy Registered and unregistered Diplomatic passports,
Buy Registered and unregistered USA(United States) passports,
Buy Registered and unregistered Australian passports,
Buy Registered and unregistered Belgium passports,
Buy Registered and unregistered Brazilian(Brazil) passports,
Buy Registered and unregistered Canadian(Canada) passports,
Buy Registered and unregistered Finnish(Finland) passports,
Buy Registered and unregistered French(France) passports,
Buy Registered and unregistered German(Germany) passports,
Buy Registered and unregistered Dutch(Netherland/Holland) passports,
Buy Registered and unregistered Israel passports,
Buy Registered and unregistered UK(United Kingdom) passports,
Buy Registered and unregistered Spanish(Spain) passports,
Buy Registered and unregistered Mexican(Mexico) passports,
Buy Registered and unregistered South African passports.
Buy Registered and unregistered Australian driver licenses,
Buy Registered and unregistered Canadian driver licenses,
Buy Registered and unregistered French(France) driver licenses,
Buy Registered and unregistered Dutch(Netherland/Holland) driving licenses,
Buy Registered and unregistered German(Germany) driving licenses,
Buy Registered and unregistered UK(United Kingdom) driving licenses,
Buy Registered and unregistered Diplomatic passports,
Registered and unregistered Camouflage passports,
Registered and unregistered passport Duplicates,
Registered and unregistered USA(united States) passports for sale,
Registered and unregistered Australian passports for sell,
Registered and unregistered Belgium passports for sell,
Registered and unregistered Brazilian(Brazil) passports for sell,
buy Camouflage passports,
express work permits

IELTS certificate,TOIC ETC
express canadian citizenship docu
verified id cards
passport registered
Canada Cards
United States Cards
Student Cards
International Cards
Private Cards
Adoption Certificates
Baptism Certificates
Birth Certificates
Death Certificates
Divorce Certificates
Marriage Certificates
Custom Certificates
High School Diplomas
G.E.D. Diplomas
Home School Diplomas
College Degrees
University Degrees
Trade Skill Certificates
Social Security
Validate SSN Number
Contact e-mails:=============== ()
General Support:=============== ()
Publicité
Poster une réponse
Anonyme