Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : RS232 Problem
Author | Message | ||||
Martrogers Newbie Joined: 03/07/2016 Location: AustraliaPosts: 4 |
Hello All I would like to interrogate my house Orion solar inverter in order to log the output of my solar cells on an hourly basis. This will help me make a decision on whether to purchase additional solar cells and also to determine at what cost a battery would be economic.The inverter has a RS232 interface and the protocol is published on the web. I have the Micromite set up as per the manual with 10k resistor and diode (although I have tried slightly different resistors and diodes to no effect). When the program is run the inverter responds to the Query Network command albeit after 2 attempts and the MM displays the hex reply. The inverter responds twice but the MM only picks up the second reply. The problem is that the MM will not display any further replies from the inverter. When I connect the MM Rx to my laptop RS232 probe I can see that the inverter is replying to all requests so the MM is sending the request correctly, but the MM is not picking up the response. For simplicity I have only attached this first part of the program but the same problem occurs with further requests to the inverter, the inverter replies but the MM will not display the reply. Any help would be much appreciated. Regards Martin 2017-03-12_200043_Solar_Inverter.zip |
||||
led-bloon Senior Member Joined: 21/12/2014 Location: AustraliaPosts: 203 |
<deleted> Re-read your code and you seem to handle INPUT$ correctly! Miss you George |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 5917 |
A link to the protocol would help. You are not waiting long enough for the response to arrive before re-sending the command. This will probably end up with the response being part of one reply and the start of the next reply etc. You should send the command once and then wait for all the expected data to arrive before re-sending the command. I have added two 500mS delays (way too long but I don't know how quickly the unit waits before replying with data). This is a cheap and nasty way to get the data in one bite. Jim VK7JH MMedit MMBasic Help |
||||
Martrogers Newbie Joined: 03/07/2016 Location: AustraliaPosts: 4 |
Jim Thank you so much - works perfectly now. Regards Martin |
||||
Print this page |