Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA and ActiveX conflict

Solved!
Go to solution

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.

 

BF

0 Kudos
Message 1 of 6
(5,062 Views)
I don't believe that it is visa in conflict with activeX but several other problems like race conditions are possible.
Show the code, add it as attachment and wait for comments.
greetings from the Netherlands
0 Kudos
Message 2 of 6
(5,047 Views)

Hi,

    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.

Thanks,

BF

   

0 Kudos
Message 3 of 6
(5,036 Views)
Solution
Accepted by bsf

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!

greetings from the Netherlands
Message 4 of 6
(5,024 Views)
Thank you. Rearranging so that the Thorlabs ActiveX control was not running in parallel with the VISA serial vi's appears to have fixed the trouble. In the full version of my program I had also been using Registered Event Callbacks to monitor the Thorlab controller. I had to take those out to get the program to work. They were only a convenience for me and I can live without them. Thanks, BF
0 Kudos
Message 5 of 6
(5,000 Views)

good to hear.

and good luck

greetings from the Netherlands
0 Kudos
Message 6 of 6
(4,996 Views)