AVR Enc28J60 compiler stop ::Component.Property .GetValue

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

Moderator: Benj

Post Reply
Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

AVR Enc28J60 compiler stop ::Component.Property .GetValue

Post by Rudi »

Arduino Mega 2560 R3
Enc28J60

basis

hi guys

have a try in the base and after i change the few arguments to the port var then compiled
after try to use the properties port and not the static unsigned MyPort Var, it stop compile at this.
i think there is not wrong with the api - not sure is this a bug - i used the api from wiki like describt.
compilerstop.png
simulation is ok with this api get, but can not compile with this

Code: Select all

MyPort = ::Component .Property .GetValue (TCPIP_ENC28J60,"Port")
if i use

Code: Select all

MyPort = 80
it compile and run like it must,
only stop with this GetValue..
thanks for help

best wishes
rudi ;-)

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

Re: AVR Enc28J60 compiler stop ::Component.Property .GetValu

Post by Benj »

Hi Rudi,

Yes I imagine that works well for sim but not for download.

You either need to make MyPort into a property instead of a variable or you need to use the AddVar event to populate the variable with the right initialiser value on Compile time.

If you want an example of this then let us know and I'll make you one up.

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: AVR Enc28J60 compiler stop ::Component.Property .GetValu

Post by Rudi »

[no hurry!]

hi benj,
txs!

ok - i have try :)

Code: Select all


// compile to c ok, but compile to hex not:
.Expansion = "MX_GLOBAL MX_UINT16 FCV_MYPORT = (" + ::Component .Property .GetValue (TCPIP_ENC28J60,"Port")
.Expansion = .Expansion + ");\n"

c code

Code: Select all

..
..
MX_GLOBAL MX_UINT16 FCV_MYPORT = (80);
..
..


looks good and bad :oops:
i will try later again, not sure what i make wrong.
have test more variation -

base:
i have in projekt the FCV_MYPORT in project explorer as Global Var
in TCPIP_ENC28J60 Properties i will use the String Var "Port" and fill it with 80
in the flowchart i use FCV_MYPORT in each function. so the port can be variable setup in panel properties.

i try then to get the properties var value to the FCV_MYPORT with this.

in compile to c it looks good.
in compile to hex there is a mistake.

btw:
what means

Code: Select all

.Expandname
thank you for show the right way

best wishes
rudi ;-)
addVar_try.png

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: AVR Enc28J60 compiler stop ::Component.Property .GetValu

Post by LeighM »

Hi Rudi,

There is a simple way to do this, see if this does what you want ...
property_define.jpg
property_define.jpg (64.14 KiB) Viewed 5348 times
Which creates this C code ...
define.jpg
define.jpg (28.04 KiB) Viewed 5348 times
Hope that helps,
Leigh

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: AVR Enc28J60 compiler stop ::Component.Property .GetValu

Post by Rudi »

hi leigh

why complicate things when it just goes.
I embrace you - you saved the weekend and many test hour.

best wishes
rudi ;-)

edit:
these add var possibility I'll try again later.
For this process is sufficient like you taught
btw:
you can created via the project explorer variable and the panel vars bring
together in a spreadsheet? ( yes..I think I repeat my just learned - i am happy for the weekend ( pause ) ;-) )

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: AVR Enc28J60 compiler stop ::Component.Property .GetValu

Post by LeighM »

Hi Rudi,

If you want to load a Flowcode variable (rather than C define as my previous example) then try this ...
varport.jpg
varport.jpg (62.32 KiB) Viewed 5306 times
which creates this C code ...

Code: Select all

MX_GLOBAL MX_UINT16 FCV_VARPORT;

	// Calculation:
	//  VarPort = MYPORT
	FCV_VARPORT = 80;

Regards,
Leigh

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: AVR Enc28J60 compiler stop ::Component.Property .GetValu

Post by LeighM »

Just remember properties have two names, "title" (or cosmetic name) and "variable",
"variable" name is used for calculations ...
property_options.jpg
property_options.jpg (17.14 KiB) Viewed 5302 times

Post Reply