Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 03-13-2006, 10:47 PM
Junior Member
 
Join Date: Feb 2006
Posts: 12
Default Re:Serial Port communication using SWFKit

thankyou for all the support.
I had to use Virtual Machine to install windows 98 and I ran the software
on it again and it worked.

the problem i found was I was not ticking the standalone program option
and it was would work fine on windows xp but not on windows 98, but after i
ticked the option it worked on both just fine.

I am on my way to creating a nice application with serial port in flash.

Thanks alottttttt
Reply With Quote
  #12 (permalink)  
Old 03-14-2006, 11:03 PM
Junior Member
 
Join Date: Feb 2006
Posts: 12
Default Re:Serial Port communication using SWFKit

hi again...

my program is working fine,
basically the code and everything is unchanged from the sample
program QM that is available on the website.

Now I want to save a stream of incoming text response from com port.
I have a micro controller attached to the com port,
I send it a chck command and it reponds with a stream of text for e.g
"AH BH CH DH EH FH GH HH"
I want to be able to capture this whole string so I can further write code in flash to process this information.

> on a side note / although the qm program works, but in the response text box I cannot see the text properly /complete.

For e.g. original response is AMOUNT OF T: 04
in the reponse textbox i can only read "T:04"
this is not issue of textbox being too small to handle the whole text...

//another side note: In Qm sample program is there specific Baudrate being used ? / if so what is it / I want to have a baudrate of 9600.

thanks..
waiting for reply.
- sz
Reply With Quote
  #13 (permalink)  
Old 12-29-2007, 11:55 PM
Junior Member
 
Join Date: Dec 2007
Posts: 5
Default Re: Serial Port communication using SWFKit

so we should be able to use the serial port for a possible remote control app? anyone tried something similar
Reply With Quote
  #14 (permalink)  
Old 09-25-2008, 03:43 AM
Junior Member
 
Join Date: Jul 2008
Posts: 2
Default Re:Serial Port communication using SWFKit

Quote:
Originally Posted by SWFKIT
E.g. The "querymodem" script in the "querymodem" sample, the last line is
Code:
commx.writeStr(command);
You can change it to
Code:
var stream = new StringStream;
stream.write(command);
commx.write(stream);
The "stream" object contains the binary data and is sent by the "write" method.

Similarly, in the "initialize" script, the "onRXChar" event handler is
Code:
var str = this.readStr(count);
FlashPlayer.setVariable("response.text", str);
trace(str);
It can be changed to
Code:
var stream = this.read(count);
FlashPlayer.setVariable("response.text", stream.toString());
trace(stream);
The "read" method returns a stringstream object contains binary data.
But somehow the stream length not equal to count length.
Code:
var stream = this.read(count);
FlashPlayer.setVariable("response.text", stream.toString());
trace(stream);
It can be changed to (Example count -> HEX 2,39,47,C8,3,42,35)
Code:
var HexString;
var DecString;
commx.onRxChar = function (count) {
  var getStreamByte = this.read(count);
  streamByte = getStreamByte;
  for(i=0; i<streamByte.length; i++) {  
    var Dec = streamByte.get();      //
    var Hex = Dec.format("%X");     //
    HexString = HexString + "," + Hex; //
    DecString = DecString + "," + Dec; //
  }
  FlashPlayer.setVariable("response.text", HexString + "\n");
  FlashPlayer.setVariable("response.text", FlashPlayer.setVariable("response.text") + DecString + "\n");

}
Reply With Quote
  #15 (permalink)  
Old 09-25-2008, 03:58 AM
Junior Member
 
Join Date: Jul 2008
Posts: 2
Default Re: Serial Port communication using SWFKit

Which ocx is better run on WindowsXP/Windows2003/Windows Vista?

cportx.ocx or mscomm32.ocx.

In my application use cportx.ocx run on WindowsXP a crack and change to mscomm32.ocx now!

Both is free.

Reply With Quote
  #16 (permalink)  
Old 02-09-2009, 11:08 PM
Junior Member
 
Join Date: Jan 2009
Posts: 7
Default After process is finished

HI,
How can I call a function, when the
commx.writeStr(command);
is executed, and the device is fully finished the process?

I see the ComX Help but not found the Answer.

Thnx
Reply With Quote
  #17 (permalink)  
Old 02-10-2009, 08:56 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,000
Default

The help file says that "Call WriteStr function to write Str variable to output buffer. The function does not return until whole string is written or timeout elapses.". So you can call your function just next to the previous "writeStr" call.
Reply With Quote
  #18 (permalink)  
Old 02-10-2009, 10:04 PM
Junior Member
 
Join Date: Jan 2009
Posts: 7
Default

Ok, I understand.
I use a USB switcher and when switching a relay on it, I just wait for the process, and then call a function in AS script (check the status and display the results).

Now my solution a setInterval() process.
It's working, but not too elegant.

I was think maybe use some function like Shell.runandwait()-for external processes, or some onEndPrinting() in printing.

Anyway, Thank You to Your answer!
Reply With Quote
  #19 (permalink)  
Old 04-02-2009, 03:14 PM
Junior Member
 
Join Date: Mar 2009
Posts: 5
Default motor/pump/light control?

Using the com port controller with SWFKit, might it be possible to turn on a switch for a given interval? Anyone know where I might start?
Reply With Quote
  #20 (permalink)  
Old 04-02-2009, 05:32 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,000
Default

It depends on the programming interface of the motor/pump/light. Can you give more details? Thanks.
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 08:14 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.