How to get logs from Classic over Modbus?

Started by David, July 23, 2012, 09:57:13 AM

Previous topic - Next topic

David

Is there any information on how to get the logs off of the Classic through Modbus?  The current on-line MidNite Solar MODBUS Network Spec from May 2011 states that information on how do that is "coming soon".

Thanks,
David

boB

Quote from: David on July 23, 2012, 09:57:13 AM
Is there any information on how to get the logs off of the Classic through Modbus?  The current on-line MidNite Solar MODBUS Network Spec from May 2011 states that information on how do that is "coming soon".

Thanks,
David


Yeah, we should get that in there shouldn't we ?

There are quite a few new things we should document in that file.

Will try to get that done soon.

boB
K7IQ 🌛  He/She/Me

rosebudd

Bob,

A little more info on Modbus would be helpful...and appreciated.

I am a Linux user and the App upgrades are not supported now. I have been able to get a Modbus scanner working thru Wine/TCP... Logging is the final goal, sooner or later it will happen.

I understand the economic drivers and that is reality.

thanks,
steve
MS Classic 150, ~1.6kw pv, 500 ah , OB3524, ListerSL1/3kwgenAC .....so far
"retirement projects"

Lya72

Hi all,

Always in my Classic logging quest, after using the Local App, i'm researching something that let me see the Classic's Data.

So I'm learning ModBus on the Classic.

On a local WebServer, I installed a PHP Modbus library :
http://code.google.com/p/phpmodbus/

After that, I created the following PHP Code :

Quote
<?php
     
    require_once dirname(__FILE__) . '/../Phpmodbus/ModbusMaster.php';
     
    // Create Modbus object
    $modbus = new ModbusMaster("192.168.1.52", "TCP");
     
    try {
        // 4132 (AVG_Battery_Voltage,Kw_Day, Battery_Temp)
        $recData = $modbus->readMultipleRegisters(4115, 4118, 4132);
    }
    catch (Exception $e) {
        // Print error information if any
        echo $modbus;
        echo $e;
        exit;
    }
     
    // Print status information
    echo "</br>Status:</br>" . $modbus;
     
    // Print read data
    echo "</br>Data:</br>";
    print_r($recData);
    echo "</br>";
?>

Firstly, I get an error "Unable to find the create_socket function".

That was resolved by enabling the extension=php_sockets.dll in the php.ini file.

But now, when i run the PHP page, it goes in an endless loop.


Are these parameters OK :

Protocol : TCP  ??

Port : 502  ??


What else ??

Yann
1 Classic 200, 4 SILLIA panels 240W in 2 strings of 2, ie 960Watts and 60.8 Volts, 4 MIDAC Batteries 6V 240Ah, ie 24V bank (acid batteries)

boB

#4
Quote from: Lya72 on August 04, 2012, 05:48:37 PM

On a local WebServer, I installed a PHP Modbus library :
http://code.google.com/p/phpmodbus/

Are these parameters OK :

Protocol : TCP  ??

Port : 502  ??


What else ??

Yann

Hey Yann !!   Yes, those parmaters look OK to me.

Regarding    readMultipleRegisters(4115, 4118, 4132)....

....I would have thought that this command would have a start address and a register amount to read, since read or write multiple is usually organized as having all registers in sequence, so I would question how you are calling that, but you might be just fine as is.

Or, maybe that is a problem if it is starting at register 4115 and trying to read 4000+ registers !
Does it return anything ?

Thanks for the link on the PHP modbus.   Now I will have to look into that.

There is also Python modbus, Java modbus  (jamod) and others.

I'm glad there is so much to choose from !

boB
K7IQ 🌛  He/She/Me

tallgirl

boB,

You neglected to mention yours truly's "j2mod".  Which actually has the READ FILE RECORD Modbus methods.  I'd think that for log file reading you'd use a record structured routine ...

And when are you going to open a Modbus/TCP port back up to me?  I've not poked at your gear in =months=.

Lya72


Hi TG,

I'm reading your post with Google traduction, and I think, there are hidden messages in it  :o


Are you saying that there is no Modbus/TCP port open on the Classic, and that's why my PHP page goes in an endless loop, whitout returning something ??


Yann
1 Classic 200, 4 SILLIA panels 240W in 2 strings of 2, ie 960Watts and 60.8 Volts, 4 MIDAC Batteries 6V 240Ah, ie 24V bank (acid batteries)

boB

Quote from: Lya72 on August 05, 2012, 04:29:08 PM

Hi TG,

I'm reading your post with Google traduction, and I think, there are hidden messages in it  :o


Are you saying that there is no Modbus/TCP port open on the Classic, and that's why my PHP page goes in an endless loop, whitout returning something ??

Yann


No, there is definitely modbus over TCP.   I just was not sure if the way you were using read multiple registers was being applied like I thought it was or if those numbers in the parentheses() needed to be adjusted.  It looks like the register numbers in your example is trying to read 3 or 4 different registers but what I am familiar with is that you set the first register and then read a certain numbers of registers after that rather than specifying which registers to individually access and read.

Now, your PHP modbus code certainly can read a list of registers but the name "read multiple" from what I have seen usually means to read a certain number of registers starting at one register address.  I have not had a chance to look at the PHP modbus code but I did download it.

boB

PS, Julie, Tallgirl is needing a nice warm fresh Classic to play with online.

