Hi,
I built a VB.NET application that bridges the communication between a Fanuc Robot and a Plasma cutting unit. The way the application works is to wait for the robot to turn on a signal and fire an event in the main form (which is an MDI form BTW). This in turn opens a dialog from which then does the serial port write to the plasma and then reads to make sure the commands were accepted. The problem I had was that there is another screen the user can open which reads current status data from the plasma unit and populates a form (voltage, pressures, error codes, etc.). I am using a timer loop and a background thread with Invokes to populate these fields. When this screen is up, however, the user can still fire the signal from the robot to activate the dialog from to transmit the data. This causes both threads to try an access the serial port simultaneously. I am currently using a bool variable to let each thread know that the other is currently not using the port, but am not sure that this is the best way to handle this situation. Any thoughts would be appreciated.
Thanks,
Luke
I built a VB.NET application that bridges the communication between a Fanuc Robot and a Plasma cutting unit. The way the application works is to wait for the robot to turn on a signal and fire an event in the main form (which is an MDI form BTW). This in turn opens a dialog from which then does the serial port write to the plasma and then reads to make sure the commands were accepted. The problem I had was that there is another screen the user can open which reads current status data from the plasma unit and populates a form (voltage, pressures, error codes, etc.). I am using a timer loop and a background thread with Invokes to populate these fields. When this screen is up, however, the user can still fire the signal from the robot to activate the dialog from to transmit the data. This causes both threads to try an access the serial port simultaneously. I am currently using a bool variable to let each thread know that the other is currently not using the port, but am not sure that this is the best way to handle this situation. Any thoughts would be appreciated.
Thanks,
Luke
Comment