07-17-2006
11:59 AM
- last edited on
11-09-2025
03:14 PM
by
Content Cleaner
[broken link removed]
07-18-2006 10:51 AM
Hi Noah,
Your best bet here sounds like a state machine based architecture, which will allow your FPGA VI to handle the various conditions internally, without need to generate an external interrupt. IRQ's in the context of a LabVIEW program are sent from the FPGA to a Windows or Real Time host VI, where it is processed by the operating system and sent to the VI for processing. If the only control hardware on your robot is the FPGA board, then you won't need to explicitly generate these interrupts since there would be no computer with an operating system to receive them. Instead, if you have a state machine architecture (case structure inside a while loop, with a different case for each state and a shift register to store the next state), you can have the FPGA VI handle everything internally.
While we cannot develop your code for you, the basic structure for your algorithm could be as follows:
Move state- move towards target and check sensors for obstacle. If no obstacle, next state is move state. If obstacle 2 feet away, next state is Obstacle. If crash, next state is Crash. If target reached, next state is end.
Obstacle state- handle interrupt 1 code from algorithm (this will require multiple states). When done, set next state back to the move state
Crash state - handle interrupt 2 code (may require multiple states). Next state is move state.
End state - Done.
Of course, this is a highly simplified example, but you can see the basic structure. There are many examples of using a state machine architecture, including a design template that comes with LabVIEW that you can modify to suit your needs.