Source language: Translate to:

RS232

Questions about NeoBook PlugIns

Moderator: Neosoft Support

RS232

Postby DaveJ » Tue Apr 15, 2014 3:29 am

I know this question keeps coming up regarding an RS232 plugin but I thought the RS232 plugin from G.Turner would be great for my needs.
I have an RFID reader that has been designed to work with an Arduino but communicates using RS232 but only accepts hex values.

If I get Neobook to convert Hex to ASCII and then send its value as [#[value]] to the plugin it works for almost all characters other than 0x00 0x20 and 0x22

If I write the values to a text file and look at it through a hex editor, all the values are perfect. If I monitor what the plugin sends on the RS232 it misses or swaps values.
As I have no manual for the plugin GTComms I do not know if it has a way of accepting hex.

Are there any other RS232 plugins that I can purchase or is there a manual for the GTComms plugin?

Thanks

DaveJ
DaveJ
 
Posts: 90
Joined: Tue Dec 30, 2008 11:06 am

Re: RS232

Postby Danito » Tue Apr 15, 2014 9:44 am

Bunker escribió algo del tema
http://www.neobookeros.com.ar/?p=530
User avatar
Danito
 
Posts: 51
Joined: Thu Mar 11, 2010 7:07 pm

Re: RS232

Postby dec » Tue Apr 15, 2014 12:57 pm

Hello,

I know this is not the very best help you can found, but, when you hover the mouse around the plugin actions, you can view in the action's tip (bellow in the yellow information screen) the action's name, arguments and a little description. Probably you know that, but maybe not and you can take a look and figure out how to go ahead. When you hover the mouse around the plugin actions you can view something like this into the yellow information screen:

Code: Select all
ActionName "argument1,argument2,argument3" Action description


Where "argument1", "argument2", etc., contain the name of the required argument like "text so send", "number of port", etc.

On the other hand, even when some useful Delphi component exists in order to base certain NeoBook plugin on it, the truth is that I have no experience on RS232 development nor some kind of hardware in order to test. Both things which for sure increasing the numbers of hours required to try (we need several hours just to view if we can go ahead) to develop a plugin like that.
.
Enhance your NeoBook applications!
.
57 plugins, 1113 actions and 230 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: RS232

Postby DaveJ » Tue Apr 15, 2014 2:12 pm

Thanks for the reply David/Danito
I have worked out most of the plugin commands but the fact when I send 0x00 to the comm port and nothing gets sent, gives me a problem.

I guess I was hoping that someone may know if it is possible to send hex values and not ascii.

I may have to learn again how to create plugins but most of the easy resources such as mscomm.ocx are copyrighted components of Visual basic etc.

Best regards
Dave Jarrard
DaveJ
 
Posts: 90
Joined: Tue Dec 30, 2008 11:06 am

Re: RS232

Postby mishem » Wed Apr 16, 2014 2:26 pm

I guess I was hoping that someone may know if it is possible to send hex values and not ascii.


Maybe I misunderstand ....
look plugin
NeoHexEdit
mishem
 
Posts: 574
Joined: Mon Oct 08, 2012 1:51 pm

Re: RS232

Postby dec » Wed Apr 16, 2014 10:33 pm

Hello,

DaveJ wrote:I guess I was hoping that someone may know if it is possible to send hex values and not ascii.


I am not sure if these npUtil plugin actions can help in your case, but take a look if you like:

http://neoplugins.com/?help/nputil#npDecimalToHex

http://neoplugins.com/?help/nputil#npHexToDecimal
.
Enhance your NeoBook applications!
.
57 plugins, 1113 actions and 230 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: RS232

Postby DaveJ » Thu Apr 17, 2014 12:43 am

Hi Guys,
The problem isn't the conversion to hex, it is the sending of hex values such as 0x00 which in acscii is 'null'

I used this code to prove the problem.

gtCommOpenStd "[commport],9600"
Loop "0" "255" "[loop_pos]"
SetVar "[output]" "[output][#[loop_pos]]"
FileWrite "[pubdir]hex" "All" "[output]"
gtCommSend "[commport],[#[loop_pos]]"
EndLoop

If I check the file 'hex' in a hex editor, all the characters are present.
If I check the output of the rs232 it is missing 0x00, 0x20 and 0x22 are swapped around.

Thanks

Dave J
DaveJ
 
Posts: 90
Joined: Tue Dec 30, 2008 11:06 am

Re: RS232

Postby Gaev » Thu Apr 17, 2014 6:40 am

DaveJ:

I haven't worked with serial ports for over 20 years but ...

1) if you see this page ... http://www.asciitable.com/ ... you will notice that the ascii codes for decimal 20 (Device Control4) and decimal 22 (Synchronous Idle) ... are generally reserved for sending commands (instructions) and not data (like A or B or 4)

So perhaps the codes are sent but the receiving device is trying to service the "commands"

2) sending code for "null" might also be treated as some kind of instruction


You might try and verify this by attempting to send the same file by an alternate method e.g. you might try DOS commands ...

TYPE file > COM1
COPY /B file COM1

If the receiving device behaves similar to before, you know that the problem is not with your NeoBook pub/plugin.
User avatar
Gaev
 
Posts: 3717
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: RS232

Postby DaveJ » Thu Apr 17, 2014 12:10 pm

Hi Gaev

The
TYPE file > COM1
Didnt work, I dont think it liked some of the characters being sent but
COPY /B file COM1
Worked perfectly.

It sent all the characters even the 0x00. So it seems like the plugin is loosing this character.
I thought that I might be able to do a dirty workaround using the DOS command you sent but I am expecting a reply back from the serial device and have no way to send and then listen to the port.

To read a memory area from the RF ID tag I send: AB 0A 03 02 00 FF FF FF FF FF FF
Return: AB 12 03 [Block data]

As you can see there is a 00 (hex value) in the request.

At least I have proved what the problem is, so thanks for the help

Dave J
DaveJ
 
Posts: 90
Joined: Tue Dec 30, 2008 11:06 am

Re: RS232

Postby Gaev » Thu Apr 17, 2014 1:39 pm

DaveJ:

I am expecting a reply back from the serial device and have no way to send and then listen to the port.

Try ...

COPY /B COM1 file2
TYPE file2

... or just ...

TYPE COM1

You may have to place some kind of delay after sending the data.


You might also investigate facilities in Power Shell or the "CommInterface.au3" library of AutoIt
User avatar
Gaev
 
Posts: 3717
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: RS232

Postby DaveJ » Fri Apr 18, 2014 11:05 am

Great idea Gaev,

The Autoit CommInterface.au3 looks like it will do what I need.

Thanks
DaveJ
 
Posts: 90
Joined: Tue Dec 30, 2008 11:06 am


Return to PlugIn Discussions

Who is online

Users browsing this forum: No registered users and 2 guests

cron