RAGen v1.2.2 - MUST READ for all RAGen Users

Community contributed apps
Post Reply
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

RAGen v1.2.2 - MUST READ for all RAGen Users

Post by binder »

This post has been a little overdue. The latest RAGen was silently released last week. I have not had a chance to post the update as I have been working on it. There have been a LOT of new changes made. Since RAGen has transformed so much since it's inception, this post will contain a lot of good information. Also note, there are more changes being added to RAGen and continued improvements will be made.

Here are some of the major highlights for this release:
  • Generate button moved from Main Relay (or PDE/INO) tab to the Controller tab.
  • Added Custom Menu tab
  • Moved Expansion relay quantity from the Controller tab to the Features tab under the expansion relay feature.
  • Internal Memory window is simpler. It mimics the Android Status memory page.
  • Memory values / ranges are altered appropriately in the app based on F or C selection.
  • Added Info tab to give a little synopsis about the different tabs.
Now, on to the program...
When RAGen starts up, you will be presented with this screen:
Info Tab
Info Tab
Info.png (23.36 KiB) Viewed 8669 times
If you have never used RAGen before, make sure you READ the screen.

If you are initially setting up your controller, your next step will be to goto the Internal Memory window.
Note:If you are going to use Celsius temperatures, goto the Controller tab first and change the temperature to C before opening up the Internal Memory window.
Goto the Controller menu and select Internal Memory. You will be presented with this window:
Internal Memory Window
Internal Memory Window
InternalMemory.png (13.54 KiB) Viewed 8669 times
Make sure you read the note at the top of the window. Once this window is open, you should go through and review the memory settings. The default values are preloaded. Select the memory location from the drop down list and look at the value it has stored. If you do not like a value or want to change it, either type in the new value or use the up/down buttons to change it. Once the value is changed, it is saved. After you have looked through all the memory locations, you will want to press the Generate button to generate the Internal Memory file to be loaded on your controller. After you generate the file, you can launch Arduino to upload your memory file to the controller.

If you launched arduino, it will open with the memory file. You can upload it to your controller now. When completed, your controller will say "Internal Memory Set, Now load your RA code file". Now back to RAGen.

Once your memory values are set AND you have generated the memory file, you can close the Internal Memory window.

