Source language: Translate to:

RS232.. anyone? - RFID Application

Questions or information that don't quite fit anywhere else

Moderator: Neosoft Support

RS232.. anyone? - RFID Application

Postby domino » Wed Sep 01, 2004 9:56 am

I already have a PUB that can accept barcode input and process the scanned info...  

However what I would like to be able to do is to use data from an RFID tag and process this in the same way.

I have made a little setup to play with and this works with software from Texas Instruments but it sends the data in hex format to that utility.

Is it possible to input serial RS232 data (as an ascii string) to a focused text entry box into a NeoBook Pub.  ...

I seem to remember some time ago someone had done some work in this area.. but can't find any reference in the forum.

Cheers
Dave
domino
 

RS232.. anyone?

Postby Sam Cox » Wed Sep 01, 2004 11:59 am

As GKCS pointed out earlier this year (2/29/04), "you can use ALL OS reserved devices for Input/Output via FileWrite or FileRead." So, for example, you could

   FileRead "COM1:" "1" "[variable]"

I have not tried this because I don't have a way of generating ASCII input on a COM (RS232) port.

Alternatively, you could purchase or otherwise obtain an "RS232 Wedge" which basically transfers characters recevied on the RS232 port into the keyboard stream as if you typed them. Here is one such gizmo.

   http://www.microridge.com/wedgelink.htm
User avatar
Sam Cox
 
Posts: 768
Joined: Fri Apr 01, 2005 7:30 am
Location: Loveland CO USA

RS232.. anyone?

Postby djold1 » Wed Sep 01, 2004 12:54 pm

It's been a while since I have been involved in machine control but If I am not wrong I think the main problem in doing:

While....
FileRead "COM1:" "1" "[variable]"
 If "[Variable]" "=" "[Something]"
    Gosub "Somewhere"
 Else
 EndIf
End While.....

The problem with a serial port input is that you must continuously poll the port with a loop of some kind every few milliseconds to acquire the ASCII character input. ASCII commands often are in character sets not just single characters.

This is always a problem with any language but it is even more critical when using an interpreted language like NeoBook.  You can easily use up all the available resources simply in polling and responding. This means that it becomes very difficult to do anything else useful while polling.

Note that in the code snippet above that if a Gosub is activated, the While/EndWhile FileRead loop must keep on reading and handling any incoming characters. It is entirely possible that a new command could be received and have to processed every few milliseconds. Not an easy thing to do without an interrupt-type handler.

Ideally the RS-232 input should be captured in a background thread and an interrupt-like structure activated when a valid command set is received.  The interrupt is evaluated with a Case or If statement set to determine what response should be made.

Doing "FileWrite"  is not critical and should work because it is assumed that the receiving device has a way to capture, poll and parse the transmitted character set.

There is a definite need for a well done machine-code plug-in that can handle incoming RS232 for NeoBook. But the future says that it will be just as important to be able to handle USB 2.x and 1394 Firewire as well, since these are all advanced serial device handlers that will at some point take over much of the RS232 work.  


(Edited by djold1 at 12:01 am on Sep. 2, 2004)
djold1
 

RS232.. anyone?

Postby Alberto Meyer » Wed Sep 01, 2004 1:15 pm

Do you know the baud rate, stop bits and flowcontrol?
Alberto Meyer
 

RS232.. anyone?

Postby djold1 » Wed Sep 01, 2004 2:23 pm

Alberto,

You just illustrated another problem with handling RS232 inputs:  

It is one thing to produce a custom package that is tailored to the particular device. But the real solution would be to produce a plug-in that is user configurable as to the Baud, stop bits and the flow. Custom packages work sometimes, but then the device changes and the configuration that was hard-coded in is useless.
djold1
 

RS232.. anyone?

Postby Alberto Meyer » Wed Sep 01, 2004 2:50 pm

Yes. You are right, but takes much time and I don´t know about the time frame of Dave.
Alberto Meyer
 

RS232.. anyone?

Postby domino » Wed Sep 01, 2004 3:28 pm

Thanks everyone....

I need to do a bit more homework and consider the responses thus far...

For info if anyone is interested I`m using the Texas Instruments LF Micro evaluation kit R1-K3A-001A.

This is supplied with a test software application (written in Delphi I think judging by the icon).. available at
http://www.ti.com/tiris/docs/products/tools.shtml

... S2_UTIL_VI-20.zip     (S2-Util.exe)

This gives plenty of options (none of which make much sense yet (if ever!)...  But the Baud Rat, stop bits etc are all adjustable throughout the range... the default is

9600 -   8 -  1

I`ve no idea what would be involved in producing a plugin to handle this sort of application - but the potential to handle these sorts of applications would appear to be quite exciting...

It`s late now.. but will be back on the case tomorrow.

Thanks again for the input..

Dave
domino
 

RS232.. anyone?

Postby Alberto Meyer » Wed Sep 01, 2004 3:48 pm

Ok. let´s see what can we do together to help.
Alberto Meyer
 

RS232.. anyone?

Postby domino » Thu Sep 02, 2004 4:27 am

For info I am starting to make some useful progress with the help of a utility COMtoX (http://www.dte.de/) ..

unregisteredðáéùversion  so far :-)

This solves the polling problem and allows RFID input to a focused text entry box in my NB PUB-

(BTW...Hyperterminal was good for reading the tags,)

Still plenty more to do though...

Cheers
Dave

(PS the FileRead COM1 just gave an access denied error)
domino
 

RS232.. anyone?

Postby Alberto Meyer » Thu Sep 02, 2004 8:37 am

You don´t need help anymore?
Cheers
Alberto Meyer
 

RS232.. anyone?

Postby domino » Thu Sep 02, 2004 8:49 am

Er.. yes please if you don`t mind.

So far I have proved I can get some tag info to the text entry box, but it's still not in the correct format and there are other bits like carriage returns etc to build in...

Really all I`ve achieved so far is a way to handle the polling problem...

Dave
domino
 

RS232.. anyone?

Postby domino » Thu Sep 02, 2004 9:41 am

When I scan the tag into my text entry box here are examples of the returned characters -

+Î}š
Ï8;Î
ðáéù

What is this format or character set please? - and is there any way in NB to intercept this and to convert it to a number or letters for example.....

I am currently working on a way to do this but any advice would be helpful...

Dave
domino
 

RS232.. anyone?

Postby Alberto Meyer » Thu Sep 02, 2004 10:11 am

Please wait 1 1/2 hour.
Alberto Meyer
 

RS232.. anyone?

Postby Alberto Meyer » Thu Sep 02, 2004 10:29 am

Dave,
The data is delimited for what char ? 13 ? 0?
Alberto Meyer
 

RS232.. anyone?

Postby domino » Thu Sep 02, 2004 10:43 am

Quote: from Alberto Meyer on 1:29 pm on Sep. 2, 2004
Dave,
The data is delimited for what char ? 13 ? 0?


Sorry Alberto... I don`t understand the question - what does the 13 refer to..
domino
 

Next

Return to Misc. Questions and Information

Who is online

Users browsing this forum: No registered users and 3 guests