|
|||
|
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... |
|
|||
|
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. |
|
|||
|
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! |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|