Hi, just wondering if anyone can help with this problem.
We are using the
USB 6501 to generate and acquire TTL signals, and already have some
componants working fine using this. We have two units which have motors which turn a swivel arm on each clockwise/ anti clockwise depending on
which line gets a high (if both lines are high the swivel arm stops
turning). On each unit is a slotted interrupter (SI) with a light breaking
diode, once the swivel arm turns and consequently breaks this, a signal is sent. One swivel arm will turn, and then depending on what's happening a vi this will be going into, it will either turn back to its original postion, or the second units swivel arm will turn ('change' on the sub vi).
We want the
swivel arms to stop turning as soon as a the signal from the slotted
interrupter goes high (we send a high to both motor lines then a low to both) but at the moment the arms continue turning for a short period of time which is not acceptable for our experiments as the arms are then positioned at a slight angle. Our program dosnt seem to be running fast enough to send a high to the swivel arm line soon enough once the slotted interrupter line goes high to stop the swivel arm turning when we want it to.
We tried using an event structure as this seemed like the fastest option available but this didn't seem to respond properly to the slotted interrupter 'high' event, although the boolean control was indicating true to send a high to the motor line (the subvi containing the event structure received a true from the main motor vi), true was not being sent to the 'DAQmx Write' in the event structure. We were then told that an event structure would probably not be useful for what we are trying to do as we're not manipulating the front panel so the event sructure would just keep waiting for an event to occur. We are now using case structures instead, and the vi is doing what it's meant to do, but still too slowly.
I attach the sub.vi (stop turn) and the vi (motor) and appreciate any advice on this. Once we have this working, all our equipment setup will be completed so really want to get it sorted!
Thanks in advance
George