Daggos

Members
  • Posts

    34
  • Joined

  • Last visited

Posts posted by Daggos

  1. Thanks for your reply i will test the alarm.paused but will that not just delay the alarm going off when you set alarm.paused back to 0

     

    My alarm is for a pump min(TestBit(miri_16_Digital_in,7)[systime(), systime() - 60]) > 0

    So if its off for 60 secs then alarm. Once i unpause will the alarms wait the full 60 secs?

  2. Thanks for that, working now but i was actually trying to make it work with an average.

    the below fails with improper number of parameters.

    flowdiff5.addValue(insertTime(mean(Pond9_Flow [0,1800]) - mean(PS_1_Flow_Outlet [0,1800])),systime(),0)

    but this works without the systime do i need it ?

    while(1)
       delay (2)
    flowdiff5.addValue(mean(Pond9_Flow [0,1800]) - mean(PS_1_Flow_Outlet [0,1800]))

    delay (2)
    endwhile

     

    Thanks for your help.

  3. Hi Im trying to Graph a global variable, can this be done, not sure as it doesn't have any history only current value.

     

    Global flowdiff = (Pond1_5_Flow[0]+Pond6_Flow[0]+Pond8_Flow[0]+Pond9_Flow[0]) - (PS_1_Flow_Outlet [0])

  4. Hi,

    I cant get the date to work when logging alarms to database im using mariadb mysql

    this is what i get 

    0000-00-00

    test Test;Test; 4

    F

    with the logging sets i have set Custom Time Formatting to %Y%m%d%H%M%S , but i cant do that with alarms.

     

    --
    -- Table structure for table `alarmlog`
    --

    CREATE TABLE `alarmlog` (
      `TheTime` date DEFAULT NULL,
      `Name` text DEFAULT NULL,
      `Description` text DEFAULT NULL,
      `Priority` tinytext DEFAULT NULL,
      `Status` tinytext DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
    COMMIT;

  5. Thanks

    I managed to get it working with 

    system.remotefull.GetHistory("HV_Power_Active", 0, 3600)

    remotefull being a full stream connection as it wont work with the lite stream.

    Also when i set the 3000 to 10,000 it downloads clearly from the persistence data and displays on remote version for a second or 2 then goes back to just 3600. (When i did this server HV_Power_Active history was set at 3600)

     

    So 3600 data points is good alot better than none. I guess if there is a way for me to save the data to persistence on the remote that would be good.

    I also change the history length for HV_Power_Active on the server to 10,000 so i can load up 10,000 points on the remote copy and it stays.

  6. Ok this wont work either no email and daqfactory hangs

     

     

    private semail = new(CEMail)

    semail.strhost = "smtp.gmail.com"

    semail.port = 587

    semail.strUserName = "xxxx"

    semail.strPassword = "xxxx"

    semail.strAuthenticate = "Auto"

    // open the file
    private.handle = File.Open("d:\DAQFactory\data.csv",1,0,0,0)
    // get the length
    private.length = File.GetLength(handle)
    // read the entire file and put into the body of the email
    email.strBody = File.Read(handle, length)
    // close the file
    file.Close(handle)


    semail.strReplyAddress = "xxxx"

    semail.strReplyName = "xxxxx"

    semail.strSubject = "xxxx"

    semail.strTo = "xxxxxx"

    semail.strConnectionType = "STARTTLS"

    semail.strSSLProtocol = "TLSv1_2"

    semail.Send()

     

     

  7. // open the file
    private.handle = File.Open("c:\mydata.csv",1,0,0,0)
    // get the length
    private.length = File.GetLength(handle)
    // read the entire file and put into the body of the email
    email.strBody = File.Read(handle, length)
    // close the file
    file.Close(handle)

     

    Found this on another thread i guess this would work? still would like to know if i can add more channels to an email direct

  8. Hi I'm using the below email script to send emails which is fine but i cant get more than 1 channel to show up in the email body. It will only show the last channel on the line? Do i have to set up an array? or another option is to save it to a file and send the file but i want it in the email body.

     

    private semail = new(CEMail)

    semail.strhost = "smtp.gmail.com"

    semail.port = 587

    semail.strUserName = "xxxx"

    semail.strPassword = "xxxx"

    semail.strAuthenticate = "Auto"

    semail.strBody = "text "  (HV_Power_Bulk_Fuel [0])   (Ventfan_Fan2_Vib_DE[0])


    semail.strReplyAddress = "xxxx"

    semail.strReplyName = "xxxxx"

    semail.strSubject = "xxxx"

    semail.strTo = "xxxxxx"

    semail.strConnectionType = "STARTTLS"

    semail.strSSLProtocol = "TLSv1_2"

    semail.Send()

     

     

     

     

     

    Also another issue i dont seem to be able to send the average just sends the current value

    Mean(PS_2_Flow_Outlet[0,1600])