4-rings or 4-squares puzzle

You are encouraged to solve this task according to the task description, using any language you may know.
Task

Replace       a, b, c, d, e, f,   and
  g        with the decimal
digits   LOW   ───►   HIGH

such that the sum of the letters inside of each of the four large squares add up to
the same sum.

            ╔══════════════╗      ╔══════════════╗
            ║              ║      ║              ║
            ║      a       ║      ║      e       ║
            ║              ║      ║              ║
            ║          ┌───╫──────╫───┐      ┌───╫─────────┐
            ║          │   ║      ║   │      │   ║         │
            ║          │ b ║      ║ d │      │ f ║         │
            ║          │   ║      ║   │      │   ║         │
            ║          │   ║      ║   │      │   ║         │
            ╚══════════╪═══╝      ╚═══╪══════╪═══╝         │
                       │       c      │      │      g      │
                       │              │      │             │
                       │              │      │             │
                       └──────────────┘      └─────────────┘

Show all output here.



   Show all solutions for each letter being unique with
        LOW=1     HIGH=7

   Show all solutions for each letter being unique with
        LOW=3     HIGH=9

   Show only the   number   of solutions when each letter can be non-unique
        LOW=0     HIGH=9



Related task

 Solve the no connection puzzle


' version 18-03-2017
' compile with: fbc -s console
 
' TRUE/FALSE are built-in constants since FreeBASIC 1.04
' But we have to define them for older versions.
#Ifndef TRUE
  #Define FALSE 0
  #Define TRUE Not FALSE
#EndIf
 
Sub four_rings(low As Long, high As Long, unique As Long, show As Long)
 
  Dim As Long a, b, c, d, e, f, g
  Dim As ULong t, total
  Dim As ULong l = Len(Str(high))
  If l < Len(Str(low)) Then l = Len(Str(low))
 
 
  If show = TRUE Then
    For a = 97 To 103
      Print Space(l); Chr(a);
    Next
    Print
    Print String((l +1) * 7, "=");
    Print
  End If
 
  For a = low To high
    For b = low To high
      If unique = TRUE Then
        If b = a Then Continue For
      End If
      t = a + b
      For c = low To high
        If unique = TRUE Then
          If c = a OrElse c = b Then Continue For
        End If
        For d = low To high
          If unique = TRUE Then
            If d = a OrElse d = b OrElse d = c Then Continue For
          End If
          If b + c + d = t Then
            For e = low To high
              If unique = TRUE Then
                If e = a OrElse e = b OrElse e = c OrElse e = d Then Continue For
              End If
              For f = low To high
                If unique = TRUE Then
                  If f = a OrElse f = b OrElse f = c OrElse f = d OrElse f = e Then Continue For
                End If
                If d + e + f = t Then
                  For g = low To high
                    If unique = TRUE Then
                      If g = a OrElse g = b OrElse g = c OrElse g = d OrElse g = e OrElse g = f Then Continue For
                    End If
                    If f + g = t Then
                      total += 1
                      If show = TRUE Then
                        Print Using String(l +1, "#"); a; b; c; d; e; f; g
                      End If
                    End If
                  Next
                End If
              Next
            Next
          End If
        Next
      Next
    Next
  Next
 
  If unique = TRUE Then
    Print
    Print total; " Unique solutions for "; Str(low); " to "; Str(high)
  Else
    Print total; " Non unique solutions for "; Str(low); " to "; Str(high)
  End If
  Print String(40, "-") : Print
End Sub
 
' ------=< MAIN >=------
 
four_rings(1, 7,  TRUE,  TRUE)
four_rings(3, 9,  TRUE,  TRUE)
four_rings(0, 9, FALSE, FALSE)
 
' empty keyboard buffer
While InKey <> "" : Wend
Print : Print "hit any key to end program"
Sleep
End