Jump to content

Gruppierung Industrial Bricklets


Recommended Posts

Hi,

Zustand: mehrere gruppierte Bricklets an einem Master.

   

$uid_iqr1 = 'abc';

$uid_iqr2 = 'xyz';

...

$iqr1 = new BrickletIndustrialQuadRelay($uid_iqr1, $ipcon);

$iqr2 = new BrickletIndustrialQuadRelay($uid_iqr2, $ipcon);

...

 

Ist es nun egal ob ich

$iqr1->setValue($value);

oder

$iqr2->setValue($value);

verwende??

Danke

Link to comment
Share on other sites

Wenn du bei Bricklet A zuvor setGroup aufgerufen hast, dann kannst du mit A.setValue auch die verbundenen (gruppierten) Bricklets mit setzen.

 

Der Aufruf von setValue für ein anderes Bricklet aus der Gruppe wird aber nicht die den Status Gruppe ändern, sondern nur für das Bricklet.Möchtest du das es auch den Status der Gruppe ändern kann, so musst du für dieses Bricklet ebenfalls setGroup aufrufen.

 

Wir werden unsere Doku dahingehend mal verbessern

 

Grüße

Link to comment
Share on other sites

  • 9 months later...

Ich versuche zwei Industrial Quad Relays zum gruppieren, aber da ich Anfänger bin, habe ich den Weg nicht gefunden.

Ich habe so gemacht.

 

<html>

<head>

  <meta charset="UTF-8">

  <title>Control</title>

</head>

<body>

  <form id="form1" name="form1" method="post" action="index.php">

      <table border="1" cellpadding="1" cellspacing="4">

        <tr>

            <td>Light 1</td>

            <td><input name="klickl1" type="submit" value="On" /></td>

            <td><input name="klickr1" type="submit" value="Off" /></td>

        </tr>

        <tr>

            <td>Light 2</td>

            <td><input name="klickl2" type="submit" value="On" /></td>

            <td><input name="klickr2" type="submit" value="Off" /></td>

        </tr>

        <tr>

            <td>Light 3</td>

            <td><input name="klickl3" type="submit" value="On" /></td>

            <td><input name="klickr3" type="submit" value="Off" /></td>

        </tr>

      </table>

  </form>

  <?php

      require_once('Tinkerforge/IPConnection.php');

      require_once('Tinkerforge/BrickletIndustrialQuadRelay.php');

 

      use Tinkerforge\IPConnection;

      use Tinkerforge\BrickletIndustrialQuadRelay;

 

      $host = '192.168.1.3';

      $port = 4223;

      $uid = 'abc';

      $COMMAND = 0;

 

      if ($_POST['klickl1']) { $COMMAND = 5; } // Pin 0 and 2 high

      if ($_POST['klickr1']) { $COMMAND = 9; } // Pin 0 and 3 high

      if ($_POST['klickl2']) { $COMMAND = 6; } // Pin 1 and 2 high

      if ($_POST['klickr2']) { $COMMAND = 10; } // Pin 1 and 3 high

      if ($_POST['klickl3']) { $COMMAND = 20; } // Pin 1 and 2 high

      if ($_POST['klickr3']) { $COMMAND = 24; } // Pin 1 and 3 high

 

      $ipcon = new IPConnection(); // Create IP connection

      $iqr = new BrickletIndustrialQuadRelay($uid, $ipcon); // Create device object

 

      $ipcon->connect($host, $port); // Connect to brickd

      // Don't use device before ipcon is connected

 

      $iqr->setGroup( "['a','b','n','n']" );

      $grp->setMonoflop($COMMAND, 15, 175);

 

      $ipcon->disconnect();

  ?>

</body>

</html>

 

Aber es funktioniert nicht.

Wie muss man die Gruppe richtig einstellen?

 

Danke.

 

Gruss

Oscar

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...