The next tab is the Controller tab. On this screen, there are only a few options / choices.
Controller Tab
Controller Tab
Controller.png (19.72 KiB) Viewed 8669 times
You can:
  • Set the controller temperature to F or C (F is default)
  • Enable WIFI module (enabled is default). You can also enable the WIFI module on the Features tab
  • Add PWMSlope function to code (No default). Enabling this will add the pwm slope to your code for the Actinic and Daylight channels only (pwm channels on the controller). The PWM Slope function uses the Standard Lights ON/OFF schedule and the start and end percentages and duration from internal memory. PWM Slope will not be discussed here, there is a separate thread on it (http://forum.reefangel.com/viewtopic.ph ... lope#p5679).
    The locations in the Internal Memory page are:
    • PWM Slope Daylight Start %
    • PWM Slope Daylight End %
    • PWM Slope Daylight Duration
    • PWM Slope Actinic Start %
    • PWM Slope Actinic End %
    • PWM Slope Actinic Duration
  • Send controller data to Web Portal (No default). This will send your controller data to the portal for viewing on the portal. If you click the Configure button, you will get the Portal window where you can add your username (login username for the forum) and an optional security key. The security key entered is the same one you set on the Portal.
    Portal Window
    Portal Window
    Portal.png (12.68 KiB) Viewed 8669 times
  • Last, the Generate and Launch (only after Generate) buttons are here. Generate saves all the features and creates the features file and then generates the controller code.
That's all there is on the Controller tab.

The Features tab is next.
Features Tab
Features Tab
Features.png (24.11 KiB) Viewed 8669 times
This screen lets you set all the features on the controller. If you click on the feature, you will get a description on the right side of the window. To enable a feature, you must click the check box next to the feature. There is a SAVE button at the bottom of the screen. This button generates the Features file right away. This is ONLY needed if you need to update your features file without generating new code. Otherwise, ignore this button because the Generate button on the Controller tab will automatically generate the features file for you.

The Main Relay tab is next. This tab was initially called PDE. Then it was renamed to PDE / INO.
Main Relay Tab
Main Relay Tab
MainRelay.png (26.41 KiB) Viewed 8669 times
You have a list of the Ports / Relays on the left. Select the Port you wish to modify and then select the device you would like to assign it on the right. You can only use the devices in the right column 1 time each. If they are not available, they are greyed out. You are only able to use a Wavemaker or a Dosing Pump. You are not able to use them both at the same time. You can, however, use a Wavemaker 1 and a Dosing Pump 2. You just cannot use both Wavemaker 1 and Dosing Pump 1 at the same time. This may change in the future but currently that's all RAGen allows.
At the bottom of the screen, you can select what ports are toggled in the corresponding modes. If you want a port turned OFF/ON when entering/leaving a mode, place a Check in the appropriate box.

The last tab is the brand new one that is welcomed. This tab is the Custom Menu tab.
Custom Menu Tab
Custom Menu Tab
CustomMenu.png (20.89 KiB) Viewed 8669 times
This tab allows you to enable the custom menu (also in the Features tab). This handles most of the difficult stuff. There is some explanation for the screen.
  • Menu Entries - This is where you set how many entries your menu has. As you change this value, the list box that says "Menu Entry 1" will change based on the entries selected.
  • Reset Menu - This will reset the menu to the default / generic menu. This will erase ALL OF YOUR CHANGES. Use this with caution. There is also a warning that pops up if you press this button.
  • Load Simple Menu - This does exactly what it says. It will erase everything in your menu and load the simple menu. There is a prompt before it proceeds as well. You can load the simple menu, then change / update it if you like.
  • Menu Entry List - Use this drop down list to change / select the menu Entry to update. As you change the selection, the labels and menu code will change.
  • Menu Label - Enter the label you would like to use for the menu entry. This is the label you see on the controller screen to select.
  • Menu Code Box - This text box is the "guts" of the menu function. Place your code you would like executed when the menu is chosen.
  • Predefined Functions button - This button displays a list of common functions that can be used. It does not contain all of the functions, just the majority of them that will be used. Some functions require additional changes to work properly, which should be obvious as to what needs changed. If not, simply ask for help on the forum.
  • Clear Function button - This button clears the code for the current function. This cannot be undone, so use with caution.
Your menu is saved as you are working on it. You do not have to do anything to save it. Once you have finished editing your menu, you can click the Generate button on the Controller tab to have the entire controller code generated (menu and all).

Once you have gone through all the tabs and made all of your changes, click the Generate button on the Controller tab to generate your code. This button will create the Features file and the controller code file. The controller code file is saved in your Documents/Arduino folder under RA_MMDDYY_HHMM folder. The interpretation is this:
  • MM - 2 digits for the current month
  • DD - 2 digits for the current day
  • YY - 2 digits for the current year
  • HH - 2 digits for the current hour (in 24 hour format)
  • MM - 2 digits for the current minute
The Internal Memory files use the same naming convention except they start with Memory_ instead of RA_.

If you run in to any problems or would like to suggest features, please do so on the forum.

Enjoy! :ugeek:
danielsn
Posts: 26
Joined: Tue Apr 03, 2012 11:49 am

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by danielsn »

Hi, I need some advice here...

I´m a new user, the controller was received yesterday and conected to two termocouples just to have some readings. i downloaded the recent files from the portal, including this version of RAGen. and also the libraries.
The controller ys working and is comunicated with the USB-TTL vía COM5.

When I try to upload this throgh arduino it says:

Binary sketch size: 32392 bytes (of a 32256 byte maximum)
processing.app.debug.RunnerException: Sketch too big; see http://xxx.arduino.xx/en/Guide/Troubleshooting#size for tips on reducing it.
at processing.app.Sketch.size(Sketch.java:1651)
at processing.app.Sketch.build(Sketch.java:1570)
at processing.app.Sketch.exportApplet(Sketch.java:1610)
at processing.app.Sketch.exportApplet(Sketch.java:1578)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2314)
at java.lang.Thread.run(Thread.java:619)

Any help will be apreciated.

Thanks!
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by rimai »

What features do you have checked?
Roberto.
danielsn
Posts: 26
Joined: Tue Apr 03, 2012 11:49 am

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by danielsn »

Hi Roberto,

I stayed with the ones that were already selected by default (wifi, date, simple menu, display images, version menu, display LED PWM)

Thanks!
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by rimai »

