CyBoot is special as you never actually see it on the schematic. For any component you can drag and drop, there isn't a great way to prevent dropping multiple copies. In general the fitter will give an error on overuse of resources.
I believe you can play some games with the c code that will give an error on compilation (just leave a nice comment as to why the user's getting an error) or there may be a way to create a DRC error on generating source if you see two copies.
Thanks again for your assistance.
Since my original post here, I have been able to prevent incrementing instancing. However, the component object still uses the instance (_1) when it creates the .h file. I'd like to fix that too.
I'll look into the DRC checking.
I wonder how you were able to block incrementing instances? Can you share an example?
If you want to prevent instancing of the UDB Component you created then go to the .cysym page of the component created. Double click (select) the instance name on the component. delete the name and save. Now when you use the component in the schematic it will not have any instance name.
Thanks for the suggestion. It didn't work. I still had instancing occurring.
1 of 1 people found this helpful
Again, I'm going to say this is not recommend and very strange to do. But you can create an error when two instances are put down if you do something like this in a header file (assuming your component name was CP1):
There can only be one instance of CP1
Users of course can import you component and change this behavior or simply disable code generation and edit to their hearts content.
Thank you for the hint. Do you think it is possible to add something similar to the customizer file so that it will throw Error if another instance is found?
Possible? Sure, most things are possible given enough time and effort. I suppose you could create a shape customizer and a semaphore for counting, and then use the count in the UI customizer. That said I really don't recommend doing that.
The C code is far simpler and has a lot less gotchas to deal with. For example, if you use the semaphore, you need to make sure it takes into account multiple projects, multiple schematic pages that could be enable/disabled, and multiple instances of Creator running.