I am developing a motion controller card for motor control.
Hardware: PCI general purpose IO card (on a PCI slot) with a Xilinx Spartan 2-200 FPGA
Software:
I developed the GUI using LabWindows/CVI. The GUI is supposed to display the current positiions and is also used to input new commands to the motor.
I have a ThreadFunction that has a TIME CRITICAL While loop (PID loop)
The FPGA provides a real time stamp along with all the motion parameters (eg position of encoders, status of limit switches etc).
On receiving this info the PC calculates the new value of the PID signal and downloads it to the FPGA.
Problem that I am facing:
I am communicating with the GUI by simply updating the value of the GUI controls, using a simple counter to space the GUI updates. I also read the relevant input values from the GUI at the same time.
This method is not working because any GUI activity disrupts the time critical loop, and the system becomes unstable.
cncgui.c
{
ThreadFuntion ()
{
while
}
}