Posted by panarobo in SWF Studio V3 on Feb 26 2016, 10:36 am

I am having problems writing hex data over a serial port. When I manually enter "ff 02 21 03 e8 d5 09" on com4 in hex with my serial logger I can see my device respond. Then i do it with SWF studio, I can see the com open, and the same command "ff 02 21 03 e8 d5 09" entered, but no response from my device.

Again Tim, give me an email address and I will donaten via paypal, pay whatever, I just need a means to pay for this service. thanks.
My code (as2)

Frame 1

ssCore.init(); 
ssDefaults.synchronousCommands = true;


Frame 2

ssCore.SerialIO.open({port:"com4", baudRate:"115200", parity:"none", dataBits:8, stopBits:1});
ssCore.SerialIO.setNotify({event:"onInfoReceived"}, {callback:onInfoReceivedHandler});

function onInfoReceivedHandler(ret_obj, cb_obj, err_obj)
{
    if (ret_obj.success)
    {
        ssDebug.trace("info: " + ret_obj.result);
    }



Frame 3

var r:Object = ssCore.SerialIO.writeBinary({data:"ff022103e8d509", timeout:1000});
stop();


My comm port logger is manually setup for com4 , 115200, databits 8. It is also closed (just logging) when I am trying to use SWF.

thanks again!

attachments: datalogger_manual.jpg   datalogger_swf_studio.jpg  


Posted by northcode in SWF Studio V3 on Feb 26 2016, 01:14 pm

The first thing I would do is make sure the call to SerialIO.open worked. If that's failing then nothing else is going to work.


var r = ssCore.SerialIO.open({port:"com4", baudRate:"115200", parity:"none", dataBits:8, stopBits:1});

if (!r.success) 
   ssDebug.trace("open failed: " + r.Error.description);


Posted by panarobo in SWF Studio V3 on Feb 26 2016, 01:45 pm

Thanks Tim.
I can see the com port open and close (after I close swf) in the logger.

I used your code (with a tiny bit added)

var r = ssCore.SerialIO.open({port:"com4", baudRate:"115200", parity:"none", dataBits:8, stopBits:1});
stop();

if (!r.success) {
ssDebug.trace("open failed: " + r.Error.description);
}
if (r.success) {
play();
ssDebug.trace("test");
}


All I get is "test" in the trace window, which is what I would expect.

Thanks for the help!


Posted by northcode in SWF Studio V3 on Feb 26 2016, 03:25 pm

Here's an AS2 test app I use with an old laptop running a DOS (yes, DOS) terminal application I wrote in C MANY years ago :)

attachments: serial.fla  


Posted by panarobo in SWF Studio V3 on Feb 26 2016, 11:22 pm

Thanks Tim. I did not have the ssCore.SerialIO.read. So now I am getting somewhere! The next problem, I am getting the binary data back, but not all of it.

I am getting FF0E21 from SWF studio.
The Comm logger is showing-
[26/02/2016 23:18:08] Read data (COM4)
ff 0e 21 00 00 45 31 31 30 31 31 31 31 2e 30 30
30 7d 3c 57 75

Am I missing something? Anything I can do to get all the data?

Thanks again!


Posted by northcode in SWF Studio V3 on Feb 27 2016, 04:14 am

What version of the SerialIO plugin do you have?

Version 3 is the latest and has a fix for reading binary data with embedded 0's!

I've attached a copy of the latest version of the SerialIO plugin for you.

attachments: serialio.zip  


Posted by panarobo in SWF Studio V3 on Feb 27 2016, 07:51 am

Man, I am so close I can taste it. Sorry to ask so many basic questions!

With the new pulgin I now get
Swf- FF0E2103C8680806A06D0806700400008404000030
Comm Reader - [27/02/2016 07:32:19] Read data (COM4)
ff 0e 21 00 00 45 31 31 30 31 31 31 31 2e 30 30
30 7d 3c 57 75

Looks like it all goes south on first set of 00 00? Again thanks for the help!!!


Posted by panarobo in SWF Studio V3 on Feb 29 2016, 11:30 am

Sorry, good chance I did not put enough details in my last post-

With the Comm reader I am watching SWF make requests with serial I/O over comm port 4. When swf makes the request, I see-
The comm reader record the response of-
ff 0e 21 00 00 45 31 31 30 31 31 31 31 2e 30 30
30 7d 3c 57 75

But SWF shows the respone of -
FF0E2103C8680806A06D0806700400008404000030

I can tell the comm reader is correct, because I can see my RFID tag info when I decode it (I communicating with an RFID reader). Both the Comm and SWF start the same, "FF0E210", but the rest is different in SWF.

Comm data dump---
[27/02/2016 15:13:45] Written data (COM4)
ff 02 21 03 e8 d5 09 y.!.eO.
[27/02/2016 15:13:47] Read data (COM4)
ff 0e 21 00 00 45 31 31 30 31 31 31 31 2e 30 30 y.!..E1101111.00
30 7d 3c 57 75 0}[28/02/2016 20:06:21] - Close port COM4


Am I doing something wrong?

Thanks


Posted by northcode in SWF Studio V3 on Feb 29 2016, 02:27 pm

I will hook up my serial I/O test rig and send the same binary data your RFID reader is sending and figure out where the problem is. It could be the plugin.

Just out of curiosity, what RFID reader are you using? I wrote a plugin for someone else that works with OBID readers from FEIG ELECTRONIC.


Posted by panarobo in SWF Studio V3 on Feb 29 2016, 03:44 pm

Thanks again for all the help! If it at all helps, all of my tests have multiple 0000's in them and from there on the data seems to be different between swf and the comm reader. Length of characters seems to be the same though.

I am trying to use thingmagic. Its an UHF Rfid reader. Nice reader, but a little too advanced for me... thanks to your software, I have a chance of getting through it...

If in the end we need to talk about custom plugins to make this work, let me know....


Posted by northcode in SWF Studio V3 on Mar 07 2016, 04:12 pm

Confirmed. There is a bug reading binary data with embedded 0's in version 3 of the SerialIO plugin. It's been fixed in version 4, attached.

attachments: serialio.v4.zip  


Posted by panarobo in SWF Studio V3 on Mar 09 2016, 03:55 pm

And it works amazing!!!! Thanks!!!!