Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW keeps on crashing whenever I execute my motion control program

I've written a program to control a THORLABS 50mm translation stage with an incorporated optical encoder using an activeX control in labVIEW 7.1, the problem is - everytime I execute it labview crashes. The motor controller is a THORLABS BSC103 (3-channel)

This stage is going to be used to postion a lens for a laser so I have included in the program an option to calibrate the encoder the first time the program is run, then a rough scan across the stages' range to determine the rough area where the laser is focused, this is stopped manually by the user when this area is reached. The next part allows the user to jog forwards and backwards to focus the laser more finely and then there's a manual stop control when the best focus is acheived.

I know my program gets as far as verifying communication with the hardware but unfortunately i can't tell which part is causing the crash.

So far I've tried:
 
1) Using probes, but for some reason they are greyed out when i right click a wire so I can't do that
2) The MG17logger control to display the event log in the front panel, except that when it crashes that no longer displays

The stage does move when I execute the program but I have no idea what it's doing, the first thing it should do is move home whether 'calibrate' is selected or not and it moves so slowly (you can't tell unless you touch it that its moving at all) I doubt its functioning correctly.

I've attached my code for inspection in case anyone can spot something I've done thats crashing it.

Thanks

Jen
0 Kudos
Message 1 of 4
(3,599 Views)
The code is probably crashing in the activeX calls.  Put probes in the error clusters between each invoke/property node to see which node is crashing.  I would suspect possibly a timing issue.  You could put waits between the nodes and see if this solves the issue, aslo check with the activeX supplier to see if there are any known issues.  The activeX is sort of a black box and when it crashes Labview will go down too.
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 4
(3,591 Views)
Jen,

the reason why you can't use probes or highlight mode is the fact, that debugging is disabled for your vi. Please go to the VI properties >> Execution and checkmark the Allow debugging checkbox.

Kind regards,

Jochen Klier
National Instruments
0 Kudos
Message 3 of 4
(3,580 Views)
Hey, since my last post I did manage to get it to home and move forwards without crashing but the program is currentely on hold as the encoder has gone off to have its cables cut as the encoder cannot go in the vacuum chamber.

Jechen I realised that because i had the VI running in re-entrant mode debugging was disallowed, i've changed that now and once i get the encoder back I will continue to debug the rest of the program like you suggested Paul.

Thanks for your help, both of you!

JenRi 
0 Kudos
Message 4 of 4
(3,568 Views)