Home AMX User Forum AMX General Discussion

System stability problem(Please help, or the client will kick my butt)

Hey guys, all my hopes raised on you.
I'm working on my first AMX project. Learning a lot, but still need some help from the side. Programmer1 is in my schedule for this spring.

Have such problem:
1. Have 6 IR devices in system. When I start the system for a first time after netlinx is restarted - every device is turning on. When I shut down the system(not the netlinx itself) - then every device is turning off.
2. When I starting the system second time - some of the devices do not start. When I'm turning it off again - some of the devices do not turning off. Every time the same devices.
3. Every next system on/off works the same - not every device starts or shuts down. (always the same devices do not start and shutdown)
4. When I restart netlinx master - first system start and shutdown is ok.
5. When I switching the commands in places, than other devices do not starting or turning on. (but I can start it manual and control from panel as usual)

Could it be because of controllers some of memory buffers? As if it couldn't swallow a lot of commands at the same time after some work. How can I clean the buffers?
cpu usage is ok.

// BUTTON ON:

BUTTON_EVENT[dvTP1_FEATURE_ON, 263]
{
PUSH:
{
vacb_system = 1 // SYSTEM IS ON

TO[vdvVPROJ1, PWR_ON] // ethernet projector is on

SEND_COMMAND vdvLIGHTSYSTEM1, 'LIGHTSYSTEMLEVEL-96:D0,160,1' // lights
SEND_COMMAND vdvLIGHTSYSTEM1, 'LIGHTSYSTEMLEVEL-96:D1,0' // lights

SEND_COMMAND vdvRELAY1, 'RELAYCHANNELSTATE-2,ON' // relay

TO[vdvCD3, PWR_ON] // IR device1 is on
TO[vdvPREAMP1, PWR_ON] // rs232 audio processor is on
TO[vdvCD2, PWR_ON] // IR device2 is on
TO[vdvCD1, PWR_ON] // IR device3 is on
TO[vdvCD6, PWR_ON] ] // IR device4 is on
TO[vdvCD5, PWR_ON]] // IR device5 is on
TO[vdvCD4, PWR_ON]] // IR device6 is on
}
}

// BUTTON OFF:

BUTTON_EVENT[dvTP1_FEATURE_OFF, 264]
{
PUSH:
{
vacb_system = 0 // THE SYSTEM IS OFF

TO[vdvVPROJ1, PWR_OFF] // ethernet projector OFF

SEND_COMMAND vdvRELAY1, 'RELAYCHANNELSTATE-2,OFF' //relay1 off
SEND_COMMAND vdvRELAY1, 'RELAYCHANNELSTATE-1,OFF' //relay2 off
SEND_COMMAND vdvLIGHTSYSTEM1, 'LIGHTSYSTEMLEVEL-96:D0,100,1'

TO[vdvPREAMP1, PWR_OFF] // rs232 audio processor is off
TO[vdvCD5, PWR_OFF] // IR device5 is off
TO[vdvCD3, PWR_OFF] // IR device3 is off
TO[vdvCD2, PWR_OFF] // IR device2 is off
TO[vdvCD6, PWR_OFF] // IR device6 is off
TO[vdvCD4, PWR_OFF] // IR device4 is off
TO[vdvCD1, PWR_OFF] // IR device1 is off

SEND_COMMAND dvTP1, '@PPG-wait'

WAIT 600
{
SEND_COMMAND vdvLIGHTSYSTEM1, 'LIGHTSYSTEMLEVEL-96:D0,0,1'
SEND_COMMAND vdvLIGHTSYSTEM1, 'LIGHTSYSTEMLEVEL-96:D1,0'

send_command dvTP1_NAV_Nav82, '^BMF-1,0,%CF #EE1004FF'

SEND_COMMAND dvTP1, '@PPG-turningon'

SEND_COMMAND dvTP1, 'sleep'

}

}
}

I tried to do it with WAIT's betwen commands, but the result is simmilar. Some of the devices do not work.

