RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
billduck
Posts: 159
Joined: Thu Jul 01, 2010 1:57 am
Has thanked: 23 times
Been thanked: 16 times
Contact:

RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20

Post by billduck »

Where can I find a description of the component macro, and examples?

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20

Post by medelec35 »

After adding component to 2D or 3D panel.
Right click on the panel component, then select Help.
If there are any examples you will see them on the page that will be displayed.

Did you have a particular component in mind?
Martin

billduck
Posts: 159
Joined: Thu Jul 01, 2010 1:57 am
Has thanked: 23 times
Been thanked: 16 times
Contact:

Re: RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20

Post by billduck »

Thanks. I am so glad to get this component macro. Am testing it now.
Going to use it on a 2 axis solar tracker, for which I need a few time variables.

billduck
Posts: 159
Joined: Thu Jul 01, 2010 1:57 am
Has thanked: 23 times
Been thanked: 16 times
Contact:

Re: RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20

Post by billduck »

It worked. Kudos to the developers. Beats writing code that the macro does.

billduck
Posts: 159
Joined: Thu Jul 01, 2010 1:57 am
Has thanked: 23 times
Been thanked: 16 times
Contact:

Re: RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20

Post by billduck »

Another question.
I have been using this RTC (DS-3231) on an application - a solar single axis tracker. Sww watt-tracker.com.
As usual, I forgot to document some code segments. The code below code was before the RTC midule was availible.
To Wit:
One subroutine I call PowerFromBattery
It goes like this:
I2C transmit byte 208 - this is a write command
I2C transmit byte 0x0E - I believe this is the control register
I2C transmit byte (0b00011100)

I can not remember what it does exactly, or from where I got it.
Any suggestions?

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20

Post by medelec35 »

Have you see this?
It applies to DS3231
Martin

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20

Post by medelec35 »

Hi billduck,
Did that help or you need further assistance?
Martin

billduck
Posts: 159
Joined: Thu Jul 01, 2010 1:57 am
Has thanked: 23 times
Been thanked: 16 times
Contact:

Re: RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20

Post by billduck »

I guess I need to go read this very carefully <https://datasheets.maximintegrated.com/en/ds/DS3231.pdf>
and see what 00011100 means. I know it's binary, but what it does in the contril register is the key.

My goal is to 1. figure out what it does, 2. See if I can implement it in the RTC component macro.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20

Post by medelec35 »

billduck wrote: see what 00011100 means.
Looking at the datasheet its just controlling the frequency of the square wave and only whe the alarm match the time keeping registers.
Does that ring a bell?
Martin

billduck
Posts: 159
Joined: Thu Jul 01, 2010 1:57 am
Has thanked: 23 times
Been thanked: 16 times
Contact:

Re: RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20

Post by billduck »

Well, thanks. I thought it had something to do with the button cell battery. So the code segment was entirely unnecessary. I will supress it and verify that the code performs as expected.

billduck
Posts: 159
Joined: Thu Jul 01, 2010 1:57 am
Has thanked: 23 times
Been thanked: 16 times
Contact:

Re: RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20

Post by billduck »

Mr Medelec35. What is incorrect with this FC example? I ram trying to show passing a variable to a subroutine and returning a variable.
Hope it is well documented.
Attachments
Subroutines with parameters and return variables.fcfx
(9.57 KiB) Downloaded 146 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20

Post by medelec35 »

Hi,
What you need to do is double click the Call Subroutine (or right click, select properties) within main.
Add the variable you want to retrieve from the Call Subroutine like this:
Properties Call Subroutine.png
(73.98 KiB) Downloaded 215 times
If done correctly, you should see the call subroutine change with the required returned variable assigned to it:
Properties Call Subroutine2.png
(12.05 KiB) Downloaded 214 times
Martin

billduck
Posts: 159
Joined: Thu Jul 01, 2010 1:57 am
Has thanked: 23 times
Been thanked: 16 times
Contact:

Re: RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20

Post by billduck »

Made that change. Thanks. The problem, I discovered was that .Angle in the sub was an integer. My Bad

Post Reply