LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problems with a PCI-7344 motion controller

Hi all,
I've run into a weird problem with a NI PCI-7344 motion controller, where I
have a program that provides the motion control for my program that works
reasonably well, but when I make minor changes gets motion errors. The changes
are not specifically to the motion parts, just changing a couple of globals
that provide communication with another part of the program (and another piece
of hardware). The errors I get indicate that I am trying to enable limits
switches at the wrong time in my program. I will add that I do not get any
errors when I go through the program in debug mode
Tnx,
P.W.Monroe
0 Kudos
Message 1 of 4
(2,954 Views)
You may be having what is the major reason not to use global variables - a race condition. Without seeing the program, it's impossible to tell but execution highlighting and single step mode changes the way the program executes and you would'nt necessarily see the problem. You might want to rethink your program design and use a different technique. Good luck.
Message 2 of 4
(2,954 Views)
The portion of my program that gets the errors uses the "Flexmotion" Find Home
and Find Index routines, which are built into the 7344 controller. In the
exampes for using these VIs, they are followed by a loop that has a VI that
monitors the status of these VIs for completion, both move complete and Home or
Index Found. The globals that I mentioned are being used to terminate the loops
if an error condition occurs elsewhere, and do not cause the program to do
anything other than terminate looking at the status and then go into a wait
loop. It crashes when it goes into the loop when I substitute a different
global, which is baffling to me, as they aren't triggering something that would
result in a race condition.
0 Kudos
Message 3 of 4
(2,954 Views)
I totaly agree with the previous answer. Most probably what is happening is a timing issue whey you are trying to access the hardware. maybe one data transfer is in process to the board at the same time that you are trying to activeate ythe limit switches. Make sure that you are not trying to read and write to a global at the same time from two pieces of code running in parallel. Also try to protect the access to your hardware using semaphores or occurrences.
0 Kudos
Message 4 of 4
(2,954 Views)