A possible plugin for basic Serial Communications purposes

Using NeoBook to control external hardware and devices.

Moderator: Neosoft Support

User avatar
ebear
Posts: 270
Joined: Wed Jan 18, 2012 3:12 am
Location: Vrchlabi - Czech republic
Contact:

Re: A possible plugin for basic Serial Communications purpos

Post by ebear »

Hello David,

Doing some testing... Maybe I'm doing something wrong but OnCompRxChar triggers only when I close the port.
I'm using your sample. Should it not trigger every time a character is received in the buffer???

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
ebear
Posts: 270
Joined: Wed Jan 18, 2012 3:12 am
Location: Vrchlabi - Czech republic
Contact:

Re: A possible plugin for basic Serial Communications purpos

Post by ebear »

dec wrote:Hello Eric,
ebear wrote:Hello David,

Should it not be npComm instead npComp :D

Greetings,

Eric
Yes; I think also in "npComm", however, the "m" letter appear too width, and join two "m" enlarge the plugin name, which affect in some way in various plugin parts. So probably I think in a possible "npComm" substitute, and then I found "comp" for "COM Port", so I finally put this name to the plugin. In a very early stage of the plugin change their name it's not too difficult, however at this time this implied too much changes in various ways: files, units, forms, identifiers, functions... so probably the plugin continue named "npComp", if we don't found some good reason to change their name. ;)

Sure don't worry, with you description it makes sense... :D

Greetings
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
dec
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain
Contact:

Re: A possible plugin for basic Serial Communications purpos

Post by dec »

Hello Eric,
ebear wrote:Hello David,

Doing some testing... Maybe I'm doing something wrong but OnCompRxChar triggers only when I close the port.
I'm using your sample. Should it not trigger every time a character is received in the buffer???

Regards,

Eric
Yes; in principle that even is triggered when a char is received. When you say the event is fired when close the port... do you receive something at that time? Anyway I review this as quickly as possible Eric. I plan to add some other events. And maybe I am missing some configuration options. On the other hand, avoid the use of the plugin sample at this time: act like if you want to work with the plugin in your own project. Think the sample is made in a "blind way", since I can't test the plugin against any real hardware device. Remember you can also call the "npCompReadString" out of the refered event. Maybe this can make some difference. Thanks for your tests Eric.
ebear wrote: Sure don't worry, with you description it makes sense... :D
Thanks for your understanding. ;)
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain
Contact:

Re: A possible plugin for basic Serial Communications purpos

Post by dec »

Hello again,

I want to add something I think can be important: take a look carefully at the "npCompSetOptions". As you can see this action allow you to set several options, so try to use the right values to your hardware. Anyway as quickly as possible I try to found what happend with the referd event.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
ebear
Posts: 270
Joined: Wed Jan 18, 2012 3:12 am
Location: Vrchlabi - Czech republic
Contact:

Re: A possible plugin for basic Serial Communications purpos

Post by ebear »

David,

I'm testing the plugin against my Arduino brake sensor tester.

The tester gives a continuous input via the RS-232 port to Neobook. The input is a changing Voltage 0,2V .... 4,2V . The sensor is connected via the Arduino board to a stepper motor.

If I use npCompInputCount I see the counter working, also the read string function works, but the trigger is only fired when I close the port. (I see this via the Neobook debugger)

Greetings,

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
dec
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain
Contact:

Re: A possible plugin for basic Serial Communications purpos

Post by dec »

Hello,
ebear wrote:David,

I'm testing the plugin against my Arduino brake sensor tester.

The tester gives a continuous input via the RS-232 port to Neobook. The input is a changing Voltage 0,2V .... 4,2V . The sensor is connected via the Arduino board to a stepper motor.

If I use npCompInputCount I see the counter working, also the read string function works, but the trigger is only fired when I close the port. (I see this via the Neobook debugger)

Greetings,

Eric
Thanks for your efforts Eric. Good to know the "read string" action works, at the least, out of the refered event. Please, do not forget to study all the options available in "npCompSetOptions" action. Also the other actions recently added. Some possibility can be that such device do not fire the refered event. Anyway more enhancements can be expected and also a deep review about the refered event. Thanks again for your efforts Eric.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
ebear
Posts: 270
Joined: Wed Jan 18, 2012 3:12 am
Location: Vrchlabi - Czech republic
Contact:

Re: A possible plugin for basic Serial Communications purpos

Post by ebear »

Sensor tester..... Development setup.... :D

Image
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: A possible plugin for basic Serial Communications purpos

Post by ebear »

David,

I see in the "npCompSetOptions" and "EventChar" is this the trigger character??? If yes then even better it gives a good opportunity to control the input....

Let's test.... :D

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
dec
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain
Contact:

Re: A possible plugin for basic Serial Communications purpos

Post by dec »

Hello,
ebear wrote:David,

