Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #21 (permalink)  
Old 04-23-2009, 07:42 PM
Junior Member
 
Join Date: Mar 2009
Posts: 5
Default

OK, I kind of got it working. The relay expects hex commands, so am using the \x escape char to send what I need.

commx.writeStr("\xFE\x01");

That turns the relay on. Cool beans!

However,
commx.writeStr("\xFE\x00");

Doesn't turn it back off, as it should...

254,1 to turn it on
254,0 to turn it off

Can't figure it out...
Reply With Quote
  #22 (permalink)  
Old 04-23-2009, 07:54 PM
Junior Member
 
Join Date: Mar 2009
Posts: 5
Default

Seems it may be the cport control not being able to send a 0.

Tech support told me: "However, I have seen some serial devices/software unable to send a value of 0, which can be problematic (a value of 0 is actually just an RS-232 start bit). "

So... cportX is not too good it seems. I am going to see if MSComm will work...

so lame... I thought I had this.
Reply With Quote
  #23 (permalink)  
Old 04-23-2009, 09:46 PM
Junior Member
 
Join Date: Mar 2009
Posts: 5
Default

OK, so while the control doesn't write the 0 if you use \x00, it will write it if you use StringStream like so:

Instead of this:
commx.writeStr("\xFE\x00");

You use this:
var ss = new StringStream;
ss.put('\xFE');
ss.put(0);
commx.write(ss);


Works a treat! Thanks to SwfKit's support for the answer! Really cool being able to turn on/off electrical devices from Flash!
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 09:34 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.