Page 1 of 1

Arduino and "COM Script" read

PostPosted: Wed Aug 03, 2016 10:07 am
by dark_dragon
Hello,
i am new to this forum.
i try to connect an arduino via com port to WD. The arduino sends ASCII values like "Y" or "X" followed by [CR]. I want the COM Script to click a button, when the X or the Y arrived.
When i monitor the Serial Input of the arduino with the "Remote Input Control", everything seems okay. I get "Packet recieved: XC?" The C? is the [CR] i think.
But the COM Script does nothing... (Packet End Char: [CR], Input: X, Command: WDCustomScriptClick,31)
Does anyone has an idea?
Thanks!
Florian (from Germany)

Re: Arduino and "COM Script" read

PostPosted: Wed Aug 03, 2016 11:23 am
by Dennis Kuypers
Hi Florian,

the easiest way to remote the Widget like that is to enable (Tools -> Remoting -> Serial port). Then you can send any WD script in parenthesis (no CR required). Example:

Code: Select all
(WDMessageBox,Test,It works!)


I suggest that you use macros instead of clicking buttons remotely, for example button 5 turns off the lights, then instead you could do:

- create new macro, called "LightsOff"
- copy code from button 5 to the macro
- set button 5 click script to "LightsOff"

Now you can send "(LightsOff)" to the remoting port, and it is obvious what it does, (in contrast to "WDCustomScript5")"

Dennis

Re: Arduino and "COM Script" read

PostPosted: Wed Aug 03, 2016 11:50 am
by dark_dragon
Hello Dennis,
that is working, but if Remoting is activated, i cannot send commands to the arduino. The same Arduino is also used to switch relais... controlling the relais works fine with WD.

Florian

Re: Arduino and "COM Script" read

PostPosted: Wed Aug 03, 2016 12:14 pm
by dark_dragon
Hello,
i took a second Arduino, only for input. Now i can monitor the remote input in "Remoting"
Can you please explain me, how to setup a clickscript?
for example: i want to click button 5, when the arduino sends an "A" to the WD?
i am sorry, but i am not familiar with the WD, and the help-file is not a great help ;)

Re: Arduino and "COM Script" read

PostPosted: Wed Aug 03, 2016 3:30 pm
by dark_dragon
I got it!
Thank you! :)
Works well with two Arduinos. One for input (Remoting), the other for output (ComSend).
Florian