-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ModbusTCP communication over two RaspberryPi, master and slave #691
Comments
Would you send me your master and slave code, please? |
The code has very little changed from your code. Here are the files for you. The ip address in the master code should be the ip address where the slave code is running. |
I still getting error, how your network is configured?Please explain me how you running scripts.Thank you very much.My master has IP 192.168.100.104 and slave device has IP 192.168.100.102. |
@dglover thank you very much. One last question :D how do you know that your server have two float values, as you say? |
Hi!
I'm trying to communicate over two Raspberry Pi. There is code for master :
#include <stdio.h>
#include <stdlib.h>
#include <modbus.h>
int main(int argc, char *argv[]) {
modbus_t *ctx;
uint16_t tab_reg[64];
int rc;
}
There is slave:
#include <stdio.h>
#include <stdlib.h>
#include <modbus/modbus.h>
int main(int argc, char *argv[]) {
modbus_t *ctx;
modbus_mapping_t *mb_mapping;
int socket;
}
When I run master side, i get error connection refused , like there is even no connection. Please some help,very gratefull!
The text was updated successfully, but these errors were encountered: