kianyuen
Controls from WPF.UI can't render properly on WPF, .NET Framework 4.8
I mean, it's a NuGet package, the thing is I referenced it all the way from App.xaml to UserControl, the only place there can even be code within my control is this xaml (aside from my screenshot):
20 replies
How to stream bytes from SerialPort (System.IO.Ports) into a chart.
About parsing, my current flow is
1. loop through the buffer scanning for header
2. process/store the data based on the packet definition
3. (haven't implemented validation, but i guess i should put it here)
4. just prune everything til the last processed packet in the buffer.
That's it, right?
13 replies
How to stream bytes from SerialPort (System.IO.Ports) into a chart.
The one I'm currently dealing with is pretty simple, first byte will be used as a header (documented in a PDF file) for each packet (data range from 0 to 7 bytes).
This one is pretty overwhelming to me tho, I asked for a demonstration app/source code from the supplier and all they said were "we currently only have the instruction set":
- Request data format
Command head + command word + length word + data filed + check word
Command head: two bytes, Default is 0X55, 0XAA
Command word: one byte
Length word: two bytes, indicate this command start from length word to check
words bytes (not include check word),low-order in front
Data filed: this option can be 0
Check word: Byte-by-byte XOR value from the command head to the last byte of the
data field
- Reply data format
Command head + command word + identifier word + length word + data field + check
word
Command head: two bytes, Default is 0x55,0xAA
Command head: one byte
Identifier word:one byte, 0x00 means response successfully, others means defeated
or error
Length word:two bytes,indicate this command start from length word to check
words’ bytes (not include check word),low-order in front
Data filed: this option can be 0
Check word: Byte-by-byte XOR value from the command head to the last byte of the
data field
13 replies
How to stream bytes from SerialPort (System.IO.Ports) into a chart.
i got some problem with implementing it and had some trouble finding an existing implementation online, but it kinda sorted out for now.
i was thinking maybe there was already some way to just pull it packet by packet from the existing buffer of the port but I guess it is inherently this way.
13 replies