Home AMX User Forum NetLinx Studio

My first project...ugh

This is more a testimonial, but maybe it will be cathartic for some to read.

I'm pretty new to AMX and NetLinx. I'm a C# programmer by trade but have always had an eye on the A/V world. I graduated from film school in the mid-90's but slowly got sucked into programming over the years. I met a project manager at an A/V dealer over the last couple of months who got me interested in programming control systems. I like new challenges so off I went. I ordered up an NI-3000 on eBay and got it around Christmas-time. I ran through some Programmer I & II materials which I was able to scrounge together and got setup with AMX so I could take their online classes. I learned a TON pretty quickly.

I contacted my dealer friend to let him know I might be ready to start working a real project...I didn't want to sit back and analyze too long. Best experience for me is usually throwing myself into it. He had a job which another programmer was going to do the actual programming on, but I could shadow the job and at the end, test my code in the live environment. The job was pretty straightforward...

1 - NI-3100 Controller
2 - Mitsubishi WL639 Video Projectors w/ 2 inputs (PC & Tuner)
2 - Contemporary Research 232-STS Tuners
2 - Draper Screens
TOA A-9120S Mixer/Amp
NXT-CV7 Touchpanel (only one)

I had 10 days to put this together which, for a first project, felt like a tight deadline but I jumped at the chance to be able to connect to some devices. I probably spent the first 4-5 days figuring out how to put together a decent modular design w/ Netlinx. I was rolling my own modules so was using the protocol docs which I had pulled together on the web. The final 5-days I was trying to learn best practices (mainly from great advice and counsel of board members here! THANKS!). This included how to use virtuals, queueing, parsing buffers, etc.

The day to test my code finally came. I got to the site and loaded everything up. Upon pressing a button on the touchscreen, a whole series of actions took place. I was thrilled! Screens came down...projectors turned on...tuners turned on. I was jazzed! I couldn't believe any of this was working as I'd been flying blind with no devices!

Then came the problems. I tried to change the inputs on the projectors and they just wouldn't change. I tried to change the active audio channel and it wasn't working. I started to panic because I only had 2 hours to test my code before the old code had to be put back. I wanted to make a good impression for my first project and it was going south. I was watching my diagnostic windows and could see my touchpanel button presses going through the different layers and reaching my queue which should have been sending out the correct commands to the projector...and then, what was that...it looked like my hex commands were tranforming to something else...or were those the commands that were being run for polling? I was getting confused.

I started adding more and more send_string 0 commands to my code to hopefully spit out that magical answer to all my problems. In the end, I ran out of time. With my tail between my legs, I had to confess that I didn't know why certain functions working. Maybe my queue wasn't working...maybe sending too many commands too fast...don't know.

We put back the old programming and left. I expressed my diappointment that it didn't work how I expected. He told me that all programmers have this issue, especially the first time. I still wasn't happy. I went home and reviewed my code...ran through some more debugging on my NI-3000 at home...I found a few issues but not really sure if either was the culprit.

Still, amidst all this disappointment, I can't help but feel that the project was a blast to program and the brief moment where I experienced pushing something 'here' and having devices all the sudden whirr to life 'over there'...priceless. I think I'm hooked. Now if I could just fix those mistakes...I'd feel better. A great experience, nonetheless.

Cheers,
Matthew

Comments

  • PhreaKPhreaK Posts: 966
    Nice one, good to hear you had an interesting experience. It's no fun if it all just works the first time. Yes it's a good feeling to have everything perfect but personally I find half the joy of programming is when you get deep and dirty in a real debugging mind state and map out the whole system mentally, and really get your head around exactly how all your modular code snippets react with each other and the randomness of different user patterns; that's when you can really pick up on some groovy optimizations.

    As someone else who has recently moved into AMX programming I'm interested to hear how far you were able to take the modularity. After growing up (both physically and code wise) with true object orientated languages I find it hard to really get things neatly separated and encapsulated in Netlinx. As I play round with it and experiment with different approaches I find I'm able to increase modularity, but not to as completely as I'd like at the moment.
  • jweatherjweather Posts: 320
    Sounds like you gave it a good try, but 2 hours is nowhere near enough time for testing. Maybe if everything worked right on the first try, but that never happens.

    Some advice... keep it simple, don't try to put everything into your first program, just do it the simplest way it works. When you're testing offline, spend plenty of time in the Notifications window making sure you're sending all the strings you're expecting. Use Emulate a Device to send responses back and make sure they're parsed correctly. If you know you're going to have limited testing time, like above, put some time into making a little test page for each device so you can quickly narrow down where the problem is (code vs. specific device commands)
  • Thanks for the comments, guys. I really appreciate it.

    I definitely agree, jweather, that 2 hours is not nearly enough. Unfortunately it was all the time I had so it was better than having it go untested. Still, for future projects (ones that I eventually am compensated for), I'll need much more time.

    Phreak, I am still getting my head around the whole modularity issue. I'm used to dealing with namespaces and classes so this is a bit different. Netlinx is obviously not a truly object oriented programming language like Java or C#, but I'm finding my way around. I think that's why the first project was a bit of a bear because I kept revising as I try to find some semblance of order and balance in the AMX programming world. I'm curious to see what Cafe Duet looks like. It's been a while since I've done Java programming but am interested to see how that works with AMX.

    Anyway, I've licked my wounds and am hopefully going to be getting some more device time this week so I can gain more confidence with AMX.

    Cheers,
    Matthew
  • LOL! I came from a PHP web app and FileMaker DB background. It took me a year of actually programming systems, the Programmer II course, and lots of help from this forum, to feel like I understand NetLinx programming. I'd say you're doing pretty good! Heed the advice of those who say "keep it simple". Even now, I still average about an hour per device in the debugging phase after all the physical installation is done and the code and UI are loaded on the panel and controller.
Sign In or Register to comment.