Uncheck date/time. That was not supposed to be default.
Roberto.
danielsn
Posts: 26
Joined: Tue Apr 03, 2012 11:49 am

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by danielsn »

It worked, thanks!!

What should I do next? (I want to install the wifi adapter and teh Client 2.2)

thanks again
danielsn
Posts: 26
Joined: Tue Apr 03, 2012 11:49 am

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by danielsn »

Going there..

Thanks!!
dmolton
Posts: 182
Joined: Tue Mar 22, 2011 11:08 am

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by dmolton »

Nice job on the new RAGen and write up. Your explanations were very thorough.

I have to say though, I'm not a fan of the new Internal Memory form at all. The old way in my opinion had it right. Now it seems very cumbersome to modify the memory values, especially if you're changing more than 1. A lot of searching/scrolling to find the location you want. This will be especially painful for a new user setting up a new controller. You will have to go individually one by one through each item in the dropdown and set a value. There's no more visual feedback as to how their controller is going to function in the big picture. All you see now is how one individual part of the controller will function. i.e. what minute the MH Lights are going to turn off. I really liked the 10,000' birds eye overview from the old form showing you everything.

Once a user does go through and set every value individually there's no way to verify, double check, or be sure that everything is set the way you want before you save. You'll probably end up going through one-by-one again to make sure and probably write down the values in notepad or a piece of paper to simulate that 10,000' overview. Exactly what the old form did just by its very nature :!: .

Once I upload my sketch and decide I need to change something in internal memory and I open RAGen again, did my Internal Memory settings get auto-loaded for me? I assume it did and I assume the values are correct but how will I know for sure? Do I have to go through each and every memory location in the combobox again to make sure? Only after verifying one by one, then can I make the change I want. If I forget what time I set my STD Lights to come on and off - The old way I just open RAGen and with 1 click on the "Internal Memory" button I can see exactly when they come on and off. Plus when the MH come on and off, plus when the heater comes on and off.. All for free.. The new way it takes like 6 or 7 clicks total to see when those STD lights come on and off. Plus some more to change them. Changing pH or PWM % values the old way took 0 additional clicks, and that goes for every memory location value available.

In my opinion, this is one case where the similarities between the Android app and RAGen should be miles apart. With Android, you don't have many options when you want to present a large list of items that can be modified. With a WinForm, however you have many options and in both cases, Android and WinForm, you want to provide users with the easiest most intuitive way possible to interact with your application for that platform.

The old way was: well thought out, organized, structured and intuitive. It gave me instant feedback about how my controller was going to function on a day to day basis:

Image


The new way feels: painful, klunky and cumbersome. Like it's sucking the soul out of me and terrorizing my children - and I don't even have kids! :o But that's the way it makes me feel!!

Image

I cry a little inside when I see what has happened to my poor internal memory form. :cry: I think you had nailed it the first time around. I vote to resurrect our dearly beloved from the ashes!!
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by rimai »

I liked the old format too, but the problem was that there is an increasing number of memory locations and it would become too big for one window.
Maybe a tab system just like the RAGen tabs? One for standard settings like lights, heater and ato and then one for the additional settings, and then one for each expansion module?
Just a thought.
Roberto.
dmolton
Posts: 182
Joined: Tue Mar 22, 2011 11:08 am

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by dmolton »

rimai wrote:I liked the old format too, but the problem was that there is an increasing number of memory locations and it would become too big for one window.
Maybe a tab system just like the RAGen tabs? One for standard settings like lights, heater and ato and then one for the additional settings, and then one for each expansion module?
Just a thought.
Yes, definitely. I noticed quite a few extra memory locations I didn't recognize initially on the drop down. I didn't mean to be overly critical or too harsh in anyway. Having 1 form with 100 options scattered all over the place is also not a very good solution. I think either a tabbed control or maybe an accordion style control similar to what you have on the portal dashboard would be a good way to show/hide what a user cares about at any given time. I'm still glad that RAGen is actively being worked on and evolving because I think it's the best application available for the RA bar none.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by binder »

Yeah Dave & I have had a lengthy discussion about the Internal Memory page. I do have some more ideas about improving it.

The comments were not too harsh, but they were rather hysterical. ;) The nice thing was that constructive criticism was given and suggestions for improvements. Commenting truthfully on things can be a bit touchy at times but it's definitely needed and appreciated.