Please help me, tommorow is my deadline and I have to solve this problem :(
Promise to send a post card to the one, who could help me!

Comments

  • Which devices do not work?
  • It could be IR, rs232 or ethernet controlled devices.
    Different devices do not start or shutdown when I changing commands in places.
    for example:
    a start
    b start
    c start
    to
    b start
    a start
    c start

    And its not meen the same number command will work. In first way (for example) the second command may not work, in the second way - the third.
  • Hang on - the order isn't going to be your problem. In your first post you say it is the same devices not working each time. is it the CDx Players that arn't working

    Can you refer to the actual Device (ie vdvCD4) that aren't working?

    Is this code from VA?
  • The code was generated by VA, but I have modified it a lot.

    The same devices do not start/shutdown with the same program code.

    If I change commands positions in program code and upload it to master. Than the other group of devices do not start/shutdown.
    :(
  • TO[vdvPREAMP1, PWR_OFF] // rs232 audio processor is off
    TO[vdvCD5, PWR_OFF] // IR device5 is off
    TO[vdvCD3, PWR_OFF] // IR device3 is off
    TO[vdvCD2, PWR_OFF] // IR device2 is off
    TO[vdvCD6, PWR_OFF] // IR device6 is off
    TO[vdvCD4, PWR_OFF] // IR device4 is off
    TO[vdvCD1, PWR_OFF] // IR device1 is off
    

    Your saying that some of the CD Players turn off, and some do not.

    1) Do you get IR being outputed - does the LED in question flash?
    2) Why are you using TO rather than PULSE - shouldn't be a problem, but TO will send for the duration of the original button push.
    3) Are all CD Players the same?
    4) Are all CD Players in the same location?
    5) How are the 6 vdvCDx defined? I don't know VA so assume you have a duet module for the CD player somewhere?
  • No, a players is different. And the problem not only with players.

    For example I have:
    TO[vdvPREAMP1, PWR_OFF] // rs232 audio processor is off
    TO[vdvCD5, PWR_OFF] // IR device5 is off
    TO[vdvCD3, PWR_OFF] // IR device3 is off
    TO[vdvCD2, PWR_OFF] // IR device2 is off
    TO[vdvCD6, PWR_OFF] // IR device6 is off
    TO[vdvCD4, PWR_OFF] // IR device4 is off
    TO[vdvCD1, PWR_OFF] // IR device1 is off

    if I will do:
    TO[vdvCD6, PWR_OFF] // IR device6 is off
    TO[vdvCD5, PWR_OFF] // IR device5 is off
    TO[vdvCD3, PWR_OFF] // IR device3 is off
    TO[vdvPREAMP1, PWR_OFF] // rs232 audio processor is off
    TO[vdvCD2, PWR_OFF] // IR device2 is off
    TO[vdvCD1, PWR_OFF] // IR device1 is off
    TO[vdvCD4, PWR_OFF] // IR device4 is off

    - the audio processor might do not start/shutdownt in this program version.

    Can't tell if all LEDs is flashing. What if Yes? What if Not? The equipment is already at the clients house. I will try all the solutions tomorow. The deadline is also tomorow. So I need to prepare for every case of trouble.

    Yes, VA code is using a duet module for any IR output. (I think it's AMX_IO_Comm_dr1_0_0.jar)
  • DHawthorneDHawthorne Posts: 4,584
    It sounds to me like power toggles are being sent where discretes are needed. Are all the functions called by PWR_ON really power on, or possibly power toggle?
  • No, the PWR_ON IR commands is correct for sure.
  • ericmedleyericmedley Posts: 4,177
    No, the PWR_ON IR commands is correct for sure.

    Just to make sure, when you manually send the power on the device turns on and when you send it again it stays on?

    The problem is that it is hard to tell what's wrong by looking at the chunk of code you've posted. There's nothing obviously wrong with it.

    The problem is more likely in the part of code that the TO[... etc statements initiate.

    All the TO[... statements are doing is breifly turning on a channel on a virtual device. It is in the code for the virtual device you'll likely find the problem. (or how the virtual devices interact with each other)

    I'm suprsed that VA would generate fairly simple code that won't work. I've never used VA for anything real. (only toyed with it a bit) So, I'm certainly no expert on how it does or does not work.

  • Can't tell if all LEDs is flashing. What if Yes? What if Not? The equipment is already at the clients house. I will try all the solutions tomorow. The deadline is also tomorow. So I need to prepare for every case of trouble.

    We'll if the IR LED's on the master are not flashing then no IR is being sent out. If the LED flashes then the wrong command is being sent out (if the device doesn't do what you want).

    If you change the code to
    Define_Constant
    PWR_OFF = 9 // or the IR Command in the IR file for Power Off
    
    TO[dvCD5, PWR_OFF] // IR device5 is off
    TO[dvCD3, PWR_OFF] // IR device3 is off
    TO[dvCD2, PWR_OFF] // IR device2 is off
    TO[dvCD6, PWR_OFF] // IR device6 is off
    TO[dvCD4, PWR_OFF] // IR device4 is off
    TO[dvCD1, PWR_OFF] // IR device1 is off
    
    

    Do the devices all turn off.

    This obviously doesn't solve the problem of your RS232 device. But it would point the finger at the VA code.
  • Thanks guys!

    VA generated a code even with feedback, as if IR could do that. The code for rs232 and IR devices seems similar. No logic. Thats why I had to edit it a lot.

    Well, if any of solutions would not work, I will make a Netlinx to reboot every time after system is off.

    When the question: How to output popup if the panel online?
    Is it correct:

    channel_event[dvTP]{ // dvTP1 = 10001:1:0
    ONLINE{
    IF (vacb_system = 0) // system is off
    {
    SEND_COMMAND dvTP1, '@PPG-systemStart'
    }

    }
    }
  • no that will not work as you have this as a channel event - you need a data event.

    Also your syntax is wrong but I assume that is just a typo!
  • would it be correct? If no, could you help me with an example?

    data_event[dvTP]{ // dvTP1 = 10001:1:0
    ONLINE{
    IF (vacb_system = 0) // system is off
    {
    SEND_COMMAND dvTP1, '@PPG-systemStart'
    }
    }
    }
  • Spire_JeffSpire_Jeff Posts: 1,917
    I wonder if the TO is causing the problem. I am not sure why they work fine the first time, but not any subsequent time, but when dealing with IR, I generally prefer to do:

    send_command dvIR,"'SP',nChanNum";

    This allows me to adjust the ON and OFF timing of the IR pulses for each device independently. Some devices require longer ON times to receive the code. Some devices don't like seeing commands too quickly and need the OFF time to be a little longer.

    Also, if all of these devices are in the same rack, are you positive that the emitters are not causing interference with each other?

    One thing you could try is to delay things a little and see if things might be getting overloaded. (Again, no idea why it works fine the first time, and no other time.)

    I see that you are sending everything to vdvDevice. Can you post your device declarations? Also, are you using modules to control the devices, or are you directly controlling the IR ports?

    Jeff
  • The solution was to rewrite all IR processing part. The VA generated code so all the IR processing goes thro' the modules. AMX support recomended me to get rid of the those modules and send IR commands directly to ports. Seems the ploblem is solved.
  • ericmedleyericmedley Posts: 4,177
    The solution was to rewrite all IR processing part. The VA generated code so all the IR processing goes thro' the modules. AMX support recomended me to get rid of the those modules and send IR commands directly to ports. Seems the ploblem is solved.

    " If you want something done right you have to do it yourself "

    ~ Yosemite Sam
  • Oh dear, does this mean VA can't even create code for IR devices that works?
  • DHawthorneDHawthorne Posts: 4,584
    Jimweir192 wrote: »
    Oh dear, does this mean VA can't even create code for IR devices that works?

    More than likely because they put fake feedback into the IR portion. I've always thought that was a bad idea. If the device doesn't tell you it's state, it's always a gamble to assume it's doing what you last sent.
  • jjamesjjames Posts: 2,908
    The solution was to rewrite all IR processing part. The VA generated code so all the IR processing goes thro' the modules. AMX support recomended me to get rid of the those modules and send IR commands directly to ports. Seems the ploblem is solved.

    I had decided not to post my original thought, but after reading this - I'll just say this: Your first mistake was to use VA.

    I do hope you learned something though, but not from VA.
  • jjames wrote: »
    I do hope you learned something though, but not from VA.

    I sure did :)
    Anyway, everything is good with the good ending.
  • rynandorynando Posts: 68
    DHawthorne wrote: »
    More than likely because they put fake feedback into the IR portion. I've always thought that was a bad idea. If the device doesn't tell you it's state, it's always a gamble to assume it's doing what you last sent.

    This is all too true. I've spent a lot of time "repairing" other people's programs where a lot of effort was spent trying to fake feedback on IR devices. IMHO trying to simulate feedback on IR devices almost always blows up in your face.

    R
  • some thoughts

    I also think the issues could be related to the use of the TO command, The TO command is used to activate a channel or variable for as long as the corresponding channel of its PUSH statement is activated.
    try replacing it with a PULSE command this will pulse the ir command for .5s (unless you have used a SET_PULSE_TIME command to change the default pulse time to something other than .5s)

    One other note I had a similar issue years ago with an axcent 3 based system and I discovered that although the unit had 6 IR ports it could only send 2 ir pulses at the same time, I solved the problem by staggering the timing of the IR pulses. I hope this helps


    Erik
Sign In or Register to comment.