Home AMX User Forum NetLinx Studio

Wierd events issue that cost me about 5 hours...............

Was on site the other day and did an initial compilation, downloaded my code and when the master rebooted there were no virtual devices showing in the online tree. Also device zero was not evident, but the program was running and you could see some notifications...well, bizarre.

Couldn't sort this out so I thought I would start from scratch and copied the main parts of the program into a new file. When I downloaded this everything worked... again very bizarre. However, as I started to add all the other bits of the program in, the fault re-ocurred. I managed to tie this down to a section that had been added 'out of the normal order'. Whilst it SHOULDN'T matter, I had dropped a CHANNEL_EVENT in between two DATA_EVENTS and this was causing the problem. When I moved it to the end of the events section, everything worked again.

Now, I've been programming for a few years and would like to think that I'm not thick - when it comes to coding. But this is CRAP!
If events need to be in a particular order, then there should be a split section for particular events. Normally, this would never have occurred in my coding as I tend to group event types and I suspect that this has been 'broken' in one of the Studio upgrades. Being honest, tech support wanted me to send various versions to them to verify that the problem existed but I was tight for time and, quite frankly, if they can't be arsed to put this fault on X Track without 'cast iron' proof - considering the time I've been doing this - then I couldn't be bothered to send it to them.
Bad attitude maybe, but the lack of interest recently in fixing issues is driving me a bit nuts. As an independent programmer, I seem to spend my life doing 'work arounds' for stuff that doesn't work and no one seems really that interested - so I've come to the conclusion that this will work both ways.

So, just in case anyone comes across this problem - the solution is above.....

Just to add to the problem list, I recently come across a Master that would not maintain its system number. IP address and everything else was fine, but kept resetting its system number to 1 and therefore generated errors due to the fact that there was two system 1's. The only way I could get around this was to change my code and make the one that kept resetting to system 1 into system 1. Again, no one could give me a solution or an answer. The only difference between this master and the rest was that it was connected to a card frame via ICSHub..what difference that should make..lord only knows

Apologies if you think this is a bit harsh!

stepping off my soap box and going to bed........

hope this saves somebody else a bit of time...

Comments

  • Spire_JeffSpire_Jeff Posts: 1,917
    I'm not doubting that you had a problem, but I don't think it was the order of the events. I mixed event all of the time, so unless I have been very lucky in the order, I am guessing that something in the channel event was being misinterpreted by the compiler and was bleeding through to the next event. When you moved it to the end, the define_x statement told the compiler to handle it differently. I have also seen copy/cut and paste put some odd characters in that were not visible, but confused the hell out of the compiler.... but that issue prevents me from compiling and throws a compiler error that is of no use in diagnosing the problem :)

    Do you have a copy of the code? I just tried it here on an NI-900 and putting a channel_event in between two data_events did not adversely affect the processor.

    Jeff
  • a_riot42a_riot42 Posts: 1,624
    I would agree that it likely isn't the order of events. Can you post the offending code? I have seen symptoms like that when I used a variable as a timeline ID instead of a constant. The compiler shouldn't have allowed it as it results in undefined behavior, but this is Netlinx, not C++. My guess is that an invisible character got into your code somehow that compiled fine but had strange run time effects.
    Paul
  • yuriyuri Posts: 861
    I have had a master resetting to system 1. Sent it back to AMX for repairs and all is well now...
    It didn't loose it's IP address or program, so nothing wrong with the memory.
  • AuserAuser Posts: 506
    Was on site the other day and did an initial compilation, downloaded my code and when the master rebooted there were no virtual devices showing in the online tree.

    This sounds like what occurs when there's a mismatch between the Duet runtimes on the development machine and the firmware version on the master if the vdevs that you're referring to were Duet devs. Did you do a firmware update at any point after noticing the problem?
  • DHawthorneDHawthorne Posts: 4,584
    Auser wrote: »
    This sounds like what occurs when there's a mismatch between the Duet runtimes on the development machine and the firmware version on the master if the vdevs that you're referring to were Duet devs. Did you do a firmware update at any point after noticing the problem?

    It will happen with non-Duet systems as well if something eats up too much memory in the startup routines, or too much processor time. I wish I could be more precise; I tend to revert to a sort of shotgun mode when I run across such issues, and shoot first, then ask questions later. Suffice it to say, I have seen code problems cause virtuals never to come online, and resolving them resolved the rest.
Sign In or Register to comment.