One thing that I thought of as well, is to put a "Preview" button on the form. This would generate a "document" (just a bunch of text inside another window) that displays all of the memory settings. This way you could "preview" it before you generate the memory file. It would be a general overview that you could glance at all the settings and figure out what needs to be changed (if anything). This could be a temporary "fix" until I can devote time to improving it. Any thoughts on this??
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by rossbryant1956 »

how do I get the new app? Is it on the download site? TIA
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by rossbryant1956 »

should I uninstall the earlier version or just install over? Thx

Okay, so I looked..there is nothing to uninstall...there is also no setup.exe.

Do I just copy these files into the right directories?
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
Sebyte

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by Sebyte »

It is always best practice to remove previous versions of any application before you install new. Most applications will leave behind files which hold user set up references, and they will then apply them to the new version. I believe that RAgen will do this too.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by binder »

rossbryant1956 wrote:should I uninstall the earlier version or just install over? Thx

Okay, so I looked..there is nothing to uninstall...there is also no setup.exe.

Do I just copy these files into the right directories?
You just need to download the RAGen-v122-static.zip file (http://curtbinder.info/apps/RAGen-v122-static.zip). Unzip the file and you will have RAGen.exe. Overwrite the RAGen.exe file that is located in the c:\Program Files\Reef Angel Controller (or Program Files (x86)).
Just copy / paste to overwrite. Make sure that you have RAGen closed when you copy & paste, otherwise it will give you an error. :)

That's all that it takes to update it.
abhi_123
Posts: 217
Joined: Tue Mar 20, 2012 8:34 am

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by abhi_123 »

Hi Curt.

suppose if i want to use pwm parabola function instead of slope than also we have to enter the values in internal memory.
Image
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by binder »

abhi_123 wrote:Hi Curt.

suppose if i want to use pwm parabola function instead of slope than also we have to enter the values in internal memory.
The pwm slope and parabola both use the same internal memory locations. So you would need to have the internal memory locations set if you wanted to use the short forms of them. You can always use the long forms and manually add in your values, but doing this will not allow you to update them without reloading your code.
abhi_123
Posts: 217
Joined: Tue Mar 20, 2012 8:34 am

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by abhi_123 »

This is my test internal memory code which i have generated.
// Autogenerated file by RAGen (v1.2.2.171), (04/29/2012 19:59)
// Memory_042912_1959.ino
//
// This file sets the default values to the Internal Memory
//


#include <ReefAngel_Features.h>
#include <Globals.h>
#include <Time.h>
#include <OneWire.h>
#include <RA_NokiaLCD.h>
#include <avr/pgmspace.h>
#include <InternalEEPROM.h>
#include <Wire.h>
#include <Memory.h>


RA_NokiaLCD e;

