We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 33e2a7f + 36d23b6 commit 1d5bfa3Copy full SHA for 1d5bfa3
PetitModbus.c
@@ -117,7 +117,7 @@ unsigned char PetitSendMessage(void)
117
void HandlePetitModbusError(char ErrorCode)
118
{
119
// Initialise the output buffer. The first byte in the buffer says how many registers we have read
120
- Petit_Tx_Data.Function = ErrorCode | 0x80;
+ Petit_Tx_Data.Function = Petit_Rx_Data.Function | 0x80;
121
Petit_Tx_Data.Address = PETITMODBUS_SLAVE_ADDRESS;
122
Petit_Tx_Data.DataLen = 1;
123
Petit_Tx_Data.DataBuf[0] = ErrorCode;
0 commit comments