which overcome the problem when I have 100,000?
Anarckos
Posts: 41
which overcome the problem when I have 100,000?
Today I have:
Compiled Code takes 1330021 bytes of memory - and Token Variable Count is 90,963 (Maximum is 100000)
Today I have:
Compiled Code takes 1330021 bytes of memory - and Token Variable Count is 90,963 (Maximum is 100000)
0
Comments
My First Project is at this level, and I'm no expert on NetLinx. I know I'm doing it less accurate. but I'm worried about those numbers.
Yeah, You might want to have a look at your code. that seems like a high count to me. I'm not sure how you could post it here. It may be the kind of thing that you're declaring a lot of vars when you may not need to. Perhaps you can post the project file if you trust us enough to look at it.
If there's one thing everyone here has, it's an opinion. and most folks don't seem to shy to share it with you.
Maybe your using multiple instances of modules that use a large amount of vars and constants, maybe your using the older UI modules that required an instance per TP.
My tech is Portuguese but 2nd gen US so while he can speak it well he can only read it a little bit. He swears at me in Portuguese all the time but since I grew up in a Portuguese immigrant neighborhood I sort of know what he's saying.
Either way, I'd not be in a big hurry to find out.
I also did not want to find out early, but I do not think I'll have to avoid.
I'm using enough variables of type char:
I think it occupies too much space.
which consumes more:
Variavel_Nome CHAR []
or
Variavel_Nome CHAR [30]
AMX engineering is quite ambiguous about how the count even occurs. As our projects are huge, this was a concern, and it's not an option to just do less.
We did many tests with small projects with just one difference each, and the reported variable count swung wildly with each minuscule change. Adding what you and I would consider to be ONE variable affected the "count" by as much as 100.
As to why the count cannot be over 100,000... well, that's a number someone in engineering thought was high enough not to be limiting, and that's as high as they tested the system in QA. They admit that there is no actual reason to suppose that more would be a problem, they just don't allow it because they didn't test it beyond that and so they can't support it beyond that.
With the new high memory NetLinx, it's reasonable to suppose that larger programs will need to be supported and that the "limit" will be moved up.
Ricardo
Sorry for not sending the code yesterday, I was without Internet access.
Attached is the entire project, still has some things to be done, but this proncipal al.
I have:
CardFrame 1-12 Card IR
CardFrame 2-12 Relay Card
CardFrame 3-12 Card I / O
Interfaces
1 - MVP-5200i
2 - MVP-CV5
1 - MVP-5150
3 - Keypad (I forgot the code Now)
I have some Non_Volatile Variables,
Netlinx I use for programming.
The main variables in my program are in the Include "VARIAVEIS", many functions getting char[] as parameters.
From your code I can tell that you have some very good programming skills on how to manipulate strings and create functions. However, my approach when programming Netlinx is to always try to use the less amount of code possible to automate large systems. You can achieve that by creating modules for repetitive tasks, reducing the amount of string vars and manipulation to the very necessary tasks only, use source variables to handle all your IR needs. There are a number of techniques that can be applied to make your code use less memory and run more efficiently. Now, regarding your code, my first impression is that your problem might be related to the number of variables and constants declared and the amount of string processing, other programmers here may have even a better opinion. It is hard to change programming habits, especially when you are so deep inside a project and have spent so much time on it. But in my honest opinion, it will be to your advantage to learn how to create modules and how to use DEV arrays more efficiently. If you haven't been to the AMX Programming classes II and III yet, I strongly recommend them to you. In these classes you will learn how to optimize your code, create modules and enhance your skills on Netlinx programming. Please don't get me wrong, your programming skills are way better than mine when I started my programming ventures in the automation World, you just need some insight on how to make the most of the Netlinx programming. Please find attached some sample code on how to handle IR devices with minimal coding. Regards,
Ricardo
Actually, I have no courses NetLinx, I come from other programming languages. lack of knowledge of language creates these problems. I always wanted to learn to work with modules, but never had to study it sink. STRUCT founded recently discovered, that helped me a lot. but now it's late, I can not remodel the entire process at this time. unless it is necessary realemte and fast.
Thanks, no problems, I am here to learn, even if the whole process is wrong. need to know that.
Soon will have a course here in Brazil, I'm ready to go.
As a reference, the job I am working on now has 3 8400s, 8 R4s, 2 MIO keypads, a full Kaleidescape system, 20 or so global and local sources, 2 large matrix switches, 5 cameras, 20 HVAC zones, 100 lighting zones, 150 security zones, and a few other doo hickeys and has a T&V count of 17118.
Paul
I just looked at your code.
By changing the parameters in 1 function from char to integer I was able to reduce the token/variable count by more than 1000.
Removing all the MID_STRING references that are not required also makes a big difference.
I hope this helps!
Cheers
Yes, I am removing MID_STRING. The values have already fallen enough. This conversion of CHAR STRING paw, is necessary, since the function can take the percentage at which the dimmer must go. ie. I must receive, "ON", "OFF", "REVERSES or 10.50 ... 100% ...
Another thing I'm removing are SEND_STRING 0, "'VALUE =' VARIABLE '
It also has decreased by approximately 5000
I think this will have to maintain.
Tanks Mush
Instead of this..
You could do this.. Passing in by integer reference will significantly reduce your T & V count as well as speed up your processor and reduce memory usage.
Cheers
How not thought of that before ... Thank you.
You are welcome!
What brand and model of dimmer are you controlling?
Cheers
This post might be helpful:
http://www.amxforums.com/showthread.php?7920-Modules-what-good-are-they&p=54965#post54965