I'm trying to get a comm port working from a javascript using an
ActiveX control. The port is basically working where I can receive
input from the serial port. BUT - I can't seem to get the OnComm
event working so can receive the incomming characters async - any
ideas????
Thanks!
Roman
var MSComm1 = new ActiveXObject(" MSCOMMLib.MSCom m");
function onTextClick() {
view.beginAnima tion(doRotation , 0, 360, 500);
MSComm1.CommPor t = 1;
if (MSComm1.PortOp en == false)
{
MSComm1.Setting s = "57600,n,8, 1"
MSComm1.SThresh old = 1;
MSComm1.RThresh old = 1;
MSComm1.RTSEnab le = 1;
// MSComm1.InBuffe rSize = 1;
MSComm1.InputLe n = 1;
MSComm1.InputMo de = MSComm1.comInpu tModeText;
MSComm1.PortOpe n = true;
}
msg = "Test Message ";
// MSComm1.Output = msg;
msg = MSComm1.Input;
while(msg == "")
{
msg = MSComm1.Input;
}
alert(msg);
// MSComm1.PortOpe n = 0;
// MSComm1.AboutBo x();
}
function MSComm1_OnComm( ){
alert("onComm") ;
}
function doRotation() { mylabel.rotatio n = event.value; }
ActiveX control. The port is basically working where I can receive
input from the serial port. BUT - I can't seem to get the OnComm
event working so can receive the incomming characters async - any
ideas????
Thanks!
Roman
var MSComm1 = new ActiveXObject(" MSCOMMLib.MSCom m");
function onTextClick() {
view.beginAnima tion(doRotation , 0, 360, 500);
MSComm1.CommPor t = 1;
if (MSComm1.PortOp en == false)
{
MSComm1.Setting s = "57600,n,8, 1"
MSComm1.SThresh old = 1;
MSComm1.RThresh old = 1;
MSComm1.RTSEnab le = 1;
// MSComm1.InBuffe rSize = 1;
MSComm1.InputLe n = 1;
MSComm1.InputMo de = MSComm1.comInpu tModeText;
MSComm1.PortOpe n = true;
}
msg = "Test Message ";
// MSComm1.Output = msg;
msg = MSComm1.Input;
while(msg == "")
{
msg = MSComm1.Input;
}
alert(msg);
// MSComm1.PortOpe n = 0;
// MSComm1.AboutBo x();
}
function MSComm1_OnComm( ){
alert("onComm") ;
}
function doRotation() { mylabel.rotatio n = event.value; }
Comment