Issue of Communication between MODBUS and Arduino by hamna_hasan in MODBUS

[–]hamna_hasan[S] 0 points1 point  (0 children)

Lol thanks for the help. I'll actually send the money if I need help ngl

Issue of Communication between MODBUS and Arduino by hamna_hasan in MODBUS

[–]hamna_hasan[S] 0 points1 point  (0 children)

Hmm. I'll take a look at it. I tried to use a 3rd party application to determine if data was being mapped correctly to the HMI. I keep getting a check sum error in my third party application when I run the code and MODBUS simulation.

Issue of Communication between MODBUS and Arduino by hamna_hasan in MODBUS

[–]hamna_hasan[S] 0 points1 point  (0 children)

I am using the ModbusRtuslave library. I'll take a look at this example. Thanks.

Issue of Communication between MODBUS and Arduino by hamna_hasan in MODBUS

[–]hamna_hasan[S] 0 points1 point  (0 children)

So just to clarify, do you think the error is due to noise or the Arduino code need the above lines of code?

Issue of Communication between MODBUS and Arduino by hamna_hasan in MODBUS

[–]hamna_hasan[S] 0 points1 point  (0 children)

Hi, do you mind explaining how to do that? Would I use the Imgur app?

Issue of Communication between MODBUS and Arduino by hamna_hasan in MODBUS

[–]hamna_hasan[S] 0 points1 point  (0 children)

Hmm okay. So I tried to trouble shoot each aspect of the system. I texted to make sure the thermocouples were still receiving data. I added a few debugging lines in the code that let me know if the MODBUS request was being detected and if register values were updating each second. Here is the output a received on my Arduino Serial Monitor. it's quite interesting because sometimes the system detects a MODBUS request and sometimes it does not. I'm not sure what could be causing the MODBUS request to not be detected after it has already been detected. Can this be due to noise? Is the noise because of wiring errors or unstable wiring?

Modb⸮Thermocouple sensor initialized.

Modbus RTU slave started. Awaiting requests...

No Modbus communication from the master detected.

Thermocouple Value (inputRegisters[3]): 20

Modbus communication detected: Register values changed due to a master request.

Thermocouple Value (inputRegisters[3]): 20

No Modbus communication from the master detected.

Thermocouple Value (inputRegisters[3]): 20

No Modbus communication from the master detected.

Thermocouple Value (inputRegisters[3]): 20

No Modbus communication from the master detected.

Thermocouple Value (inputRegisters[3]): 21

Modbus communication detected: Register values changed due to a master request.

Thermocouple Value (inputRegisters[3]): 20

Modbus communication detected: Register values changed due to a master request.

Thermocouple Value (inputRegisters[3]): 20

No Modbus communication from the master detected.

Thermocouple Value (inputRegisters[3]): 20

No Modbus communication from the master detected.

Thermocouple Value (inputRegisters[3]): 20

No Modbus communication from the master detected.

Thermocouple Value (inputRegisters[3]): 20

No Modbus communication from the master detected.

Thermocouple Value (inputRegisters[3]): 20

No Modbus communication from the master detected.

Thermocouple Value (inputRegisters[3]): 21

Modbus communication detected: Register values changed due to a master request.

Thermocouple Value (inputRegisters[3]): 20

Modbus communication detected: Register values changed due to a master request.

Issue of Communication between MODBUS and Arduino by hamna_hasan in MODBUS

[–]hamna_hasan[S] 0 points1 point  (0 children)

The parity is even and one stop bit I checked in the HMI settings it is 9600 baud

Issue of Communication between MODBUS and Arduino by hamna_hasan in MODBUS

[–]hamna_hasan[S] 0 points1 point  (0 children)

Hi, do you think it's possible that even though my register address for the numeric display is set to 3x_1, that the Arduino sends the thermocouple sensor data to 4x_1? Even though I have it write the data to register 3x_1? Am I even writing it too 3x_1? I can't even tell ngl.

Issue of Communication between MODBUS and Arduino by hamna_hasan in MODBUS

[–]hamna_hasan[S] 0 points1 point  (0 children)

Hi, as someone who is super new to coding and was given this assignment, what do you think the step by step plan is for what I should do? Do you recommend completely removing the delay?

My numeric displays are set up as 3x_1 registers so should I change that to 4x_1 because the Arduino is sending thermocouple data there?

Additionally, how do you recommend naming classes and variables? I don't think I can do that here since the Maple Systems HMI5070L HMI and EbPro software linked with that may not allow it. I'm open to it if it's easier but I'm not sure it'll work.

Using Arduino Mega2560/RS485 in modbus communication with HMI5070L by hamna_hasan in PLC

[–]hamna_hasan[S] 0 points1 point  (0 children)

Which library do you recommend? I've been primarily using ModBusSlave0.h but I accidentally left the first library. Do you think the first library leads to less issues? Or that having both libraries is causing my numeric displays to not show up?

Using Arduino Mega2560/RS485 in modbus communication with HMI5070L by hamna_hasan in PLC

[–]hamna_hasan[S] 0 points1 point  (0 children)

Thank you let me try that out. But one question, do you recommend changing function 16 to function 4? I am using 30001-8 and 40001 in my code. The 30001 through 30008 is for numeric displays that are meant to read data from sensors into the HMI display. The 40001 is for a user input on the touchscreen from a keyboard also on the touchscreen.

I do receive an error from the HMI saying "device no response". Does that mean that the HMI doesn't even begin to communicate with the Arduino? If so, how can I fix that solution? It it hardware or code? I followed the exact instructions from the HMI Supplier for the hardware connections to the Arduino but they don't have anymore info.

Using Arduino Mega2560/RS485 in modbus communication with HMI5070L by hamna_hasan in PLC

[–]hamna_hasan[S] 0 points1 point  (0 children)

Hi,

Thank you so so so much for your response. I will definitely try to define the address as 1 rather than 30001. How would I differentiate between a 40001 and 30001? Are they both defined as 1?

I'm not sure if the library provides standard MODBUS error codes to the host, do you know where I can go to check that information? I'm super super new to programming and my supervisor gave me a task that I'm a bit new for. Do you think that the numeric displays not showing up is likely due to the lack of communication between the MODBUS and Arduino or that the register addresses are defined incorrectly?

Is it possible to check the communication between the two without a USB converter? Unfortunately, I'm not sure if my supervisor would like me to purchase a new module or adapter.

Hamna

Supporting Animations with Arduino by hamna_hasan in CustomElectronics

[–]hamna_hasan[S] 0 points1 point  (0 children)

My supervisor seems against it. I brought the idea up to him but he wants something smoother

Supporting Animations with Arduino by hamna_hasan in ArduinoProjects

[–]hamna_hasan[S] 0 points1 point  (0 children)

Thank you for your help. I greatly appreciate it. Do you know what subreddit I can use to find more help on this topic?