LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Make a Mirror Move indefinitely

 

Unfortunately, I have lost the laser on the camera and i cannot reset it remotely. I am however woking an a TCP vi that will allow me to have free control of the picomoters motion. 

 

The vi needs to be able to make the picomotors move indefinitely until the button is released then an AB command is sent which will then abort the motion. 

 

I have had a go at this, am i on the right lines. I do see an error appear eventually

LabVIEW: (Hex 0x38) The network operation exceeded the user-specified or system time limit. 

 

Does anyone have any suggestions to how I can achieve this.

 

Best Wishes 

Andrew

0 Kudos
Message 1 of 11
(3,964 Views)

That will not work like you expect it to do. Think Dataflow. The moment you press on a button, "Mirror 1" and "Mirror 2" has already been read by LabVIEW, the evaluation inside your event structure will always yield false. so you start the motor and immediately after that stop it again.

 

I suggest to send a command inside each case of the event structure and also add a combined event for "Mouse Up" of all 8 buttons:

JensG69_0-1627560747109.png

JensG69_1-1627560820737.png

 

As to your time-out case, I know nothing about the protocol. Might be that the answer to your command 1MV- is not 4 bytes long.

 

Regards, Jens

Kudos are welcome...
0 Kudos
Message 2 of 11
(3,950 Views)

Hi Jens

 

Thank you for the quick reply, I will try this and see how I get on. I will let you know 🙂 

 

Best Wishes 

Andrew

0 Kudos
Message 3 of 11
(3,944 Views)

Hi Jens

 

I tried your suggestion and and I get the following behaviour:

1) vi does nothing until I press a button (this is okay)

2) vi executes move (I think, I cannot see if they move as I am working remotely)

3) It then takes me back to the abort case and aborts the motion 

4) it then recycles the last motion command. 

 

I don't want it to recycle a command, what can I do to achieve this, I tried adding a "wait for front panel activity" but this did not work

 

Best Wishes

Andrew

0 Kudos
Message 4 of 11
(3,927 Views)

It's not entirely clear what the various commands perform. However, I think that event [1] should be "Mirror 1.UP":"Mouse Down".

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 5 of 11
(3,919 Views)

Hi Paolo

 

The MV command means move indefinitely and the the AB command aborts the motion, the number and +/- dictates the motor number and the direction of movement (+= positive and -= negative).

 

 

Best Wishes 

Andrew 

0 Kudos
Message 6 of 11
(3,915 Views)

Why did you change to "Value Change Events"? Why did you change the "Mechanical Action" of your buttons in comparison to your first upload?

 

Stick with "Latch until Released", send the corrent move command on "Mouse Down" event of one of the buttons, send a AB command on the mouse up event.


Regards, Jens

Kudos are welcome...
0 Kudos
Message 7 of 11
(3,904 Views)

It's wrong to use Value Change and Mouse Up, since the two events are generated almost concurrently.

Take into account that, for LEFT and RIGHT, no event is triggered (I mean in your code) when you click on the buttons.

Just replicate the logic of UP and DOWN.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 8 of 11
(3,898 Views)

On the other side, if you move the mouse pointer away from the button before releasing the mouse, the Mouse Up event is not generated.

I suggest you to define the buttons operation as Switch Until Release: this will allow you to receive two Value Change events, one (with Value True) when you click on the button, the other (with Value False) when you release the mouse. Check the NewVal output in the event case to decide whether to activate or stop the motor. I assume you want to activate the movement in synch with the button LED (LED on: move; LED off: stop).

Also, add a Value Change for the Stop button to terminate the program immediately.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 9 of 11
(3,887 Views)

Hi all

 

Thank you for the reply, I will try these and let you know how I get on. I will test them with the mirrors when I get access to them again. (I have had a noise complaint) so I will try again when I am in the office.. 

 

Best Wishes 

Andrew 

0 Kudos
Message 10 of 11
(3,882 Views)