RE: Pokesfr and the Program Counter
Hello Everyone,
Long time no see!!
I'm in the middle of programming a 14M2 to operate a robotic trailer. In essence, its for a Uni Group project involving an NI DANI robot, and a Lynxmotion Brat and Tri-Track, ohh, and a Barbie (Don't ask)
the NI DANI needs to be able to control a trailer, which will allow the Lynxmotion Tri-Track to get on and off (as autonomously as possible).
I have created code for the 14M2 that connects to an AXE024 for servo control (Tailgate of the trailer) in normal operation, this follows a normal (and simple) sequence of opening the gate, unloading the Tri-Track, waiting, waiting for sensor information to detect the Tri-Track has come back onto the trailer and is waiting, then closing the tailgate and sending a pulse back to the NI DANI which goes off and does its stuff, waiting for another command to repeat the process...
However, I have created an interrupt for the eventualilty that, during the project Scenario, the group decides to unload the Tri-Track, and for whatever reason, leave it off the trailer and use the NI DANI seperatly.
My problem is, the interrupt (as it should) returns where it was before being called, for me, this isn't what I want.
My immediate reaction was 'Surely there must be a way to alter the program counter' to either jump the program to the beginning performing in essence, a reset, or to jump back to a certain section of the code.I thought this will be easy-ish (I understand not the best thing to do, but it should work), However, I have found information about pokesfr to enter the special function register, but no information as to the whereabouts of the PC itself, I have seen snipets using poke to 'reset' but they don't simulate to well, and As I'm not in a position to say that its correct or not, I thought it best to ask.
Any ideas?
Cheers,
Owen.
Hello Everyone,
Long time no see!!
I'm in the middle of programming a 14M2 to operate a robotic trailer. In essence, its for a Uni Group project involving an NI DANI robot, and a Lynxmotion Brat and Tri-Track, ohh, and a Barbie (Don't ask)
the NI DANI needs to be able to control a trailer, which will allow the Lynxmotion Tri-Track to get on and off (as autonomously as possible).
I have created code for the 14M2 that connects to an AXE024 for servo control (Tailgate of the trailer) in normal operation, this follows a normal (and simple) sequence of opening the gate, unloading the Tri-Track, waiting, waiting for sensor information to detect the Tri-Track has come back onto the trailer and is waiting, then closing the tailgate and sending a pulse back to the NI DANI which goes off and does its stuff, waiting for another command to repeat the process...
However, I have created an interrupt for the eventualilty that, during the project Scenario, the group decides to unload the Tri-Track, and for whatever reason, leave it off the trailer and use the NI DANI seperatly.
My problem is, the interrupt (as it should) returns where it was before being called, for me, this isn't what I want.
My immediate reaction was 'Surely there must be a way to alter the program counter' to either jump the program to the beginning performing in essence, a reset, or to jump back to a certain section of the code.I thought this will be easy-ish (I understand not the best thing to do, but it should work), However, I have found information about pokesfr to enter the special function register, but no information as to the whereabouts of the PC itself, I have seen snipets using poke to 'reset' but they don't simulate to well, and As I'm not in a position to say that its correct or not, I thought it best to ask.
Any ideas?
Cheers,
Owen.