Address 0xFA and address 0x80+n
It seems that 0xFA prefixes some commands which have a response and one that is considered a broadcast message. On the other hand, 0x80 is the default address for commands that can be directed to a laser hooked in parallel to another. That address can be changed so that multiple lasers can be utilized on a single circuit.
What is the philosophy of the 0xFA address? Why is it a broadcast address in one instance but perhaps a broadcast address where all devices answer in other instances?
The protocol documentation is not well organized nor does it supply important specifics. An explanation of command organization to the field level would be helpful.
Mark
It sure looks like there is a lot of indifference to the lack of meaningful information regarding these devices. So, I'm going to write a brand-spanking-new manual for the SEN0366. I will open it up to community improvements. After the merit of such a work is obvious, perhaps even the engineers at DFRobot who created this device will provide helpful information.
The Internet and cellular phone have ruined young people's perception of technical documentation. The datasheets of old were works of art compared to what they produce today. Study some “language arts” as well as engineering. You folks desperately need it.
Marcus.Lossner<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 11">
<meta name=Originator content="Microsoft Word 11">
<link rel=File-List href="Test_files/filelist.xml">
<title>This is a test</title>
<!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Author>Mark Lossner</o:Author>
<o:LastAuthor>Mark Lossner</o:LastAuthor>
<o:Revision>1</o:Revision>
<o:TotalTime>4</o:TotalTime>
<o:Created>2024-11-16T12:54:00Z</o:Created>
<o:LastSaved>2024-11-16T12:58:00Z</o:LastSaved>
<o:Pages>1</o:Pages>
<o:Words>25</o:Words>
<o:Characters>146</o:Characters>
<o:Company>MS</o:Company>
<o:Lines>1</o:Lines>
<o:Paragraphs>1</o:Paragraphs>
<o:CharactersWithSpaces>170</o:CharactersWithSpaces>
<o:Version>11.6568</o:Version>
</o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:PunctuationKerning/>
<w:DrawingGridHorizontalSpacing>6 pt</w:DrawingGridHorizontalSpacing>
<w:DisplayHorizontalDrawingGridEvery>2</w:DisplayHorizontalDrawingGridEvery>
<w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" LatentStyleCount="156">
</w:LatentStyles>
</xml><![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;
mso-font-charset:2;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:0 268435456 0 0 -2147483648 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin-top:3.0pt;
margin-right:0in;
margin-bottom:3.0pt;
margin-left:0in;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
h1
{mso-style-next:Normal;
margin-top:12.0pt;
margin-right:0in;
margin-bottom:3.0pt;
margin-left:0in;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:1;
font-size:16.0pt;
font-family:Arial;
mso-font-kerning:16.0pt;}
p.MsoHeader, li.MsoHeader, div.MsoHeader
{margin-top:3.0pt;
margin-right:0in;
margin-bottom:3.0pt;
margin-left:0in;
mso-pagination:widow-orphan;
tab-stops:center 3.0in right 6.0in;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
p.MsoFooter, li.MsoFooter, div.MsoFooter
{margin-top:3.0pt;
margin-right:0in;
margin-bottom:3.0pt;
margin-left:0in;
mso-pagination:widow-orphan;
tab-stops:center 3.0in right 6.0in;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
/* Page Definitions */
@page
{mso-footnote-separator:url("Test_files/header.htm") fs;
mso-footnote-continuation-separator:url("Test_files/header.htm") fcs;
mso-endnote-separator:url("Test_files/header.htm") es;
mso-endnote-continuation-separator:url("Test_files/header.htm") ecs;}
@page Section1
{size:8.5in 11.0in;
margin:.5in .5in .5in .5in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{mso-list-id:351151373;
mso-list-type:hybrid;
mso-list-template-ids:1306972146 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:.5in;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Symbol;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</style>
<![endif]-->
</head>
<body lang=EN-US style='tab-interval:.5in'>
<div class=Section1>
<h1>This is a test</h1>
<p class=MsoNormal>I have tried to format posts for clarity, only to have them
mangled upon display.</p>
<p class=MsoNormal>So, maybe HTML will do:</p>
<ul style='margin-top:0in' type=disc>
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'>It
would be swell</li>
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'>To
format posts</li>
</ul>
<p class=MsoNormal>How about this?</p>
</div>
</body>
</html>
Marcus.LossnerHow does one format a post?
Also, one might want to know if specific addresses can be used with those commands which are documented with the broadcast address.
Marcus.LossnerWould you tell us which sensor are you using?
Yeez_BSEN0366, the forum I posted in.
The use of 0xFA as an address in communication protocols—particularly in the context of broadcast messaging—can be understood through a few key concepts about how devices communicate within a networked system or protocol.
1. Broadcast Address
In many communication systems, a special address like 0xFA can be used to signify a broadcast. This means that a command or message sent to 0xFA is intended for all devices that share this address. The devices receiving the broadcast are expected to act on it or respond in some predefined manner. In the case you've mentioned, 0xFA seems to operate as a broadcast address under some conditions.
2. Broadcast with Response
In instances where 0xFA is used as a prefix, it indicates that the command is broadcast to multiple devices, and each one will respond individually. This is often used in scenarios where a command affects many devices simultaneously, but each device is still expected to reply with its own specific data or acknowledgment. The responses are typically not aggregated into a single message, but are sent separately by each device to the requester.
3. Non-Response Broadcast
Alternatively, 0xFA can be used for broadcast messages that do not require a response from the devices. This is usually for commands that are more "one-way" in nature, where the device receiving the message simply executes it without sending back any acknowledgment or data.
4. Flexible Addressing for Multiple Devices
In other cases, the protocol may use 0xFA as a way to initiate a broadcast that is interpreted differently by each device on the network, depending on whether they are in a "listening" state or actively participating in the system. When it is used in this way, the address 0xFA becomes a shorthand for broadcasting to all connected devices, but the devices can each determine if and how they should respond based on their capabilities or the specifics of the message.
5. Laser Command Organization
For the laser example, the address 0x80 is used by default for commands that are directed to a single laser or a specific laser in a system. However, if multiple lasers are hooked up to a shared circuit, each laser can be assigned a different address (or use 0x80 in a way that ensures each one knows which commands it should respond to). The flexibility of this addressing allows for scalable command distribution without the need for physical rewiring.
Why 0xFA Is Sometimes Broadcast and Sometimes Not
The key difference here is whether the protocol is designed for a group response or a no-response broadcast:
Group Response Broadcast: When 0xFA is used for commands that require each device to respond individually, this would typically be part of a system where each device must acknowledge receipt or provide some kind of data back to the controller.
No-Response Broadcast: When 0xFA is a broadcast with no expected response, it allows for system-wide commands that need to be acted upon simultaneously without generating network traffic from each device.
Conclusion: Command Organization Philosophy
The underlying philosophy of 0xFA as a broadcast address seems to center around flexibility—either to issue a command to all devices or to receive responses from all devices. The use of 0xFA can adapt depending on whether the protocol is designed for single-way (no response needed) or two-way communication (where all devices reply).
In terms of the documentation’s organization, this kind of behavior might not be explicitly called out because it's often implicit in the protocol’s design. It would be helpful to look for a command structure or message types section in the protocol documentation, where it explains how addresses function in different contexts, to gain more clarity on when 0xFA should trigger one or the other of these behaviors.
Tonny12138Thank you for that long and detailed post. It shows a strong willingness to help and a great deal of patience. I am a very old hand at addressable protocols. My question was not regarding the address, but the entire philosophy of message organization. What I want to know is the underlying structure of these messages so that I can craft a pleasant and tidy function library to handle this device.
So, let us examine the first command presented in the SEN0366 protocol document. That is the “Read Parameter” command FA 06 01 FF. We know the following:
FA – Broadcast address. (Just a special address can be inferred.)06 – Perhaps a command category01 – The functional commandFF – Computed checksumThe next command is FA 06 04 FC. We know the following:
FA – Broadcast address06 – Same command category04 – The actual command?FC – Computed checksum
There seems to be a command category 06 consisting of sub-commands 01, 02, 03, 04, 05, 06, and 07.
The third command in the table is “Set Address”, FA 04 01 <ADDR> <CS>. Here we have:
FA – Broadcast address04 – A new command category?01 – The functional command for this message?<ADDR> - A byte containing the new address to bestow upon the device<CS> - The computed checksum.
Look at what seems to be command category 04: Sub-commands 01, 02, 05, 06, 08, 09, 0A, 0C, and 0D. Are there some undocumented commands in that sparse matrix?
So, perhaps we do see some structure in those commands. Are there command categories that are unpublished?
I would guess that commands must start with an address which must have the left-most bit set and that command content is prohibited from having that bit set. (Except for the checksum, I suppose.) Does this mean that any new value for the “Set Address” command must have its leftmost bit set? If so, this should be stated in the documentation.
So, you see, I seek the underlying philosophy of the format and organization of messages. That information would lead to prettier software than a brute force set of examples.
Mark
Is it wise to have any broadcast message issue a reply? Of course not.
Can you see why I raise questions about this device's communications protocol?