pylon:
I hope that should read DI and not RO.
pylon:
No, you need one for the RO pin. This is to avoid a floating pin during transfers.
From what you say i might've screwed up the cabling, just swapped them.
pylon:
Yes. The bus must be terminated at both ends to mostly eliminate reflections and the biasing resistors are needed to have a defined state on the bus if no driver is active. Depending on the RS-485 module you're using (I miss the link to it!) this is already the case. The module on the pictures seem to have them on-board.
From some searching i couldn't find a datasheet for the module (i did for the IC though) but on this site and in another one aswell i found the schematic of the converter (attached below). It appears that it already has the 10k resistors on it, from the RE, RO, DI, and DE outputs, a 120 ohm termination resistor on the RS485 side of things aswell as 20kohm polarization resistors. So i suppose i don't have to add anything or should i add atleast the 10kohm from RO to Vcc anyways?
pylon:
I'd suggest to buy a board with a separate hardware serial. A Mega2560 has 4 of them but a Leonardo would fit too as it doesn't use the hardware serial interface for the USB communication.
Already did, it should arrive either tomorrow or the day after. Once it does i'll try to work with the ModbusMaster library and the SimpleModbus aswell, see how i fare . Meanwhile i'll keep trying with the UNO because how could the guy in the videos stablish connection if it was a nano?
pylon:
May I ask for an explanation why you set the register address to 0x03 if you try to access register 0x3100?
The 0x3100 i mentioned (sorry, i didn't explain myself enough) was the addres used by the guy in the video and in the library's example aswell. That's where i'm getting stumped: The PAC's manual doesn't say anything about 0x3100 so that can't be my adress to call, i must be needing something else. I first though that it was where i should put the function to call...
pylon:
The function is chosen by the method name (readInputRegisters is function 4).
... And you tell me the fuction i actually need is 4 (0x04 from what i can see in the PM's Manual [pag. 129]) So i suppose i should put that 0x04 in that part? Or should i add something else to that funtion call?
Data = PAC1.readInputRegisters(0x04,2);//Like this? Reading as well the first two registers so i can get the Va-n data in low and high word.
.
One last thing (it involves my main problem). Upon some research of the Siemens forums i found a couple of small threads where the adress to be called is 40001, could it be the one i need? I'll try with it and keep searching in those forums while the MEGA arrives.
485.pdf (84 KB)
MAX1487-MAX491.pdf (1.3 MB)