Read actual positions from Newport stage controller instrument ESP302
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Aram Zeytunyan
le 19 Déc 2024
Commenté : Aram Zeytunyan
le 3 Jan 2025
I have a Newport stage controller ESP302. I am able to successfully connect to the controller using the following line:
obj1 = tcpclient("192.168.254.254",5002,"ConnectTimeout",10);
I am also able to write commands to move the 3x stages connected to the controller to the desired positions. For example, to move stage 1 to the absolute position 75, I use the following:
writeline(obj1,'1PA75');
However, when I try to read the actual positions of the stages, I have to run the same query several times:
query(obj1,'1TP');
query(obj1,'1TP');
query(obj1,'1TP');
The first time it gives me 0, the second time it gives me the position of one of the other stages, and only the third time it gives me the actual position of Stage 1.
Looks like the problem is specific to Matlab, as the same commands work perfectly the first time when using the Newport application GUI. This is a problem as I need to read the stage positions quickly when the stages are in motion.
0 commentaires
Réponse acceptée
Paul Lambrechts
le 23 Déc 2024
Hi, I am not sure if this will help but I notice that you are using the old "query" command in combination with the new "tcpclient" object.
Try the new "readline" command instead: https://nl.mathworks.com/help/instrument/tcpclient.readline.html
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur MATLAB Support Packages dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!