Jump to content

Keine Verbindung zu BrickletIndustrialDigitalIn4 in Matlab


Tobias
 Share

Recommended Posts

Hallo,

 

ich suche jetzt schon eine ganze Weile verzweifelt eine Lösung so folgendem Problem:

 

function matlab_example_simple()
    import com.tinkerforge.IPConnection;
    import com.tinkerforge.BrickletIndustrialDigitalIn4;

    HOST = 'localhost';
    PORT = 4223;
    UID = 'oae'; % Change XYZ to the UID of your Industrial Digital In 4 Bricklet

    ipcon = IPConnection(); % Create IP connection
    idi4 = handle(BrickletIndustrialDigitalIn4(UID, ipcon), 'CallbackProperties'); % Create device object

    ipcon.connect(HOST, PORT); % Connect to brickd
    % Don't use device before ipcon is connected

    % Get current value as bitmask
    valueMask = idi4.getValue();
    fprintf('Value Mask: %s\n', dec2bin(valueMask));

    input('Press key to exit\n', 's');
    ipcon.disconnect();
end

 

Dieser Code ist ein Beispiel-Code von tinkerforge.com. Er führt bei mir in Matlab zu folgendem Fehler:

 

Error using spielwiese (line 12)
Java exception occurred:
com.tinkerforge.NetworkException: Could not create socket: Connection refused: connect

at com.tinkerforge.IPConnectionBase.connectUnlocked(IPConnectionBase.java:513)

at com.tinkerforge.IPConnectionBase.connect(IPConnectionBase.java:469)

Caused by: java.net.ConnectException: Connection refused: connect

at java.net.DualStackPlainSocketImpl.connect0(Native Method)

at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)

at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)

at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)

at java.net.AbstractPlainSocketImpl.connect(Unknown Source)

at java.net.PlainSocketImpl.connect(Unknown Source)

at java.net.SocksSocketImpl.connect(Unknown Source)

at java.net.Socket.connect(Unknown Source)

at java.net.Socket.connect(Unknown Source)

at java.net.Socket.<init>(Unknown Source)

at java.net.Socket.<init>(Unknown Source)

at com.tinkerforge.IPConnectionBase.connectUnlocked(IPConnectionBase.java:511)

... 1 more

 

Auf meinem alten PC (Windows 7, Matlab 2014b) konnte ich die Verbindung ganz normal aufbauen. Seit ich den neuen PC habe (Windows 10, Matlab 2017a) funktioniert es leider nicht mehr.

 

Habe mich ganz genau an die Installationsanleitung von https://www.tinkerforge.com/de/doc/Software/API_Bindings_MATLAB.html#api-bindings-matlab-install gehalten.

 

Hat jemand eine Idee, woran das liegen könnte?

 

Vielen Dank!  :)

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...