Define ports by name?
- ewaldsreef
- Posts: 82
- Joined: Tue Oct 08, 2013 8:22 pm
- Location: Salt Lake City, UT
- Contact:
Define ports by name?
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?
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?
Defining port names in your code like this...
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.
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
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.
- ewaldsreef
- Posts: 82
- Joined: Tue Oct 08, 2013 8:22 pm
- Location: Salt Lake City, UT
- Contact:
Re: Define ports by name?
Thank you Steve.
Can I also define temp probes by name?
Can I also define temp probes by name?
Re: Define ports by name?
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.
Check lnevo's code. If it can be done I'm sire he has done it.
Re: Define ports by name?
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...
makes it easier to identify which port is doing what in the code.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
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?
I guess it doesn't as long as it work.
I guess yours works too.
I guess yours works too.
Re: Define ports by name?
Yes, the other way around...lnevo wrote:Wouldnt it be the other way around roberto?
Roberto.
Re: Define ports by name?
It should work out the same. The libraries define Port1 as 1, Port2 as 2, etc. Steve's version just cuts out a step.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
--Colin
- ewaldsreef
- Posts: 82
- Joined: Tue Oct 08, 2013 8:22 pm
- Location: Salt Lake City, UT
- Contact:
Re: Define ports by name?
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?
You have to change the number of the probes. They are all assigned to T1
Roberto.
- ewaldsreef
- Posts: 82
- Joined: Tue Oct 08, 2013 8:22 pm
- Location: Salt Lake City, UT
- Contact:
Re: Define ports by name?
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?
Robert
Re: Define ports by name?
Yes. It goes right under this line in the code.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?
Code: Select all
////// Place global variable code below here
--Colin