RS232 again!

Questions and information about using VBScript and JavaScript in NeoBook functions

Moderator: Neosoft Support

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

RS232 again!

Post by DaveJ »

I have tried to use many ways of talking to com ports via RS232 but never quite got what I needed.
I have however just come across this Java RS232 library and don't know if Neobook will run the script as it requires the inclusion of 'jar' files.
https://code.google.com/p/java-simple-s ... C_examples

I don't mind learning how to implement it as long as I know in theory it should work. Does anyone know if Neobook will use Java in this way?

Thanks

Dave J
Neosoft Support
NeoSoft Team
Posts: 5628
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA
Contact:

Re: RS232 again!

Post by Neosoft Support »

NeoBook can run functions written in JavaScript through the Call action. However, this only works with JavaScript not Java.

If there is enough interest we can look into creating a RS232 plug-in.
NeoSoft Support
DaveJ
Posts: 90
Joined: Tue Dec 30, 2008 11:06 am

Re: RS232 again!

Post by DaveJ »

Thanks for the reply Dave,
Its interesting that Glendon Turner who created the RS232 plugin some time ago had a conversation with me and I never really took as much interest as I should have. I was too interested in directly interfacing with hardware such as the Velleman devices.
I never realised how many products in the real world use RS232 to communicate even though some disguise themselves as USB devices.
There is now a huge community that produce open source hardware using the Arduino devices. These devices all communicate with RS232 and to interface with a PC need the ability to communicate via serial.
Many 3D printers use RS232 to drive the servos and my need was to read RF ID tags when I realised that the current RS232 plug-in didn't support hex values.

I'm not sure how many Neobook users would like to measure atmospheric pressure, get the temperature or read a GPS device to get the current location but these things are very useful when you see have low cost they are to implement.

I clearly would love Neobook to add RS232 to the list of plugins and I would be happy to pay but I realise that you would need more than just me.

Just as an example, it would cost me less than $5 to create a barometer and display the results in a Neobook program or less than $15 to show location or accurate time to a fraction of a second.
Thanks

Dave J
Neosoft Support
NeoSoft Team
Posts: 5628
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA
Contact:

Re: RS232 again!

Post by Neosoft Support »

That's really interesting.

If we were to create a plug-in, what do you see as the minimum required command set?
NeoSoft Support
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

Re: RS232 again!

Post by David de Argentina »

Hi Davej,

Using NeoThinBasic plugin you have all you need for develop COMMs functions.

Take a look of this:

http://www.thinbasic.com/public/product ... index.html

And see ThinBasic Modules -> COMM

My defaluted cent,
David de Argentina
DaveJ
Posts: 90
Joined: Tue Dec 30, 2008 11:06 am

Re: RS232 again!

Post by DaveJ »

Hi Dave,
The commands that were available with the MSCOMM32.OCX were perfect.

Open Port with port,baud,bits,parity,stop,txbuffer,rxbuffer,
Set Threshold to trigger an event on a certain number of bytes in the buffer,
Read buffer and delete bytes that have been read,
Send bytes either as ascii or hex values,
Count bytes in buffer
Clear buffer
Close Port

Most of what Glendon did was fine except for no threshold setting, crashes if there are no bytes in the buffer and reading the buffer didn't clear its content and of course the hex values bit.
If he was still developing it I would guess it would have been a quick fix.

David de Argentina, thanks for the heads up on Thinbasic but not sure if I would be able to create the event trigger. I will however take a look at what can be done with ThinBasic.

Thanks

Dave J
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

Re: RS232 again!

Post by David de Argentina »

David de Argentina, thanks for the heads up on Thinbasic but not sure if I would be able to create the event trigger. I will however take a look at what can be done with ThinBasic.
Using PowerBasic ( or NeoThinBasic) you can do it in two ways:

a) After the TXBuffer, in the same function
b) on a separate thread, to catch any RXBuffer.

Good Luck !
David de Argentina
User avatar
Rodrigo
Posts: 30
Joined: Wed May 30, 2012 6:23 am
Location: Chile

Re: RS232 again!

Post by Rodrigo »

I would be interested in that plugin to control inter printers and cash drawers. Are you already working on it?
After the game, the nerd and the ignorant will return to the same box
Neosoft Support
NeoSoft Team
Posts: 5628
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA
Contact:

Re: RS232 again!

Post by Neosoft Support »

We're not currently working on a plug-in, but considering it. The main problem (other than time) is that we do not have any external hardware for testing which makes development more difficult that it otherwise would be.
NeoSoft Support
User avatar
Rodrigo
Posts: 30
Joined: Wed May 30, 2012 6:23 am
Location: Chile

Re: RS232 again!

Post by Rodrigo »

:( I understand
After the game, the nerd and the ignorant will return to the same box
User avatar
ebear
Posts: 270
Joined: Wed Jan 18, 2012 3:12 am
Location: Vrchlabi - Czech republic
Contact:

Re: RS232 again!

Post by ebear »

Dear Rodrigo,

Please look in the Sub forum Neobook and Hardware Control.

Best regard,

Eric
http://www.lunarsoftware.eu - Lunar Software ERP database Development. Manufacturing processes, Document management, QMS, Stock management. Standalone solutions or connected to Helios Orange and other ERP systems.
User avatar
ebear
Posts: 270
Joined: Wed Jan 18, 2012 3:12 am
Location: Vrchlabi - Czech republic
Contact:

Re: RS232 again!

Post by ebear »

Dear Rodrigo,

You may already know this, but David Esperalta started to develop a plug-in for serial communication.
It's yet in a Beta stage, but we are now testing. Please see the Neobook and Hardware control forum.

Best regards,

Eric
http://www.lunarsoftware.eu - Lunar Software ERP database Development. Manufacturing processes, Document management, QMS, Stock management. Standalone solutions or connected to Helios Orange and other ERP systems.
User avatar
Rodrigo
Posts: 30
Joined: Wed May 30, 2012 6:23 am
Location: Chile

Re: RS232 again!

Post by Rodrigo »

ebear wrote:Dear Rodrigo,

You may already know this, but David Esperalta started to develop a plug-in for serial communication.
It's yet in a Beta stage, but we are now testing. Please see the Neobook and Hardware control forum.

Best regards,

Eric
Thank you Eric!, I will be alert.
After the game, the nerd and the ignorant will return to the same box
Locked