void setup()
{
    e.Init();
    e.Clear(COLOR_WHITE,0,0,132,132);
    e.BacklightOn();

    InternalMemory.MHOnHour_write(8);
    InternalMemory.MHOnMinute_write(0);
    InternalMemory.MHOffHour_write(16);
    InternalMemory.MHOffMinute_write(16);
    InternalMemory.StdLightsOnHour_write(8);
    InternalMemory.StdLightsOnMinute_write(0);
    InternalMemory.StdLightsOffHour_write(16);
    InternalMemory.StdLightsOffMinute_write(15);
    InternalMemory.WM1Timer_write(90);
    InternalMemory.WM2Timer_write(200);
    InternalMemory.DP1Timer_write(10);
    InternalMemory.DP2Timer_write(10);
    InternalMemory.FeedingTimer_write(900);
    InternalMemory.LCDTimer_write(600);
    InternalMemory.OverheatTemp_write(1500);
    InternalMemory.LEDPWMDaylight_write(70);
    InternalMemory.LEDPWMActinic_write(75);
    InternalMemory.HeaterTempOn_write(780);
    InternalMemory.HeaterTempOff_write(791);
    InternalMemory.ChillerTempOn_write(810);
    InternalMemory.ChillerTempOff_write(785);
    InternalMemory.ATOTimeout_write(75);
    InternalMemory.PHMax_write(840);
    InternalMemory.PHMin_write(550);
    InternalMemory.MHDelay_write(5);
    InternalMemory.DP1OnHour_write(20);
    InternalMemory.DP1OnMinute_write(0);
    InternalMemory.DP2OnHour_write(22);
    InternalMemory.DP2OnMinute_write(30);
    InternalMemory.ATOHourInterval_write(0);
    InternalMemory.ATOHighHourInterval_write(0);
    InternalMemory.ATOHighTimeout_write(60);
    InternalMemory.DP1RepeatInterval_write(0);
    InternalMemory.DP2RepeatInterval_write(0);
    InternalMemory.SalMax_write(2550);
    InternalMemory.PWMSlopeStartD_write(10);
    InternalMemory.PWMSlopeEndD_write(95);
    InternalMemory.PWMSlopeDurationD_write(60);
    InternalMemory.PWMSlopeStartA_write(20);
    InternalMemory.PWMSlopeEndA_write(100);
    InternalMemory.PWMSlopeDurationA_write(60);
    InternalMemory.RFMode_write(0);
    InternalMemory.RFSpeed_write(100);
    InternalMemory.RFDuration_write(10);
    InternalMemory.PWMSlopeStart0_write(15);
    InternalMemory.PWMSlopeEnd0_write(100);
    InternalMemory.PWMSlopeDuration0_write(60);
    InternalMemory.PWMSlopeStart1_write(15);
    InternalMemory.PWMSlopeEnd1_write(100);
    InternalMemory.PWMSlopeDuration1_write(60);
    InternalMemory.PWMSlopeStart2_write(15);
    InternalMemory.PWMSlopeEnd2_write(100);
    InternalMemory.PWMSlopeDuration2_write(60);
    InternalMemory.PWMSlopeStart3_write(15);
    InternalMemory.PWMSlopeEnd3_write(100);
    InternalMemory.PWMSlopeDuration3_write(60);
    InternalMemory.PWMSlopeStart4_write(15);
    InternalMemory.PWMSlopeEnd4_write(100);
    InternalMemory.PWMSlopeDuration4_write(60);
    InternalMemory.PWMSlopeStart5_write(15);
    InternalMemory.PWMSlopeEnd5_write(100);
    InternalMemory.PWMSlopeDuration5_write(60);
    InternalMemory.IMCheck_write(0x5241494D);
}

void loop()
{
    // display success screen
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*2, "Internal Memory Set");
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*4, "Now load your");
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*5, " RA code file");
    delay(5000);
}
and this is my first code
// Autogenerated file by RAGen (v1.2.2.171), (04/29/2012 20:02)
// RA_042912_2002.ino
//
// This version designed for v0.9.0 or later

/* The following features are enabled for this File: 
#define DisplayLEDPWM
#define wifi
#define SIMPLE_MENU
#define PWMEXPANSION
#define CUSTOM_MAIN
#define ENABLE_ATO_LOGGING
#define SALINITYEXPANSION
#define ORPEXPANSION
#define FONT_8x8
*/


#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <Salinity.h>
#include <ORP.h>
#include <ReefAngel.h>

////// Place global variable code below here


////// Place global variable code above here

void DrawCustomMain()
{
    // the graph is drawn/updated when we exit the main menu &
    // when the parameters are saved
    ReefAngel.LCD.DrawDate(6, 112);
    pingSerial();
#if defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor(15, 60, ReefAngel.Params,
    ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue());
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor(15, 60, ReefAngel.Params);
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
    pingSerial();
    byte TempRelay = ReefAngel.Relay.RelayData;
    TempRelay &= ReefAngel.Relay.RelayMaskOff;
    TempRelay |= ReefAngel.Relay.RelayMaskOn;
    ReefAngel.LCD.DrawOutletBox(12, 93, TempRelay);
}

void DrawCustomGraph()
{
    ReefAngel.LCD.DrawGraph(5, 5);
}


void setup()
{
    // This must be the first line
    ReefAngel.Init(); //Initialize controller

    // Ports that are always on
    ReefAngel.Relay.On(Port3);
    ReefAngel.Relay.On(Port7);
    ReefAngel.Relay.On(Port8);
    ////// Place additional initialization code below here
    

    ////// Place additional initialization code above here
}

