Read actual positions from Newport stage controller instrument ESP302
5 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Paul Lambrechts
2024-12-23
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
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!