Locking a master from code
a_riot42
Posts: 1,624
I didn't think it was possible, but I have some code that can lock a master (status light stops flashing). All that it took was an array index error in a timeline. Timelines must get some special priviledge to memory or something?!?
I didn't think you could lock a master from user code but it happens everytime I run this timeline.
Anyone done this before without using a loop or some other repetitive task that keeps the CPU busy? This is a timeline that runs only once and it usually works fine as intended unless the array index is too big and then its locks the master up.
Paul
I didn't think you could lock a master from user code but it happens everytime I run this timeline.
Anyone done this before without using a loop or some other repetitive task that keeps the CPU busy? This is a timeline that runs only once and it usually works fine as intended unless the array index is too big and then its locks the master up.
Paul
0
Comments
NetLinx is an interpreted language (like Visual Basic), and as such traps most of the kinds of errors that can lock a master; this is what makes it feel like you can't do such a thing most of the time. The thing is though, when stuff does get past the interpreter, the failures tend to be more spectacular. Probably in your case, you found an error the interpreter isn't catching rather than timelines being more privileged or something of that nature.
I know about those types, while loops, recursive button events, bad code in program section and the like but I have never had one line of code that either locks up or reboots the master. I am going to do an experiment and post the line and see if others get the same behavior. Could come in handy sometime
Paul
yes,
setting the 1st dip switch to 'on' on the NI master disables the program currently loaded in the memory. So, what you basically have is an Netlinx master booted up with no program in it. ONce you get to that point, you can go in and erase the old program or reload a new one. After you're done doing that, you reset the dip switch and the loaded program will begin running after reboot.