void loop()
{
    // Specific functions that use Internal Memory values
    ReefAngel.StandardATO(Port1);
    ReefAngel.StandardLights(Port2);
    ReefAngel.StandardFan(Port4);
    ReefAngel.Wavemaker1(Port5);
    ReefAngel.Wavemaker2(Port6);

    // PWMSlope based on Internal Memory values for Standard Lights
    ReefAngel.PWM.ActinicPWMSlope();
    ReefAngel.PWM.DaylightPWMSlope();
    ////// Place your custom code below here
    

    ////// Place your custom code above here
    // This sends all the data to the portal
    // Do not add any custom code that changes any relay status after this line
    // The only code after this line should be the ShowInterface function
    ReefAngel.Portal("abhi_123");

    // This should always be the last line
    ReefAngel.ShowInterface();
}

here in my code there is no value assigned for pwm slope. should i manually enter the value or it will work default on values entered in internal memory?
Image
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by binder »

The 2 slope functions that are added (ActinicPWMSlope and DaylightPWMSlope) use these memory values:

Code: Select all

    InternalMemory.PWMSlopeStartD_write(10);
    InternalMemory.PWMSlopeEndD_write(95);
    InternalMemory.PWMSlopeDurationD_write(60);
    InternalMemory.PWMSlopeStartA_write(20);
    InternalMemory.PWMSlopeEndA_write(100);
    InternalMemory.PWMSlopeDurationA_write(60);
and they also use the same light schedule (on & off times) as the StandardLights schedule.

So no changes are necessary to the functions.
abhi_123
Posts: 217
Joined: Tue Mar 20, 2012 8:34 am

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by abhi_123 »

Thanks Curt. Btw if i plan to use parabola what changes if i have to make in my current code?
Image
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by binder »

abhi_123 wrote:Thanks Curt. Btw if i plan to use parabola what changes if i have to make in my current code?
The changes are simple. You would change this:

Code: Select all

ReefAngel.PWM.ActinicPWMSlope();
ReefAngel.PWM.DaylightPWMSlope();
to this:

Code: Select all

ReefAngel.PWM.ActinicPWMParabola();
ReefAngel.PWM.DaylightPWMParabola();
Then reload your code on your controller. That's all that would be needed.
abhi_123
Posts: 217
Joined: Tue Mar 20, 2012 8:34 am

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by abhi_123 »

cool. Thats very simple. :D

one more thing(sorry for troubling you with my newbie question) i will be using pwm fans to control the temp of my heatsink & tank i want to put a conditional code like if the temp of t1 increased the desired value start the fan which is installed on channel 4 in pwm expansion module & gradually decrease its speed depending upon the temp.
Image
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by binder »

http://forum.reefangel.com/viewtopic.ph ... 170&p=8969

Roberto will have to comment on how he does the gradual increasing.
TanksNStuff
Posts: 188
Joined: Fri Dec 30, 2011 6:57 am

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by TanksNStuff »

binder wrote:
abhi_123 wrote:Thanks Curt. Btw if i plan to use parabola what changes if i have to make in my current code?
The changes are simple. You would change this:

Code: Select all

ReefAngel.PWM.ActinicPWMSlope();
ReefAngel.PWM.DaylightPWMSlope();
to this:

Code: Select all

ReefAngel.PWM.ActinicPWMParabola();
ReefAngel.PWM.DaylightPWMParabola();
Then reload your code on your controller. That's all that would be needed.
Sorry to bring up old topics, but I had a question about the code above and the 1.2.2 libraries.

How would I do this for the PWM Expansion Module channels?

My currently working code (using slope) is as follows:

Code: Select all

ReefAngel.PWM.Channel0PWMSlope(InternalMemory.ActinicOffset_read());
ReefAngel.PWM.Channel1PWMSlope(InternalMemory.ActinicOffset_read());
ReefAngel.PWM.Channel2PWMSlope();
ReefAngel.PWM.Channel3PWMSlope();
I'd like to change it from Slope to Parabola. What's the proper syntax please?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by rimai »

Code: Select all

  ReefAngel.PWM.Channel0PWMParabola(InternalMemory.ActinicOffset_read());
  ReefAngel.PWM.Channel1PWMParabola(InternalMemory.ActinicOffset_read());
  ReefAngel.PWM.Channel2PWMParabola();
  ReefAngel.PWM.Channel3PWMParabola();
Roberto.
TanksNStuff
Posts: 188
Joined: Fri Dec 30, 2011 6:57 am

Re: RAGen v1.2.2 - MUST READ for all RAGen Users

Post by TanksNStuff »

Thanks Roberto. That's what I thought it was, but just wanted to be sure.
Post Reply