Status Registry API issue

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
jepaz
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

My application involves two separate status registry blocks one of them is working perfectly, I cant manage to make the other one work I keep getting the error:

   

undefined reference as if it was not declared at all. 

   

I compared both Stat.Reg files and noticed the one that gives the error is greyed out after the if #if !defined( block

   

not sure what can be done about this

   

the build report says I still have one more status registry free to use.

   

the only command I am using is Read();

   

 

   

thanks for the help

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

There is a message right before the error. "Unused parts have been optimized out..." This is exactly what has happened: yout LUTb does not deliver different values, so it has been optimized out, leaving the status register without any input. So the status register "EndsReg" was optimized-out too. Fill some values into LUTb and all is well.

   

 

   

Bob

View solution in original post

0 Likes
6 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

All we could do is guessing. Can you please post your complete project or a shortened version that shows the error so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

 

   

Bob

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I downloaded your project and successfully compiled it with 78% usage of flash memory. Setting the build configuration from "Debug" to "Release" compiled using 56% flash.

   

I realized that some of your components are a bit old. I'm using Creator 4.0 SP1 and could update your components to latest version.

   

I am not sure what the error on your side might be.

   

 

   

Bob

0 Likes
jepaz
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

sorry I had erased the error line of code I was calling the endstop=endsReg_Read(); command inside the infinite for loop on the main block

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

So can you upload again the non-working project?

   

 

   

Bob

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

There is a message right before the error. "Unused parts have been optimized out..." This is exactly what has happened: yout LUTb does not deliver different values, so it has been optimized out, leaving the status register without any input. So the status register "EndsReg" was optimized-out too. Fill some values into LUTb and all is well.

   

 

   

Bob

0 Likes
jepaz
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

Thank You Bob,

   

I appreciate it

0 Likes