Matlab serial communication cannot be entered BreakInterruptFcn event

17 ビュー (過去 30 日間)
hui wang
hui wang 2020 年 9 月 3 日
回答済み: hui wang 2020 年 9 月 3 日
Hello everyone, I encountered a problem when doing matlab serial communication. My lower computer sends a signal every 200m, but I set the BreakInterruptFcn function and failed to trigger the callback function. The matlab document explanation of BreakInterruptFcn is:You configure BreakInterruptFcn to execute an M-file callback function when a break-interrupt event occurs. A break-interrupt event is generated by the serial port when the received data is in an off (space) state longer than the transmission time for one byte.
Can anyone tell me the trigger conditions of BreakInterruptFcn or how to trigger BreakInterruptFcn?
The properties of my serial port object are:
get(ControlObj)
ByteOrder = littleEndian
BytesAvailable = 0
BytesAvailableFcn = [1x1 function_handle]
BytesAvailableFcnCount = 30
BytesAvailableFcnMode = byte
BytesToOutput = 0
ErrorFcn =
InputBufferSize = 1500
Name = Serial-COM3
ObjectVisibility = on
OutputBufferSize = 1500
OutputEmptyFcn = [1x1 function_handle]
RecordDetail = compact
RecordMode = overwrite
RecordName = record.txt
RecordStatus = off
Status = closed
Tag =
Timeout = 1
TimerFcn =
TimerPeriod = 1
TransferStatus = idle
Type = serial
UserData = []
ValuesReceived = 0
ValuesSent = 0
SERIAL specific properties:
BaudRate = 9600
BreakInterruptFcn = [1x1 function_handle]
DataBits = 8
DataTerminalReady = on
FlowControl = none
Parity = none
PinStatus = [1x1 struct]
PinStatusFcn =
Port = COM3
ReadAsyncMode = continuous
RequestToSend = on
StopBits = 1
Terminator = CR
Can anyone help me, thanks in advance!!!

回答 (1 件)

hui wang
hui wang 2020 年 9 月 3 日
is connect with RS232

カテゴリ

Help Center および File ExchangeManage Products についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by