How can I edit inherited macros in new component?

A forum where Flowcode v6 user created components can be shared, discussed and reviewed.

Moderator: Benj

maharadga
Posts: 57
Joined: Mon Dec 01, 2014 1:38 pm
Location: Bulgaria
Has thanked: 12 times
Been thanked: 11 times
Contact:

How can I edit inherited macros in new component?

Postby maharadga » Mon Jan 09, 2017 5:11 pm

Hi all.
I want create new component like thermistor EBM003, but I want increase range from -50C to 300C. I copy settings and inherit macros from EBM003 to new component but I can't edit macros called SetMinMax.
It's possible edit this macros or not?

I think tutorials how create new component or edit exist must be more detailed and understandable.
Thank You.

User avatar
Benj
Matrix Staff
Posts: 13948
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4224 times
Been thanked: 3980 times
Contact:

Re: How can I edit inherited macros in new component?

Postby Benj » Mon Jan 09, 2017 5:57 pm

Hello,

We have recently done a lot with the component creation system to vastly simplify it. This v7 update is currently pending and should be available soon.

Once we have released this we can start updating the documentation and creating some much more user friendly examples.

For now here is the EBM003 component source which you can use to create your own slant on the component.

EBM003v1.fcfx
(50.04 KiB) Downloaded 88 times


Let us know how you're getting on.
These users thanked the author Benj for the post (total 3):
medelec35 (Mon Jan 09, 2017 6:15 pm) • kersing (Mon Jan 09, 2017 6:55 pm) • maharadga (Tue Jan 10, 2017 12:40 pm)
Rating: 17.65%
 

maharadga
Posts: 57
Joined: Mon Dec 01, 2014 1:38 pm
Location: Bulgaria
Has thanked: 12 times
Been thanked: 11 times
Contact:

Re: How can I edit inherited macros in new component?

Postby maharadga » Tue Jan 10, 2017 12:42 pm

Thank you. I try and will reply.

maharadga
Posts: 57
Joined: Mon Dec 01, 2014 1:38 pm
Location: Bulgaria
Has thanked: 12 times
Been thanked: 11 times
Contact:

Re: How can I edit inherited macros in new component?

Postby maharadga » Wed Jan 11, 2017 3:40 pm

Hi.
I make my component but have the same problem. I can't read temperature over 125C and under -25C. She's show but can't read. I think because new component EBM003v1 have inherited macros from thermistor base component. They don't allow /maybe/ increase range.
See attached files for details.
Attachments
Pt100.fcpx
(5.5 KiB) Downloaded 78 times
Pt100 read and display.fcfx
(9.19 KiB) Downloaded 81 times

User avatar
Benj
Matrix Staff
Posts: 13948
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4224 times
Been thanked: 3980 times
Contact:

Re: How can I edit inherited macros in new component?

Postby Benj » Wed Jan 11, 2017 4:22 pm

Aha, Yes you're absolutely right. Here is the source for the v6 thermistor base component so you can edit the range.

Thermistor_base.fcfx
(26.01 KiB) Downloaded 86 times

maharadga
Posts: 57
Joined: Mon Dec 01, 2014 1:38 pm
Location: Bulgaria
Has thanked: 12 times
Been thanked: 11 times
Contact:

Re: How can I edit inherited macros in new component?

Postby maharadga » Fri Jan 13, 2017 2:50 pm

Hello.
I make RTD_base component from Thermistor_base. After that I make component Pt100 from EBM003v1r + RTD_base.
And finaly If I try read and display temperature, readings are over 25C and I can't make hex file. There's lot of mistakes
I know I was wrong but where? Calculations not my power. If anyone has some free time to look at the files and give me direction, I would be very grateful.
Thank you.
Attachments
Pt100.rar
(22.19 KiB) Downloaded 84 times

maharadga
Posts: 57
Joined: Mon Dec 01, 2014 1:38 pm
Location: Bulgaria
Has thanked: 12 times
Been thanked: 11 times
Contact:

Re: How can I edit inherited macros in new component?

Postby maharadga » Tue Jan 24, 2017 5:16 pm

Hello. I edit component EBM003 and make component Pt100 with less range. From -25C to 200C. Add 3 sample points and expand range. ADC resolution is set to 10 bit. Now in simulation work normally but in compilation I see following message:


Pt100 read and display.c:
116: 450
^ (285) no identifier in declaration
^ (374) missing basic type; int assumed (warning)
^ (314) ";" expected
118: 465
^ (285) no identifier in declaration
^ (374) missing basic type; int assumed (warning)
^ (314) ";" expected
120: 479
^ (285) no identifier in declaration
^ (374) missing basic type; int assumed (warning)
^ (314) ";" expected
(908) exit status = 1
(908) exit status = 1

I attach c file, project and component. Have somebody idea what is the mistake?
Attachments
Pt100 read and display.c
(34.1 KiB) Downloaded 74 times
Pt100.fcpx
(5.45 KiB) Downloaded 59 times
Pt100 read and display.fcfx
(8.78 KiB) Downloaded 70 times

User avatar
LeighM
Matrix Staff
Posts: 1749
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 414 times
Been thanked: 578 times
Contact:

Re: How can I edit inherited macros in new component?

Postby LeighM » Tue Jan 24, 2017 5:39 pm

Hi,
Looks like you are making good progress.
Have a close look at how you have edited the .Expansion in Ev_AddVar
In the original code each item added is followed by

Code: Select all

.Expansion = .Expansion + ",\n"

the last item is followed by

Code: Select all

.Expansion = .Expansion + "\n};\n"

Looks like you have that last line after each of your new additions.
These users thanked the author LeighM for the post:
maharadga (Wed Jan 25, 2017 7:39 am)
Rating: 5.88%
 

maharadga
Posts: 57
Joined: Mon Dec 01, 2014 1:38 pm
Location: Bulgaria
Has thanked: 12 times
Been thanked: 11 times
Contact:

Re: How can I edit inherited macros in new component?

Postby maharadga » Wed Jan 25, 2017 7:47 am

Thank you, LeighM.
You're absolutely right. Like I say calculation not my power. I simply paste and copy new Expansion but not right :=)
Thank you very, very much! Now everything is Ok.
I will made new component Pt1000, taste it in work and paste in forum.
Have a nice day!
These users thanked the author maharadga for the post (total 2):
LeighM (Wed Jan 25, 2017 9:25 am) • Benj (Wed Jan 25, 2017 10:56 am)
Rating: 11.76%