Page 1 of 1
Define ports by name?
Posted: Fri Mar 20, 2015 6:14 pm
by ewaldsreef
If you define ports by name what does this do exactly?
Does it show up on the app or portal?
Can you Define all of the ports such as the temp, float switch, pwm etc?
Re: Define ports by name?
Posted: Fri Mar 20, 2015 11:00 pm
by Sacohen
Defining port names in your code like this...
Code: Select all
// Define Relay Ports by Name
#define Actinic_Lights 1
#define Day_Lights 2
#define Kalkwasser 3
#define Pumps 4
#define Unused 5
#define DeNit_Doser 6
#define DeNit_Pump 7
#define ATO_Pump 8
#define Unused Box1_Port1
#define Feeder Box1_Port2
#define Unused Box1_Port3
#define Unused Box1_Port4
#define Unused Box1_Port5
#define Unused Box1_Port6
#define Main_RODI Box1_Port7
#define Dummy Box1_Port8
makes it easier to identify which port is doing what in the code.
To have it show up in the App or the Portal it has to be done in the labels section of the Portal and then the App can pull the names from the Portal or you can set them up in the App to under the settings section.
Re: Define ports by name?
Posted: Sun Mar 22, 2015 10:11 pm
by ewaldsreef
Thank you Steve.
Can I also define temp probes by name?
Re: Define ports by name?
Posted: Mon Mar 23, 2015 4:59 am
by Sacohen
I'm not sure you can on the code.
Check lnevo's code. If it can be done I'm sire he has done it.
Re: Define ports by name?
Posted: Mon Mar 23, 2015 5:28 am
by rimai
Re: Define ports by name?
Posted: Mon Mar 23, 2015 3:37 pm
by lnevo
Wouldnt it be the other way around roberto?
Re: Define ports by name?
Posted: Mon Mar 23, 2015 4:40 pm
by Smotz
I have mine like this - does it matter?
Code: Select all
#define Heater Port1
#define Topoff Port2
#define Feeder Port3
#define Skimmer Port4
#define Return Port5
#define Wave Port6
#define UVlight Port7
#define Fugelight Port8
#define Fan Box1_Port8
#define CalcDose Box1_Port1
#define AlkDose Box1_Port2
Sacohen wrote:Defining port names in your code like this...
Code: Select all
// Define Relay Ports by Name
#define Actinic_Lights 1
#define Day_Lights 2
#define Kalkwasser 3
#define Pumps 4
#define Unused 5
#define DeNit_Doser 6
#define DeNit_Pump 7
#define ATO_Pump 8
#define Unused Box1_Port1
#define Feeder Box1_Port2
#define Unused Box1_Port3
#define Unused Box1_Port4
#define Unused Box1_Port5
#define Unused Box1_Port6
#define Main_RODI Box1_Port7
#define Dummy Box1_Port8
makes it easier to identify which port is doing what in the code.
To have it show up in the App or the Portal it has to be done in the labels section of the Portal and then the App can pull the names from the Portal or you can set them up in the App to under the settings section.
Re: Define ports by name?
Posted: Mon Mar 23, 2015 4:46 pm
by Sacohen
I guess it doesn't as long as it work.
I guess yours works too.
Re: Define ports by name?
Posted: Mon Mar 23, 2015 6:12 pm
by rimai
lnevo wrote:Wouldnt it be the other way around roberto?
Yes, the other way around...

Re: Define ports by name?
Posted: Tue Mar 24, 2015 6:12 am
by cosmith71
Smotz wrote:I have mine like this - does it matter?
Code: Select all
#define Heater Port1
#define Topoff Port2
#define Feeder Port3
#define Skimmer Port4
#define Return Port5
#define Wave Port6
#define UVlight Port7
#define Fugelight Port8
#define Fan Box1_Port8
#define CalcDose Box1_Port1
#define AlkDose Box1_Port2
It should work out the same. The libraries define Port1 as 1, Port2 as 2, etc. Steve's version just cuts out a step.
--Colin
Re: Define ports by name?
Posted: Tue Mar 24, 2015 7:17 pm
by ewaldsreef
So does this work?
Code: Select all
// Define Relay Ports by Name
#define Return 1
#define Actinic 2
#define Daylight 3
#define Skimmer 4
#define Vortechs 5
#define Heater 6
#define Ozone 7
#define Fan 8
#define Return Box1_Port1
#define Actinic Box1_Port2
#define Daylight Box1_Port3
#define Skimmer Box1_Port4
#define Vortech Box1_Port5
#define Heater Box1_Port6
#define Ozone Box1_Port7
#define Fan Box1_Port8
#define SumpTemp T1_PROBE
#define AmbientTemp T1_PROBE
#define FragTemp T1_PROBE
Re: Define ports by name?
Posted: Tue Mar 24, 2015 8:06 pm
by rimai
You have to change the number of the probes. They are all assigned to T1
Re: Define ports by name?
Posted: Wed Mar 25, 2015 9:45 pm
by ewaldsreef
Oops
Re: Define ports by name?
Posted: Tue May 26, 2015 7:50 pm
by Maze531
i am looking to do this for mine as well. I am still new to this do I just write this in the text box and load it to the controller? It wont affect the current code that I have written?
Re: Define ports by name?
Posted: Mon Jun 01, 2015 7:20 am
by cosmith71
Maze531 wrote:i am looking to do this for mine as well. I am still new to this do I just write this in the text box and load it to the controller? It wont affect the current code that I have written?
Yes. It goes right under this line in the code.
Code: Select all
////// Place global variable code below here
It won't affect anything. In fact, you'd need to change your current code by changing all the Port1's to Return, for example, for it to make any difference.
--Colin
Re: Define ports by name?
Posted: Mon Jun 01, 2015 9:18 am
by Maze531
thank you very much I think i have it all figured out now.