Hi friends,
what is the meaning of the communication protocol, what is the purpose of it, what I found we can give any value for the any variable to declare as the communication protocol, but the condition is the hex value must be same for master and slave declaration.
thanks
Saran
communication protocol
-
- Posts: 61
- Joined: Thu Dec 20, 2007 4:23 pm
- Location: singapore
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: communication protocol
Hello Saran
In the past I have created systems like this.
Master - Sends out commands with data depending on operation.
eg
0x80 - Master Present
0x81 - Master Polling Nodes
0x82, 0x40, 0x50 - Slave do something with the data values 0x40, 0x50.
etc
Slave - Receives commands and then checks the following bytes for data.
eg
if(incoming_byte >= 0x80 && incoming_byte < 0xFF)
{
change command mode to new command
}
else if (incoming_byte < 0x80)
{
receiving data to go with last received command.
}
else nothing received
Hope this helps.
In the past I have created systems like this.
Master - Sends out commands with data depending on operation.
eg
0x80 - Master Present
0x81 - Master Polling Nodes
0x82, 0x40, 0x50 - Slave do something with the data values 0x40, 0x50.
etc
Slave - Receives commands and then checks the following bytes for data.
eg
if(incoming_byte >= 0x80 && incoming_byte < 0xFF)
{
change command mode to new command
}
else if (incoming_byte < 0x80)
{
receiving data to go with last received command.
}
else nothing received
Hope this helps.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel