• Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. Giamba
    3. Topics
    G
    • Profile
    • Following 0
    • Followers 0
    • Topics 9
    • Posts 47
    • Best 2
    • Controversial 0
    • Groups 0

    Topics created by Giamba

    • G

      Unipi 1.1 Analog Inputs
      Unipi 1 - First Generation • • Giamba

      1
      0
      Votes
      1
      Posts
      175
      Views

      No one has replied

    • G

      1 Wire problems
      Mervis • • Giamba

      7
      0
      Votes
      7
      Posts
      4267
      Views

      T

      @Giamba This sometimes happens, I recommend using a filtering function block for each temperature sensors. Something like this, this is a old filter that one of our customers used:

      FUNCTION_BLOCK check_1w_temp (* EXTENDS //base type IMPLEMENTS //interface type list *) VAR NON_RETAIN (* add local variables here *) first_run: bool:= TRUE; prev_temp: real:= 999.99; filter: LIB.CORE.V1_0.B86_FILTER; END_VAR VAR_INPUT (* add in variables here *) actual_temp: real:= 0; err_diff: real:= 5; por_diff: real:= 1; filter_const: real:= 60; min_temp_allowed: real:= -55; max_temp_allowed: real:= 125; END_VAR VAR_OUTPUT outtemp: real; err_measure: bool:=FALSE; (* add out variables here *) END_VAR (*function block body*) //first run IF first_run THEN outtemp:=actual_temp; prev_temp:=actual_temp; err_measure:=FALSE; first_run:=FALSE; RETURN; END_IF; //filter out impossible values IF actual_temp > max_temp_allowed OR actual_temp < min_temp_allowed THEN outtemp:=prev_temp; err_measure:=TRUE; RETURN; END_IF; //filter out POR 85.0C errorrs IF abs(prev_temp-actual_temp)>=por_diff AND actual_temp = 85.0 THEN err_measure:= TRUE; outtemp:=prev_temp; //and filter measurre errors ELSIF abs(prev_temp-actual_temp)>=err_diff THEN err_measure:=TRUE; outtemp:=prev_temp; //prev_temp:=actual_temp; ELSE outtemp:=actual_temp; prev_temp:=actual_temp; err_measure:=FALSE; END_IF; //apply analog filer -> smooth the signal IF err_measure = FALSE AND filter_const > 0 THEN filter(IN:= actual_temp, INDT:= filter_const, OUT=>outtemp); END_IF; END_FUNCTION_BLOCK

      And the graph:
      0_1510556313991_1w_graph.png

    • G

      Modbus Read/Write questions.
      Mervis • • Giamba

      2
      0
      Votes
      2
      Posts
      1735
      Views

      T

      @Giamba The order of sending the commands is not defined. Modbus defines input (readonly) and holding(readwirte) registers for this purposes. So you should use two registers, one for writing from Mervis to your application, and read the result of the computation of your application from a different register.

    • G

      Modbus, send REAL data
      General Discussion • • Giamba

      2
      0
      Votes
      2
      Posts
      1846
      Views

      G

      I find it!

      Modbus data order: 1234.
      Example:
      In C program header:

      typedef unsigned long DWORD; typedef unsigned short WORD; union u_DWORD_TO_FLOAT{ DWORD i; float f; };

      and in the code:

      union u_DWORD_TO_FLOAT AI01; ... AI01.i = (mb_mapping->tab_registers[20] << 16) + mb_mapping->tab_registers[21]; float value = AI01.f;

      Hope this help someone !

    • G

      I2C seems to be broken - no communication - no relay
      Mervis • • Giamba

      10
      0
      Votes
      10
      Posts
      3543
      Views

      G

      @tomas_hora.
      Hi.
      So tomas, have you been able to test my configuration? What about your side? Do relays are working with my project files?
      Tanks again.

    • G

      Debugging mode probleme
      Mervis • • Giamba

      2
      0
      Votes
      2
      Posts
      1494
      Views

      G

      Got it!
      Each fdb programme must have an entry in PLC Tasks.

    • G

      Modbus pause between telegrams
      Mervis • • Giamba

      5
      0
      Votes
      5
      Posts
      2305
      Views

      G

      Ok thanks for your remply!

    • G

      Mervis EnOcean
      Mervis • • Giamba

      10
      0
      Votes
      10
      Posts
      3878
      Views

      G

      Ok,
      Just to add the device Id.

      modbus_set_slave(ctx, 1);

      Thanks for all, now I can make all what I want with Mervis .

      Giamba

    • G

      Decode api.cgi vars
      Mervis • • Giamba

      3
      0
      Votes
      3
      Posts
      1929
      Views

      G

      Hi, thanks for the job.
      I found functions in UserJS that do the job:

      parseRealFromHex parseIntFromHex parseValueFromHash
      ...
      Now I have to find how to provide the type to decode in the right way.
      I have to look in html5_shark.xsl to modify it

      Thanks