Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

MBS FileMaker Plugin Example Databases

UDP Broadcast

All examples are included with download of MBS FileMaker Plugin.

UDP Broadcast.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts4
Value Lists0
Custom Functions0
Custom Menus33
File Options
Default custom menu set[Standard FileMaker Menus]
When opening file
Minimum allowed version12.0
Login usingAccount Name; Account= Admin
Allow user to save passwordOff
Require iOS passcodeOff
Switch to layoutOff
Hide all toolbarsOff
Script triggers
OnFirstWindowOpenScript: Init
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
UDP Broadcast
6 fields defined, 0 record
UDP Broadcast

Fields

Table Name: UDP Broadcast - 6 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
BroadcastAddressNormal, TextAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Global
  • Repetitions: 1
  • Index Language: German
      Message To SendNormal, TextAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Global
      • Repetitions: 1
      • Index Language: German
          Message ReceivedNormal, TextAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
              SenderNormal, TextAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Repetitions: 1
              • Indexing: None
              • Automatically create indexes as needed
              • Index Language: German
                  PortNormal, NumberAuto-Enter:
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Global
                  • Repetitions: 1
                  • Index Language: German
                      Send ResultNormal, TextAuto-Enter:
                      • Allow editing
                      Validation:
                      • Only during data entry
                      Storage:
                      • Global
                      • Repetitions: 1
                      • Index Language: German

                          Layout Objects: UDP Broadcast

                          Regular Fields

                          Field Name: UDP Broadcast::BroadcastAddress
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 6 pt
                          • Left: 138 pt
                          • Bottom: 20 pt
                          • Right: 391 pt
                          • Anchoring: Left, Top
                          Field Format:
                          • Edit Box
                          Field Behavior:
                          • Allow field to be entered: In Find mode, In Browse mode
                          • Touch keyboard type: System Default
                          • Go to next field using: Tab key
                          No

                          Field Name: UDP Broadcast::Message To Send
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 24 pt
                          • Left: 138 pt
                          • Bottom: 38 pt
                          • Right: 391 pt
                          • Anchoring: Left, Top
                          Field Format:
                          • Edit Box
                          Field Behavior:
                          • Allow field to be entered: In Find mode, In Browse mode
                          • Touch keyboard type: System Default
                          • Go to next field using: Tab key
                          No

                          Field Name: UDP Broadcast::Message Received
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 78 pt
                          • Left: 138 pt
                          • Bottom: 92 pt
                          • Right: 391 pt
                          • Anchoring: Left, Top
                          Field Format:
                          • Edit Box
                          Field Behavior:
                          • Allow field to be entered: In Find mode, In Browse mode
                          • Touch keyboard type: System Default
                          • Go to next field using: Tab key
                          Yes

                          Field Name: UDP Broadcast::Sender
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 96 pt
                          • Left: 138 pt
                          • Bottom: 110 pt
                          • Right: 391 pt
                          • Anchoring: Left, Top
                          Field Format:
                          • Edit Box
                          Field Behavior:
                          • Allow field to be entered: In Find mode, In Browse mode
                          • Touch keyboard type: System Default
                          • Go to next field using: Tab key
                          Yes

                          Field Name: UDP Broadcast::Port
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 42 pt
                          • Left: 138 pt
                          • Bottom: 56 pt
                          • Right: 217 pt
                          • Anchoring: Left, Top
                          Field Format:
                          • Edit Box
                          Field Behavior:
                          • Allow field to be entered: In Find mode, In Browse mode
                          • Touch keyboard type: System Default
                          • Go to next field using: Tab key
                          No

                          Field Name: UDP Broadcast::Send Result
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 42 pt
                          • Left: 300 pt
                          • Bottom: 56 pt
                          • Right: 553 pt
                          • Anchoring: Left, Top
                          Field Format:
                          • Edit Box
                          Field Behavior:
                          • Allow field to be entered: In Find mode, In Browse mode
                          • Touch keyboard type: System Default
                          • Go to next field using: Tab key
                          No

                          Group Buttons

                          Button PropertiesCoordinatesScript/Script Step
                            Type:
                          • Text: Send Message
                            Additional Properties:
                          • Change to hand cursor over button
                          • Rectangular
                          • Top: 6 pt
                          • Left: 402 pt
                          • Bottom: 31 pt
                          • Right: 541 pt
                          • Anchoring: Left, Top
                          Perform Script [ “Send” ]

                          Scripts:


                          Script Hierarchy

                          Send
                          CreateReceivingSocket
                          Init
                          ReadMessage

                          Next Script: [CreateReceivingSocket]
                          Script NameSend
                          Run script with full access privilegesOff
                          Include In MenuYes
                          Layouts that use this script
                          Scripts that use this script
                            Script Definition
                            Script Steps
                            • Set Variable [ $r; Value:MBS("Socket.SendMessage"; $$sock; UDP Broadcast::BroadcastAddress; UDP Broadcast::Port; UDP Broadcast::Message To Send; "UTF-8") ]
                            • If [ GetAsNumber($r) = 0 ]
                            • Set Field [ UDP Broadcast::Send Result; "Failed to Send: "&$r ]
                            • Else
                            • Set Field [ UDP Broadcast::Send Result; "Sent "&$r&" Bytes." ]
                            • End If
                            Fields used in this script
                            Scripts used in this script
                              Layouts used in this script
                                Tables used in this script
                                Table occurrences used by this script
                                Custom Functions used by this script
                                  Custom menu set used by this script

                                    Previous Script: [Send]Next Script: [Init]
                                    Script NameCreateReceivingSocket
                                    Run script with full access privilegesOff
                                    Include In MenuYes
                                    Layouts that use this script
                                      Scripts that use this script
                                      Script Definition
                                      Script Steps
                                      • If [ not (GetAsNumber($$sock) > 0) ]
                                      • Set Variable [ $$sock; Value:MBS("Socket.NewUDPSocket") ]
                                      • If [ GetAsNumber($$sock) = 0 ]
                                      • Show Custom Dialog [ Title: "Failed to create Socket"; Message: $$sock; Default Button: “OK”, Commit: “No”; Button 2: “Cancel”, Commit: “No” ]
                                      • Exit Script [ ]
                                      • End If
                                      • End If
                                      • Set Variable [ $r; Value:MBS("Socket.Listen"; $$sock; UDP Broadcast::Port) ]
                                      • Set Field [ UDP Broadcast::Send Result ]
                                      • Set Variable [ $r; Value:MBS("Socket.SetDataAvailableHandler"; $$sock; Get(FileName); "ReadMessage") ]
                                      • Set Variable [ $r; Value:MBS("Socket.SetBroadcast"; $$sock; 1) ]
                                      • Set Variable [ $r; Value:MBS("Socket.SetMulticastLoop"; $$sock; 0) ]
                                      Fields used in this script
                                      Scripts used in this script
                                        Layouts used in this script
                                          Tables used in this script
                                          Table occurrences used by this script
                                          Custom Functions used by this script
                                            Custom menu set used by this script

                                              Previous Script: [CreateReceivingSocket]Next Script: [ReadMessage]
                                              Script NameInit
                                              Run script with full access privilegesOff
                                              Include In MenuYes
                                              Layouts that use this script
                                                Scripts that use this script
                                                  Script Definition
                                                  Script Steps
                                                  • Perform Script [ “CreateReceivingSocket” ]
                                                  Fields used in this script
                                                    Scripts used in this script
                                                    Layouts used in this script
                                                      Tables used in this script
                                                        Table occurrences used by this script
                                                          Custom Functions used by this script
                                                            Custom menu set used by this script

                                                              Previous Script: [Init]
                                                              Script NameReadMessage
                                                              Run script with full access privilegesOff
                                                              Include In MenuYes
                                                              Layouts that use this script
                                                                Scripts that use this script
                                                                  Script Definition
                                                                  Script Steps
                                                                  • Set Variable [ $r; Value:MBS("Socket.Read"; $$sock; 1500; "UTF-8") ]
                                                                  • If [ Left($r; 5) = "[MBS]" ]
                                                                  • Show Custom Dialog [ Title: "Error Reading"; Message: $r; Default Button: “OK”, Commit: “No”; Button 2: “Cancel”, Commit: “No” ]
                                                                  • Else If [ Length($r) = 0 ]
                                                                  • Show Custom Dialog [ Title: "Error Reading"; Message: "No data available."; Default Button: “OK”, Commit: “No”; Button 2: “Cancel”, Commit: “No” ]
                                                                  • Else
                                                                  • New Record/Request
                                                                  • Set Field [ UDP Broadcast::Message Received; $r ]
                                                                  • Set Field [ UDP Broadcast::Sender; MBS("Socket.LastMessageIP"; $$sock) ]
                                                                  • Commit Records/Requests [ No dialog ]
                                                                  • End If
                                                                  Fields used in this script
                                                                  Scripts used in this script
                                                                    Layouts used in this script
                                                                      Tables used in this script
                                                                      Table occurrences used by this script
                                                                      Custom Functions used by this script
                                                                        Custom menu set used by this script

                                                                          Download example: UDP Broadcast

                                                                          Used functions: