I am sitting with a brick on my desk. An Arduino Pro Portenta Machine Control (H7 M7 Core) device, I cannot use with modbus on HMI. There exists no clear concise examples out there of how to Start the Machine control as Modbus RTU/TCP Slave or Master. Nothing exists in the form of examples on registers and frames, reading/writing single or multiple coils, nor anything usable for the average developer to use. The standard Arduino libraries does nothing, and the built in examples of the device itself, as stated, is useless.
I don't know If I am looking in the wrong places, asking the wrong questions, asking the wrong forum, or what ever my problem is, but I need assistance. I have spent considerable amount of my personal money to obtain and research this device, but it is useless If I cannot get the device working with HMI or other modbus devices for the end user.
I am also learning about this board myself so I cannot offer you detailed assistance.
However, have you installed the Arduino_MachineControl library?
It can be installed with the library manager in the IDE.
I had an easy time getting the Digital_Output example from the Arduino_MachineControl library working, so I would suggest starting there.
Looking at the examples in this library and the keywords document will also help you understand how to reference pins with the Machine Control, which is a bit different from other boards (I think).
Hope this helps you
/ Einar
EDIT:
The Arduino_MachineControl library also comes with Modbus RTU half duplex (RS485) and full duplex (RS422) examples, which may be useful to you.
Thank You Sir for your response. It is much appreciated. Indeed I have installed the library as well as any other I might have been able to use, yet I have no luck.
I can utilize mostly all functionality of the PMC, and I am aware of the RS485 capabilities that are documented and explained with examples in the libraries provided, but that is where it ends.
I am new to RS485 and Modbus but, by now I have enough experience and understand how the Modbus registers work and reading/writing to single and multiple coils, input & holding registers work, etc.
Unfortunately the info available on how to do exactly that, is not available anywhere I look. I need to do the following:
Set the PMC as Modbus Slave with address (usually 1, where 0 is reserved for master)
Determine parameters like Baud rate, Parity, Stop Bits, data length, com port
Create registers arrays of 16 bit Unsigned decimals (Word) and populate these with info like thermocouple temp reading, analog input reading, digital input state, etc..
Have an HMI read these registers and provide a visualization of the info in the registers for users and return input values to the PMC.
Thanks once again. I appreciate any help I can get!
Here a client/master is started, baudrate (defined higher up) is selected, and data length, parity, and stop bits is selected.
SERIAL_8N1:
Size - 8 bits
Parity - None
Stop bits - 1.
Looking at this sketch and the ArduinoModbus documentation and comparing could be useful...
I have not successfully run any Modbus sketch yet with the Machine Control yet as I am a bit confused about the physical connections (this is not very clear from the pinout and schematics in my opinion), so I cannot confirm that this sketch works
However I assume it does because of the source.
If you do get the Machine Control to act as a slave a nice tool to read the registers from a pc is ModbusTool (http://modbusmaster.com/). Of course you need to connect pc to Machine Control with RS485 first.
This is the most useful information I have been able to locate thus far for the PMC. I am using a WECON HMI, and have managed to interface it with Modbus to a CONTROLINO MAXI with no problems. If I manage to get this working with your help on the PMC, I will gladly share what I have.
I been trying to get the Portenta machine control to talk to a Wecon HMI, first I used the IDE PLC, bust as you say very little or no information, and I cannot get to work. can you share more info on how you succeeded.