I am trying to create a labview program which controls two different pieces of equipment. One is a Thorlabs linear stage which is an ActiveX device connected over a USB connection, and the other is a brushless motor controller connected over an RS-232 connection (using VISA). I have separate programs which work with each device separately. However, when I try to write a single vi which does both, the program fails. Sometimes, the connection to the linear stage fails, and I get a message saying that the connection to the USB connection has been lost. Sometimes, the program freezes and I have to restart Labview. Could the two different connections be interfering with each other? If that is a possibility, is there any way to check to confirm or rule out that possibility? And if so, is there a way to keep them from interfering with each other. The two devices are from different companies, so I'm not likely to get any help from either of them.
Thanks for any help anyone can provide.
Solved! Go to Solution.
Here is a simplified version of my code. The Thorlabs controller is a BSC201 and I am using their ActiveX module. The brushless motor controller is a RoboteQ MBL1330 which is connected over a serial line. The llb contains a program (example.vi) and a vi to write to the MBL 1330 (roto-write2.vi).
The first frame is mostly a collection of parameters which need to be sent to the MBL1330. There is also some commands for the BSC201.
The second frame is a while loop with an event case inside. The buttons on the front panel which trigger the events send a small subset of commands to either the BSC201 or the MBL 1330. The Wait button is used to tell the program whether to wait for a move command to the BSC 201 to finish before returning control to the front panel, or to return control as soon as the command is sent to the BSC 201.
The program behaves inconsistently. It occasionally works, and then occasionally the BSC 201 will send error messages. Sometimes it will freeze up and I would have to restart Labview. The inconsistent behavior is what suggested a conflict to me, though I had not thought of a race condition.
I would appreciate it if anyone had any suggestions on how to troubleshoot this problem.
This looks good but I suggest to use also error in/error out and take the active x also connected with error in/out and not parallel as it is now.
It takes a bit more time but sure no conflicts should occur.
sequence frames have the same function as sequencing by wiring!