K7IQ 🌛  He/She/Me

Halfcrazy

Quote from: tallgirl on August 05, 2012, 03:57:52 PM
boB,

You neglected to mention yours truly's "j2mod".  Which actually has the READ FILE RECORD Modbus methods.  I'd think that for log file reading you'd use a record structured routine ...

And when are you going to open a Modbus/TCP port back up to me?  I've not poked at your gear in =months=.

TallGirl
I can do a couple things. I can wire up a Classic for you to talk to or I can let you into one of my live working units. I would prefer to get one wired up and let you have at it. Give me a day and I will send you the IP and Port. Shoot me a PM or Email with your Email as I think it has changed no?

Ryan

Changing the way wind turbines operate one smoke filled box at a time

tallgirl

Ryan,

Yes, the best e-mail to reach me at is jfh AT ghgande DOT com.  I'm moving away from greenhousepc because too many people want to know what kind of PCs I sell ...

I have started a device driver for the Classic, and would love to add support.  I just can't seem to keep my hands on one, so to speak, long enough to do that ...

Lya72

Hi All,

Firstly : To connect to the Classic with a ModBus Client, the Local App must not be running !!
After stopping the Local App, the connexion was good with an Ipad Client (GSI ModBus Test Lite)
(see 1st capture below)


Secondly : Once connected to the Classic, there is no response from the server, following a read request (of one register).
(2nd capture below)

For the PHP request, the progress is the same, the endless loop was replaced by a return :

Quote
readMultipleRegisters: START
Connected
Packet: 408200000006130310161024
Send
Wait data ...
Wait data ...
Wait data ...
Wait data ...
Wait data ...
Wait data ...
Wait data ...
Wait data ...
Wait data ...
Wait data ...
Wait data ...
Wait data ...
Wait data ...
Wait data ...
Wait data ...

exception 'Exception' with message 'Watchdog time expired [ 5 sec]!!! Connection to 192.168.1.52 is not established.'


It seems to me, that I'm alone in this logs quest.


Thanks to give me no promises, but visibility.

Yann


1 Classic 200, 4 SILLIA panels 240W in 2 strings of 2, ie 960Watts and 60.8 Volts, 4 MIDAC Batteries 6V 240Ah, ie 24V bank (acid batteries)

boB


Yann, try device ID of  10  (decimal) instead of 1  and let's see if that helps.

boB
K7IQ 🌛  He/She/Me

Lya72

Hi Bob,

That's a good proposal ==> now, I have registers value   :)


That's time to read the manual to get the good registers numbers to look at.


(Please version the manuals with a release number and a release date - I was having different versions on my Ipad and on my computer)


Some values surprised me and after hours, I have the following question :


Is the latest Classic manual up to date for the ModBus registers numbers or my ModBus client isn't showing them correctly ?


In my opinion,

4114 = Average Battery Voltage (Manual says RestartTimerms  ???)
4115 = Average PV Input Voltage (Manual says Average Battery Voltage)
4116 = ?? (Manual says Average PV terminal Input)
4117 = Production of the day ? (Manual says Average Battery Current )
4118 = Instantaneous watts production (Manual says Average Energy to the Battery -This is reset once per day)

4132/4133/4134 = Temps . How do you switch them from °F to °C ??


Thansks in advance.

Yann
1 Classic 200, 4 SILLIA panels 240W in 2 strings of 2, ie 960Watts and 60.8 Volts, 4 MIDAC Batteries 6V 240Ah, ie 24V bank (acid batteries)

boB

Quote from: Lya72 on August 08, 2012, 06:36:38 AM
Hi Bob,

That's a good proposal ==> now, I have registers value   :)


That's time to read the manual to get the good registers numbers to look at.


(Please version the manuals with a release number and a release date - I was having different versions on my Ipad and on my computer)


Some values surprised me and after hours, I have the following question :


Is the latest Classic manual up to date for the ModBus registers numbers or my ModBus client isn't showing them correctly ?


In my opinion,

4114 = Average Battery Voltage (Manual says RestartTimerms  ???)
4115 = Average PV Input Voltage (Manual says Average Battery Voltage)
4116 = ?? (Manual says Average PV terminal Input)
4117 = Production of the day ? (Manual says Average Battery Current )
4118 = Instantaneous watts production (Manual says Average Energy to the Battery -This is reset once per day)

4132/4133/4134 = Temps . How do you switch them from °F to °C ??


Thansks in advance.

Yann


Yann, I'm glad the ID changed to 10 (ten) helped !

No, the manual and modbus register list is not up to date.  We are working on that.
I will try to give you information on reading logs through the 2 modbus registers
sooner than that though.

As for temperature, there is no switch as of yet for C to F conversion.  The Local App does this itself.
Temperatures are all in C right now from the Classic.

boB
K7IQ 🌛  He/She/Me

Lya72

Hi Bob,

Reference to your latest post, have you found the key of the desk where are stored the latest Classic ModBus specifications ???

My Classic is speaking to the Web but I need a dictionnary to understand him...

Also, always interested in how to read Classic logs via ModBus registers.

Thanks in advance.

Yann
1 Classic 200, 4 SILLIA panels 240W in 2 strings of 2, ie 960Watts and 60.8 Volts, 4 MIDAC Batteries 6V 240Ah, ie 24V bank (acid batteries)