Modbus over RS232 questions

Started by lrice648, November 03, 2014, 10:28:20 PM

Previous topic - Next topic

lrice648

I'm sure that this has been answered somewhere but I've been searching for a good bit and haven't found answers to a couple things.

1. Is the classic a DCE or DTE device? IE, do I need a null-modem cable or can I wire my serial cable straight through. I could always try both, but due to the dangers of accidentally writing to the wrong register, I'm hesitant to wing it.

I saw discussions http://midniteforum.com/index.php?topic=1431.msg11763#msg11763 that described success using the slave/out jack, but conceptually it makes more sense to use the master (since I don't intend on connecting a modbus slave device). Am I correct in expecting to be using the master port?

Besides that, I gather from looking on the forums that the default modbus address for the midnite is 10, and that the serial port defaults are 19200 baud and N81.

I feel like that info should be really easy to find (ie, not having to search the forum), is it in any manual(s) anywhere that I haven't found? If I can get it working I will probably do a writeup for myself that I'll try to share (if its worth doing).

Thanks in advance. I just got my classic 150 and I'm stoked about having a new toy, I'm so far really impressed by its functionality. As I learn more about the classic and interfacing with it I'll try to contribute back to the community if I can!

zoneblue

Very few attempt to connect via rs232. Its non documented functionality. Midnite has provided and document both ethernet and usb for public use.

Youve found basically all the right stuff, so go ahead and tell us what you learn. I for one will be interested.

I briefly document the other monitoring options here http://code.google.com/p/theblackboxproject/wiki/ClassicComPorts
6x300W CSUN, ground mount, CL150Lite, 2V/400AhToyo AGM,  Outback VFX3024E, Steca Solarix PL1100
http://www.zoneblue.org/cms/page.php?view=off-grid-solar

atop8918

Actually, RS232 is pretty well documented in both the Classic manual and Networking Manuals.

The cable is neither null-modem nor straight-through, but a custom dohicky to make Classic-to-Classic wiring easier. The wiring diagrams are in both manuals mentioned above.

I'll wait for boB to chime in but I _think_ that we are doing Master In and Slave out so you will want to plug your Master device into the Master port and any downstream devices into the Slave port.

Serial settings are 19200-8-n-1 and we use the MODBUS RTU packet format.

Classic Manual:
http://www.midnitesolar.com/pdfs/classicManual.pdf

Register Map:
http://www.midnitesolar.com/pdfs/classic_register_map_Rev-B3-May-28-2013.pdf



lrice648

Thank you for the input guys, I think blackbox will definitely be helpful, I'll do some more reading there.

@atop8918, can you point to anywhere specifically in the classic manual or networking manual that might be useful? I did notice the last page (of both) that has the pinout for the rj11 side of the serialport, but besides that I really didn't see much. Its probably safe to assume that the other end (that I'll be soldering to a female db9) will be standard tx->tx rx->rx.

I hadn't thought about the follow-me issue that blackbox mentioned, I don't forsee ever having two classics wired up, if I expand my system beyond ~1.3kw I'll probably just switch to a larger 24 volt battery bank/inverter.

Thanks again

atop8918

Sorry, I should have said RS-232 MODBUS is documented.
It depends on what kind of info you need?
If your cable matches the pinouts in the manual then all you need to do is run the cable from an RS-232 MODBUS master and query the registers as listed in the register manual (admittedly this manual is out of date, but most of the registers should be the same -- I think an update is in the works).
We don't have any documentation on MODBUS or RS-232 though as those are standards that are documented elsewhere.
If you have some specific questions I can try to answer them for you here, though and either add them to the manual for other folks or call them out better in the manual if they are already in there.

atop8918

I humbly apologize: I just went through the manuals again, and you are all right, for some reason we are missing the section on RS232 MODBUS.

Lowdown:
19200-8-n-1
MODBUS RTU (!not! ASCII mode)
Default address for a Classic is 10 but this is changeable via the MNGP. You can also use address 255 to address a unit to which you are directly attached.
Take a look at the Follow-Me guide for instructions on how to wire multiple Classics together. You can wire a MODBUS Master to either the Master In jack or the MNGP/Remote jack.

I'll see if I can dig up the original serial-connected MODBUS spec and have it added to the manual. Again, sorry for jumping the gun.

vtmaps

Quote from: lrice648 on November 04, 2014, 09:13:28 PMI don't forsee ever having two classics wired up, if I expand my system beyond ~1.3kw I'll probably just switch to a larger 24 volt battery bank/inverter.

Welcome to the forum,

You have an extremely smart attitude toward system expansion.   For many folks, telling them that they need a new inverter is like telling them they have cancer.... usually their first (and often last) reaction is denial. 

--vtMaps

zoneblue

Vt, thats because choosing and paying for a decent inverter is such a painful process, that once you have one that works, you are usually loathe to mess with it. ;)
6x300W CSUN, ground mount, CL150Lite, 2V/400AhToyo AGM,  Outback VFX3024E, Steca Solarix PL1100
http://www.zoneblue.org/cms/page.php?view=off-grid-solar

vtmaps

Quote from: zoneblue on November 05, 2014, 04:22:07 PM
thats because choosing and paying for a decent inverter is such a painful process

I don't find choosing an inverter to be very painful   ;)   --vtMaps

Westbranch

ordering is pain free too,  :)

BUT, if you chose a good one... the pain hits upon paying the bill... :'(

just think of it in binary, it's all 1's and zeros... ::)
KID FW1811 560W >C&D 24V 900Ah AGM
CL150 29032 FW V.2126-NW2097-GP2133 175A E-Panel WBjr, 3Px4s 140W > 24V 900Ah AGM,
2 Cisco WRT54GL i/c DD-WRT Rtr, NetGr DS104Hub
Cotek ST1500 Inv  want a 24V  ROSIE Inverter
OmniCharge3024  Eu1/2/3000iGens
West Chilcotin 1680+W to come

boB

Quote from: Westbranch on November 05, 2014, 07:58:11 PM

just think of it in binary, it's all 1's and zeros... ::)

More zeros SHOULD mean the price is closer to $0.0, right ?  But it doesn't

But binary is correct.  You either have the money...  Or you don't.

boB
K7IQ 🌛  He/She/Me

lrice648

No problem atop, it wouldn't be the first time I skipped right over relevant data and asked a dumb question, but at least I'm doing it less and less these days ;) Thanks for looking for some info, I think I have a pretty good idea now with the help from you and others on the forum, but the more data the better. My plan is to take it slow, simulate the classic with a modbus rtu simulator, make sure I have the general process down and then try it on the real thing.

@vtmaps, thanks! I'm lucky enough that I don't actually have a super-expensive inverter right now, but the one I have is functional enough to cover our current needs but I can see that being the next main area of improvement (we're using a cobra 2575, which in terms of wattage is really too big so more than likely we would step down in wattage but up in quality).

Thanks for the help guys.