LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA write synchronicity

Hi,

I am using a VISA write function to write commands to a controller. The controller then sends them to three stages which move to the positions indicated by the commands. Normally, the movement of the stages cannot be interrupted with a new command. Basically, if I want to send the stages to a certain position, but while they're moving I change my mind and send in the command for a different position, the stages will have to first reach the first position, and only after a full stop move on to the new position. This is normal and determined by the controller. However, there is a command "abort" which should stop the stages in their tracks instantly. I have tried this command from a windows hyperterminal, and it works. However, when I try to implement it in my labview program, it doesn't seem to get through to the stages, as they keep on moving until their final position. Since I know the controller will send through, I assume it is some sort of VISA synchronicity issue? If I run the program in slow motion(with "highlight execution" on), it sends the "abort" command all the way to the VISA write with "Ok"s all the way. So I can't figure out what the problem might be...

I am attaching the vi. What I described above mostly happens in Frame 1 of the innermost sequence structure.

A related question: I can use "Ctrl+c" instead of abort, but I don't know what the syntax for this command is in ASCII (string).

0 Kudos
Message 1 of 2
(2,380 Views)

I think the only "synchronicity" problem is the way you've written your program. Parts of it (i.e. the frame with your abort) are hard to read with hidden wires and other bad style elements but I think the big problem is that you don't fully understand how a sequence structure works. A sequence structure always executes in order and always executes every frame in the sequence. So, you may have a problem with dataflow where the command may not get executed when you want. It certainly can't be exeucted at any time. Instead of using sequences, you might want to look at using a state machine or state machine/event structure combination. There are shipping examples. You should also eliminate all of the sequence structures and use regular dataflow with the error in/error out connectors. In some places, you don't have any error checking at all. You coould also eliminate all of those "ASRL1::INSTR strings and use a single VISA resource name constat at the beginning of your program and pass it to other read/writes by using the dup VISA Resource Name output that all of the VISA functions have.

If you want the ability to abort the move at any time, put that in a separate while loop.

0 Kudos
Message 2 of 2
(2,371 Views)