Page 1 of 1

How can I edit inherited macros in new component?

Posted: Mon Jan 09, 2017 5:11 pm
by maharadga
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.

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

Posted: Mon Jan 09, 2017 5:57 pm
by Benj
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.03 KiB) Downloaded 362 times
Let us know how you're getting on.

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

Posted: Tue Jan 10, 2017 12:42 pm
by maharadga
Thank you. I try and will reply.

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

Posted: Wed Jan 11, 2017 3:40 pm
by maharadga
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.

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

Posted: Wed Jan 11, 2017 4:22 pm
by Benj
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 KiB) Downloaded 352 times

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

Posted: Fri Jan 13, 2017 2:50 pm
by maharadga
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.

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

Posted: Tue Jan 24, 2017 5:16 pm
by maharadga
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?

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

Posted: Tue Jan 24, 2017 5:39 pm
by LeighM
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.

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

Posted: Wed Jan 25, 2017 7:47 am
by maharadga
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!