alanmanson

Members
  • Posts

    4
  • Joined

  • Last visited

alanmanson's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I closed DAQFactory and reopened it. All my channel names start with Chn, so I have no variables with the same name. My sequence code is below: "ChnSystemEstop" is a channel that gets set or cleared when an emergency estop button is pressed on the system. The estop button is physically connected to a controller board that communicates with DAFactory over a serial connection. The controller board is polled for messages, which then sends a reply. systemEStopSignalled is a global variable which is used to stop the clear estop sequence being called unless an estop has been sent already. SystemEstopCmd is a sequence which sends an emergency stop request message to all parts of the system. SystemEstopClearCmd is a sequence which sends an emergency stop cleared message to all parts of the system. The four channels: ChnCell1Status[0], ChnCell2Status[0], ChnCell3Status[0], ChnFinalInspectionStationStatus contain the status value of the 4 parts of the system, the value 9 on the cells indicates that that particular cell is estopped, and the value 8 on the final inspection station indicates an estop, so we cannot send the estop message. I had all 4 of these channels in the watch window, so that I could see their latest value. ChnCell3Status[0] was at the value 9, yet it still went into the body of the if statement, which clearly asks for not equal to 9. This did not happen all the time but it did happen a lot at random. Hope that makes sense Could it be that I was writing a channel in another sequence while I was reading it here? Thanks //************************************************ while(1) if (ChnSystemEstop[0] > 0) if (systemEStopSignalled == 0) systemEStopSignalled = 1 beginseq(SystemEstopCmd) while(Sequence.SystemEstopCmd.Running) endwhile endif else // Try hardcoded numbers as we keep getting through if (systemEstopSignalled == 1) if ((ChnCell1Status[0] != 9) && \ (ChnCell2Status[0] != 9) && \ (ChnCell3Status[0] != 9) && \ (ChnFinalInspectionStationStatus[0] != 8)) systemEStopSignalled = 0 beginseq(SystemEstopClearCmd) while(sequence.SystemEstopClearCmd.Running) endwhile endif endif endif delay(0.01) endwhile return (NULL) //************************************************
  2. I have an if statement in a sequence, here is an example if ((channel1[0] != 9) && (Channel2[0] != 9)) DoSomething() endif I have at least one of the channels set to 9 and it is still getting to DoSomething(). What am I missing? Is there some compiled cache somewhere that needs to be cleared and recompiled?