07-29-2021 06:47 AM
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
07-29-2021 07:15 AM - edited 07-29-2021 07:35 AM
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:
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
07-29-2021 07:25 AM
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
07-29-2021 08:06 AM
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
07-29-2021 08:28 AM
It's not entirely clear what the various commands perform. However, I think that event [1] should be "Mirror 1.UP":"Mouse Down".
07-29-2021 08:37 AM
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
07-29-2021 08:54 AM - edited 07-29-2021 08:55 AM
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
07-29-2021 09:00 AM
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.
07-29-2021 09:17 AM
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.
07-29-2021 09:26 AM
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