Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: sgsims on May 04, 2018, 09:18:18 AM

Title: Halt & Run Instruction (Which Takes Precedence)
Post by: sgsims on May 04, 2018, 09:18:18 AM
I have a program Code block that is receiving a Halt instruction and a Run instruction from code blocks that are located below it in the "Execution Order".

It looks like to me that the Run instruction takes precedence over the Halt instruction.  Am I understanding that correctly or is the behavior I am seeing due to where/how I have the RUN and Halt Instructions?

The Code block that is receiving both the Run and Halt instructions is 1st in execution order,  then comes the Code Block that is issuing the RUN instruction,  then lastly comes the code block that is issuing the Halt instruction.  So it looks like after working through that execution order when we come back up to the top of the scan I have a RUN and HALT command queued up for the same code block and the end result is that receiving code block is running not halting.

Obviously know I need to change something but would like to know a bit more about this so I can determine the best way to make the change.

Thanks
Title: Re: Halt & Run Instruction (Which Takes Precedence)
Post by: BobO on May 04, 2018, 09:53:31 AM
I have a program Code block that is receiving a Halt instruction and a Run instruction from code blocks that are located below it in the "Execution Order".

It looks like to me that the Run instruction takes precedence over the Halt instruction.  Am I understanding that correctly or is the behavior I am seeing due to where/how I have the RUN and Halt Instructions?

The Code block that is receiving both the Run and Halt instructions is 1st in execution order,  then comes the Code Block that is issuing the RUN instruction,  then lastly comes the code block that is issuing the Halt instruction.  So it looks like after working through that execution order when we come back up to the top of the scan I have a RUN and HALT command queued up for the same code block and the end result is that receiving code block is running not halting.

Obviously know I need to change something but would like to know a bit more about this so I can determine the best way to make the change.

Thanks

It should be "last one wins", but if you are executing both in the same scan you may be getting some weirdness due to edge transitions and the need for the program to run at least one scan to do its internal work. The short answer is "don't".