Size and depth of structure issue
fogled@mizzou
Posts: 549
I've been revamping some of my code, and creating bigger nested structures to hold all my device information. At this point, I've got a structure with up to 4 nested sub-structure levels that adds about 200K to the TKN file on upload.
When I have this structure defined, no code will run on my controller. When I comment the structure out, code will run OK. I seem to be breaking some limit somewhere, but... I don't know what it is.
When I have this structure defined, no code will run on my controller. When I comment the structure out, code will run OK. I seem to be breaking some limit somewhere, but... I don't know what it is.
0
Comments
...and then in Define Start, I have: PERSISTENT roomdata rm[20]
Actually, you may be right because I'm using DEV way down in rm[x].d[x].ipcomm[x].devid - which is itself a DEV, but that's still just 4 deep, not 5 deep. I can't spot anything that goes more than 4 deep, can anyone else? Is there anything else in here that's a no-no?
Thanks,
I backed the msgs structure call off to 10 instead of 128, and the system works OK.
Paul
So far, I haven't run into this. I'm walking an x[20].y[10].data nested structure (as big as it's going to get) with nested FOR loops , pulling data as needed, and it does the whole thing in a fraction of a second. I'll keep my eyes peeled for slowness, though.
I totally forgot I could telnet in and do a Show Mem though; thanks for the reminder. ;-)
Mine *WAS* large, until I put it on a diet. But I don't actually "walk" the structures anywhere but startup when I need to open all the IP ports the system makes connections to. Otherwise, everything is a direct call to a specific cell as needed. I'm not even using the message trapping part of my structure right now, it was just on the slate for implementation.
The "Program" part where all the feeback is, though... the system walks that all the time anyway, although the calls in the feedback are mostly only 2 levels deep, occasionally 3 (audio channel mute state). There should be a slowdown there, shouldn't there?
However, I doubt I'll see any noticeable slowdown, just because my structure isn't really *that* big.
Still interesting to know structures are much slower than arrays though. Not surprising, just... interesting.
DEFINE_VARIABLE
INTEGER testChan = 255
and then
Button_Event[dvtpTestChan, testChan]
then your netlinx system allocates memory for all channels 1-254. in addition to 255.
Is there a reason for you to have such a monster struct? I generally like to have smaller structs, as they make the lookup process faster, and I can break them out into separate AXI files to make maintenance easier.
I'm aware of the waste in memory allocation, it is what it is. I buy the high-end controllers with more memory so I can be lazy an more consistent about my system design and programming. The only reason I killed this one was because I had a defined a huge error message storage system to get around the fact that the controllers lose all their console messages on power loss.
But I don't really need that so much, because I've got the controllers reporting back to a central database system which stores the messages (kind of a homegrown RMS but without all the unnecessary crap). So, I just scaled back the size of that part, and got within the memory bounds.
RANT ON
At this point, I've started co-developing another system to replace AMX controllers, built on all open-source stuff: Postgre for data storage, Python for core logic processing, and PHP to serve UI's. Then, IP-serial devices for the crap that doesn't have IP-based communications. The design of my structures in AMX mirrors the structure of my real database I'm developing.
Quite frankly, I'm pissed at the way AMX has re-structured their technical support. I'm not a dealer, but I deal with dealer-sized deployments and equipment counts, and where a quick phone call used to get me what I needed, now it's a huge hassle to get anything out of AMX. As a result, I'm accelerating my drive to move away from vendor-specific solutions. I put myself at the mercy of AMX, and they cut me at the knees for it. I won't put up with that any longer than I have to.
And don't get me started on the AMX University bit. I tried to get one of my co-workers registered in that system; we kept filling out and submitting the forms, and we never hear anything back. I buy tons of AMX stuff, but it never gets credited to my account. From my perspective, it's nothing but a hokey PR disaster that's left a very bad taste in my mouth. I gave up on it.
I still need AMX right now, because I don't have anything better to take it's place yet, but AMX's days are numbered on my campus. In the meantime, I'll push the AMX controllers to their limit.
RANT OFF
If you don't like AMX support, I doubt you will like PHP, Postgre, and Python support much either.
Paul
The difference is, not being at any one person's or vendor's mercy. Our campus has dozens of very competent programmers who know these open source tools even better than I do. Our campus has only one certified AMX programmer - me - and only two in our entire town, and I can't even directly get help from AMX anymore.
The difference is, the open source software runs great on redundant virtual servers on our production floor, whose cost has already been completely amortized within our organization. AMX hardware very reliable, but is poor at redundancy, and quite expensive in comparison.
Sorry to sound so pissy about it. AMX can make their decisions, and I can make mine. Customer service is extremely important to me, and my perception is that AMX changed formerly great customer service into currently horrible customer service. I realize not everyone has experienced the same; I'm just one of those outliers that fell through the cracks. But as one of the few that has been cut off from good support, I have to react to the situation I find myself in. My reaction is to walk away in as orderly a fashion as I can.
I would either use
http://www.jr.com/startech/pe/TCH_PEX8S952/
or
http://www.jr.com/startech/pe/TCH_ICUSB23216F/
I can confirm both work quite well, instead of ip > serial, sometimes having an issue when the tcp/ip stack is waiting for more data to form a filled packet instead of sending with no delay.
I made a .net based system recently, but, decided to not pull the trigger. FWIW, look at the patent document and wireshark captures and watch the panel > master comms and you can make your panels play nice with you new system.
In the best of worlds, I wouldn't even need to use serial. I don't drive serial to projectors anymore; all new installations are direct IP connections. All the higher-end audio DSP's are IP-based too. For really simple rooms where we just run audio control through the projector, I just drop in a touchpanel and a projector, run a network cable to each, enable them in the central controller, and I'm done. It's simple and relatively inexpensive, compared to controllers in each room and serial everywhere.
For the slightly more complex rooms, I drop a MOXA in to drive serial to a switch and a low-end audio control device. It's mostly just video switches, low-end audio controllers, and lighting systems that still require serial. Still modular and less expensive than dedicated controllers.
For the big rooms, I still buck up for a dedicated controller, but I'm getting really close to being able to drive even the biggest systems off a controller on my production floor with only IP-based connections. That's part of what my "monster" structure is all about. I'm hoping this summer will be the last time I wind up installing a dedicated controller for a single room of any size.
The idea with the server-based open source system is to completely ditch proprietary hardware, including touchpanels. Instead, I'll put the controls on smartphones and tablets for user convenience, and fixed touchscreen kiosk units in rooms. That's all commodity hardware, not vendor locked, and far less expensive.
This is what AMX is competing against. I can understand they need to cut costs, but cutting customer service to people like me is really just shooting themselves in the foot. My open-source system would still just be an idea if I hadn't been kicked out of being able to call their tech support directly, and take a month-long round-trip through a 3rd-party vendor just to get a piece of equipment repaired. But now, I've already got the project underway, and a simple test system in operation.
This is the last post I'm going to make on this thread. I've spoken my piece. Thanks for listening and understanding.