Click here to Skip to main content
15,888,351 members
Home / Discussions / C#
   

C#

 
AnswerRe: Read information from serial port in Mathlab format Pin
Richard Andrew x645-Apr-24 11:01
professionalRichard Andrew x645-Apr-24 11:01 
GeneralRe: Read information from serial port in Mathlab format Pin
Victor Gonzalez 20245-Apr-24 12:26
Victor Gonzalez 20245-Apr-24 12:26 
AnswerRe: Read information from serial port in Mathlab format Pin
jschell5-Apr-24 12:20
jschell5-Apr-24 12:20 
GeneralRe: Read information from serial port in Mathlab format Pin
Victor Gonzalez 20245-Apr-24 12:28
Victor Gonzalez 20245-Apr-24 12:28 
GeneralRe: Read information from serial port in Mathlab format Pin
Richard MacCutchan5-Apr-24 22:44
mveRichard MacCutchan5-Apr-24 22:44 
GeneralRe: Read information from serial port in Mathlab format Pin
Victor Gonzalez 20245-Apr-24 23:22
Victor Gonzalez 20245-Apr-24 23:22 
GeneralRe: Read information from serial port in Mathlab format Pin
Richard MacCutchan5-Apr-24 23:41
mveRichard MacCutchan5-Apr-24 23:41 
GeneralRe: Read information from serial port in Mathlab format Pin
Luc Pattyn6-Apr-24 8:16
sitebuilderLuc Pattyn6-Apr-24 8:16 
Hi,

1.
to read binary data use the method SerialPort.Read(Byte[], Int32, Int32)[^]

2.
I seldom use the DataReceived event as it is the source of a number of problems. I'd rather use a separate thread (or a BackGroundWorker) that periodically calls a Read method.

3.
I am puzzled by the fact that your second data format shows 15 bytes per line, not 16 as is usual.

4.
I noticed your data seems to have a periodicity of 21 bytes; when reformatted it looks like this:
e0 08 15 03 00 04 4c 00 b1 01 00 06 00 00 00 00 00 00 28 00 eb 
e0 09 15 03 00 04 4c 3e a1 00 06 00 00 00 00 00 00 00 56 00 eb 
e0 0a 15 03 00 04 4c 00 a2 00 00 00 00 00 00 00 00 00 14 00 eb
e0 0b 15 03 00 04 4c 00 a3 00 00 00 00 00 00 00 00 00 16 00 eb
e0 0c 15 03 00 04 4c 00 a7 00 00 00 00 00 00 00 00 00 1b 00 eb 


Hope this helps.

Smile | :)
Luc Pattyn [My Articles]
The Windows 11 taskbar is a disgrace; a third-party add-on is needed to reverse the deterioration. I decline such a downgrade.

GeneralRe: Read information from serial port in Mathlab format Pin
Victor Gonzalez 20247-Apr-24 1:12
Victor Gonzalez 20247-Apr-24 1:12 
GeneralRe: Read information from serial port in Mathlab format Pin
Luc Pattyn7-Apr-24 1:52
sitebuilderLuc Pattyn7-Apr-24 1:52 
GeneralRe: Read information from serial port in Mathlab format Pin
Victor Gonzalez 20247-Apr-24 6:04
Victor Gonzalez 20247-Apr-24 6:04 
GeneralRe: Read information from serial port in Mathlab format Pin
Luc Pattyn7-Apr-24 8:13
sitebuilderLuc Pattyn7-Apr-24 8:13 
GeneralRe: Read information from serial port in Mathlab format Pin
Victor Gonzalez 20247-Apr-24 9:53
Victor Gonzalez 20247-Apr-24 9:53 
GeneralRe: Read information from serial port in Mathlab format Pin
Luc Pattyn7-Apr-24 11:04
sitebuilderLuc Pattyn7-Apr-24 11:04 
GeneralRe: Read information from serial port in Mathlab format Pin
Victor Gonzalez 20247-Apr-24 22:42
Victor Gonzalez 20247-Apr-24 22:42 
GeneralRe: Read information from serial port in Mathlab format Pin
Luc Pattyn7-Apr-24 22:45
sitebuilderLuc Pattyn7-Apr-24 22:45 
QuestionDebugging the Sandbox Pin
Richard Andrew x645-Apr-24 3:43
professionalRichard Andrew x645-Apr-24 3:43 
QuestionIParsable? IFormattable? ICustomFormatter? IFormatProvider? TryParse! ToString! Pin
Tracy Dryden24-Mar-24 12:29
Tracy Dryden24-Mar-24 12:29 
AnswerRe: IParsable? IFormattable? ICustomFormatter? IFormatProvider? TryParse! ToString! Pin
Mycroft Holmes24-Mar-24 15:07
professionalMycroft Holmes24-Mar-24 15:07 
GeneralRe: IParsable? IFormattable? ICustomFormatter? IFormatProvider? TryParse! ToString! Pin
Tracy Dryden24-Mar-24 16:19
Tracy Dryden24-Mar-24 16:19 
AnswerRe: IParsable? IFormattable? ICustomFormatter? IFormatProvider? TryParse! ToString! Pin
Ralf Meier24-Mar-24 22:35
mveRalf Meier24-Mar-24 22:35 
GeneralRe: IParsable? IFormattable? ICustomFormatter? IFormatProvider? TryParse! ToString! Pin
Tracy Dryden25-Mar-24 7:51
Tracy Dryden25-Mar-24 7:51 
AnswerRe: IParsable? IFormattable? ICustomFormatter? IFormatProvider? TryParse! ToString! Pin
jschell26-Mar-24 12:00
jschell26-Mar-24 12:00 
Rant(Current) AI Rant. Pin
Gerry Schmitz17-Mar-24 12:29
mveGerry Schmitz17-Mar-24 12:29 
GeneralRe: (Current) AI Rant. Pin
Eddy Vluggen26-Mar-24 5:34
professionalEddy Vluggen26-Mar-24 5:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.