I see in the "npCompSetOptions" and "EventChar" is this the trigger character??? If yes then even better it gives a good opportunity to control the input....

Let's test.... :D

Eric
To be honest I can't talk with security. I think so, "EventChar" is the trigger character. But I can't read the component help right now (my laptop running now Windows 10, the preview version and can't open HLP files). As quickly as possible I do it using my PC. If you think that can be useful try changing that option. Anyway I am not completely sure if the "Event" char is correctly set, since the component expect a "char", not an string, and I can remember right now that the way I use maybe it's not the best. So expect a near new release of the plugin with this things revisited.

On the other hand, Eric, may you can take a look at the "TCompPort" help... and read their help by yourself. Anyway this is only if you wanted... as I say before, when I can is my intention to clarify what "EventChar" means. Thanks for your efforts Eric. The kind of things which can be doing with a plugin like that appear curious and interesting as you shown in the above image. ;)
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain
Contact:

Re: A possible plugin for basic Serial Communications purpos

Post by dec »

dec wrote:Hello,
ebear wrote:David,

I see in the "npCompSetOptions" and "EventChar" is this the trigger character??? If yes then even better it gives a good opportunity to control the input....

Let's test.... :D

Eric
To be honest I can't talk with security. I think so, "EventChar" is the trigger character. But I can't read the component help right now (my laptop running now Windows 10, the preview version and can't open HLP files). As quickly as possible I do it using my PC. If you think that can be useful try changing that option. Anyway I am not completely sure if the "Event" char is correctly set, since the component expect a "char", not an string, and I can remember right now that the way I use maybe is not the best or at least can be enhanced. So you can expect a near new release of the plugin with this things revisited.

On the other hand, Eric, may you can take a look at the "TCompPort" help... and read their help by yourself. Anyway this is only if you wanted... as I say before, when I can is my intention to clarify what "EventChar" means. Thanks for your efforts Eric. The kind of things which can be doing with a plugin like that appear curious and interesting as you shown in the above image. ;)
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
ebear
Posts: 270
Joined: Wed Jan 18, 2012 3:12 am
Location: Vrchlabi - Czech republic
Contact:

Re: A possible plugin for basic Serial Communications purpos

Post by ebear »

the "TCompPort" help.

I was already studying :) ... But David tomorrow is another day.... Take a nip :wink: I going to do so...

Bye...
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
dec
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain
Contact:

Re: A possible plugin for basic Serial Communications purpos

Post by dec »

Hello,

After read the documentation, apparently, the "OnCompRxChar" event must be fired when the "EventChar" is found in the input buffer, BUT, this event must be fired also for "non event" characters...

Since the component have a property "SyncMethod", which "defines in context of which thread the events will be called", I want to offer the possibility to test the plugin in all the possibles "SynMethod" values.

Probably this have not too much sense, but, the uploaded plugin uses the default "SyncMethod". That's ok. But you can download two versions of the plugin which uses the other two possible "SyncMethod" values:

http://neoplugins.com/temp/npComp2.zip

The above Zip contains two NBP files (plugins) which are exactly the same than the firstly upload, except uses the two other differents values for "SyncMethod". Please, Eric, uninstall the currently installed plugin and try with these two different plugin releases. May one (or both) of this can make the difference so we use the appropiate "SynMethod" in the future release.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
ebear
Posts: 270
Joined: Wed Jan 18, 2012 3:12 am
Location: Vrchlabi - Czech republic
Contact:

Re: A possible plugin for basic Serial Communications purpos

Post by ebear »

Hello David,

Now testing the "smWindowSync.nbp", the trigger fires and looks to work perfect.
Only thing I have to find out is the synchronization, but this is mainly on Arduino level.

David, think we are coming close... :D But of cause I'm now only testing the basics, list of wishes will follow :lol:

Next to Arduino I will do this weekend some more testing on other hardware....

Will follow up......

Greetings,

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
dec
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain
Contact:

Re: A possible plugin for basic Serial Communications purpos

Post by dec »

Hello Eric,
ebear wrote: Hello David,

Now testing the "smWindowSync.nbp", the trigger fires and looks to work perfect.
Glad to know that. Apparently the other method can't work due to the nature of a NeoBook plugin, which at the end it's a DLL and not an standalone executable. Ok. Continue the tests (when you can) using the "smWindowSync.nbp" version of the plugin. The next release of the plugin (probably with more stuff) start using the "Window Sync" method instead the used in the previous release. Many thanks for your efforts Eric!
ebear wrote: Only thing I have to find out is the synchronization, but this is mainly on Arduino level.
Maybe we can exploit some other available events that are not yet implemented in the plugin. Hopefully we can have something working!

Thanks again Eric. ;)
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain
Contact:

Re: A possible plugin for basic Serial Communications purpos

Post by dec »

Hello again,

The plugin new release is now available:

http://neoplugins.com/temp/npComp.zip

Basically this release use by default the proved "sync method". ;)
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
Locked