Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hallo Leute hab ein vorliegendes Matlabprogramm zur Steuerung eines Monochromators... nur will das nicht so richtig funktionieren! Beim durchgehen des Quelltextes finde ich keinen sonderbaren Feheler, was auch daran liegen kann dass ich nicht gerade ein pro in Matlab bin....!

Das komische ist das manchmal keine Fehlermeldung kommt und beim zweiten MAl dann wieder eine erscheint obwohl nix am programm geändert wurde ...!

Hier ist mein Programcode:

--------------------------------------

s1 = serial('COM2') % COM2 für den Monochromator

s1.Name = 'MultiMode4' % Name der Verbindung (wichtig für SendToPack.m)

fopen(s1)

fprintf(s1,char([1 20 'RWL_' 25])) % Auslesen der aktuellen Wellenlänge

if s1.BytesAvailable

fgetl(s1)

end

fprintf(s1,char([1 20 'DSPO' 2 '00' 25])) % Display aus

if s1.BytesAvailable

fread(s1,s1.BytesAvailable)

end

fprintf(s1,char([1 20 'SDEL' 2 '0005' 25])) % Geschwindigkeit auf 5

if s1.BytesAvailable

fread(s1,s1.BytesAvailable)

end

fprintf(s1,char([1 20 'GOTO' 2 '030000000000' 25])) % GOTO Wellenlänge

if s1.BytesAvailable

fread(s1,s1.BytesAvailable)

end

fprintf(s1,char([1 20 'DSPO' 2 '01' 25])) % Display an

if s1.BytesAvailable

fread(s1,s1.BytesAvailable)

end

fprintf(s1,char([4 25])) % Remote off

if s1.BytesAvailable

fread(s1,s1.BytesAvailable)

end

fclose(s1);

delete(s1);

clear s1

----------------------------------------

Es erscheint diese MEldung:

----------------------------------------

Serial Port Object : Serial-COM2

Communication Settings

Port: COM2

BaudRate: 9600

Terminator: 'LF'

Communication State

Status: closed

RecordStatus: off

Read/Write State

TransferStatus: idle

BytesAvailable: 0

ValuesReceived: 0

ValuesSent: 0

Serial Port Object : MultiMode4

Communication Settings

Port: COM2

BaudRate: 9600

Terminator: 'LF'

Communication State

Status: closed

RecordStatus: off

Read/Write State

TransferStatus: idle

BytesAvailable: 0

ValuesReceived: 0

ValuesSent: 0

??? Error using ==> serial.fopen at 71

Port: COM2 is not available. Available ports: COM1.

Use INSTRFIND to determine if other instrument objects are connected to the requested device.

Error in ==> MultiMode4Test at 3

fopen(s1)

----------------------------------

Entschuldigt den langen Quelltext , aber ich weiß echt nicht wodran es liegen könnte...!

Gruß Tony

zusätzliche Frage :

Woran könnte es liegen das der Status als "closed" angezeigt wird?

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.