How to generate output from .exe program via java robot keypress using matlab

조회 수: 2 (최근 30일)
ABDUL MANNAN
ABDUL MANNAN 2020년 7월 6일
편집: ABDUL MANNAN 2020년 7월 7일
hi sir, i want to run an external .exe program from matlab and want to generate output file from that program automatically. The .exe program generates output upon pressing F7 key. so i used java.awt.robot for pressing F7 key.
But the problem is that it doesn't press key when .nec is open it presses key after .exe program is closed. How can i make it able? thanks in advance
function APIrobot()
clear all; close all; clc;
import java.awt.Robot;
import java.awt.event.*;
robot = java.awt.Robot();
robot.delay(2000);
!phi150arm.nec %this is the external .exe program from which i want to generate output
robot.keyPress(KeyEvent.VK_F7);
robot.keyRelease(KeyEvent.VK_F7);
end
  댓글 수: 3
dpb
dpb 2020년 7월 6일
Don't know if that could be munged/used for purpose or not...
ABDUL MANNAN
ABDUL MANNAN 2020년 7월 7일
편집: ABDUL MANNAN 2020년 7월 7일
Thanks Sir for your reply. can this program press function key. i.e F7
if so then can you please guide me how to do this by source code. if possible

댓글을 달려면 로그인하십시오.

답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by