Zuviel Werbung? - > Hier kostenlos beim SPS-Forum registrieren

Results 1 to 2 of 2

Thread: Help with s7 and C# application

  1. #1
    Join Date
    Erhielt 0 Danke für 0 Beiträge


    Zuviel Werbung?
    -> Hier kostenlos registrieren
    Hi there,

    I have to develop simple application which will connect to Simatic 300 and recieve the data from it (Format data block from screen shot in configuration panel is -> DB29 and lenght = 32)

    Im using for it library libnodave but Im new in this area of knowlege so I have few questions.

    1. I made connection to PLC VIA TCP (.opensocket (102.IP))

    2. I recieve simple data using dc.readybytes(daveDB,29,0,32,buffer) but the resoults are like some numbers ( I believe there are bytes). What I need to do with it know ? Im trying to encode it using System.Text.Encoding.ASII.getString(buffe) but there is nothing in there...

    3. My application has to work all the time, and in each x minutes has to check if the data are from the PLC, which is the best way to do it ? Using thread and loop while() is good one ?

    4. If I want to recieve data from PLC what I need to know ? Do I need to send any information to PLC for start recieve data ??

    Please help.

    Reply With Quote Reply With Quote Help with s7 and C# application  

  2. #2
    Join Date
    Erhielt 2,040 Danke für 1,627 Beiträge


    2. the library have some functions, also the function getbyte or getreal ... you have to know, what type the value have you want to get ...

    3. do never use a loop for this stuff. set a timer with 60s ... you will find some help here:

    Timer t1 = new Timer(); // make a timer
    t1.Interval = 100; // set the time, here 100ms
    t1.Tick+=new EventHandler(t1_Tick); // set the thread
    t1.Start(); // start the timer
    void t1_Tick(object sender, EventArgs e)
    // this code will be execute every timer tick
    4.you have to open the connection and send (with the right function, s.a. 2., the position) to get the data ...

    ... the libnodave library involved a .net, i think a c# sample ... just read it
    Ironie setzt Intelligenz beim Empfänger voraus.

Similar Threads

  1. Replies: 0
    Last Post: 20.11.2009, 18:25
  2. Fremd Application starten
    By Farinin in forum HMI
    Replies: 5
    Last Post: 04.12.2008, 13:43
  3. Replies: 0
    Last Post: 07.02.2008, 22:48


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts