Read actual positions from Newport stage controller instrument ESP302
    12 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Aram Zeytunyan
 il 19 Dic 2024
  
    
    
    
    
    Commentato: Aram Zeytunyan
 il 3 Gen 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 Commenti
Risposta accettata
  Paul Lambrechts
    
 il 23 Dic 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 
Più risposte (0)
Vedere anche
Categorie
				Scopri di più su MATLAB Support Packages in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!