Com Ports ?

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • #9662
    Mikhail
    Moderator

    Hi,

    I don’t want to put it onto my live system

    In this case you should develop (or order development) a driver for Rapid SCADA to poll devices using the custom communication protocol.

    #9669
    Rich Ex
    Participant

    Hi All
    So as promised I have tried Mikhail’s code on my new RS set up .

    Well it works and it works well , so well indeed I have I now have 10 x ‘minute real’ channels reading in the data from the .txt files .

    So this is how I did it , I have written a simple program ‘getdata.exe’ using QB64 , this reads the RS232 port and takes the received 36 ASCII characters and chops them up using mid$ in the code and writes out 10 different .txt files with the individual numbers stored in them .

    Then in RS I have a formula called by a minute real channel

    double GetData()
    {
    System.Diagnostics.Process.Start(“C:\\Scada\\getdata.exe”);
    return 0 ;
    }

    Then I use the 10 x minute real channels to call in the data
    (this is just one of the formulas
    This part was the code Mikhail designed


    double ReadNickelA()
    {
    try
    {
    string s = System.IO.File.ReadAllText(@”C:\DataRecorder\NickleA.txt”);
    double val;
    return double.TryParse(s,out val) ? val : 0;
    }
    catch
    {
    return -2;
    }
    }

    Now I’m sure that lots of this is wrong , C# is still new to me but it all works fine and I don’t get any errors or lag on the server . So I am happy with it !

    Thanks for every one who made suggestions and help

    Rich

    #9671
    Mikhail
    Moderator

    Hi Rich,
    Thank you for describing the final solution.
    Do you plan to develop a driver for polling data?

    #9673
    Rich Ex
    Participant

    Hi Mikhail ,
    I would like to but I don’t think I have the c# skills to fully understand how to write the drive .

    Who knows the more I do with RS I may get to a point where I can .

Viewing 4 posts - 16 through 19 (of 19 total)
  • You must be logged in to reply to this topic.