Arduino and "COM Script" read

Moderator: Moderator Group

Arduino and "COM Script" read

Postby dark_dragon » Wed Aug 03, 2016 10:07 am

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)
dark_dragon
 
Posts: 4
Joined: Mon May 23, 2016 5:34 pm

Re: Arduino and "COM Script" read

Postby Dennis Kuypers » Wed Aug 03, 2016 11:23 am

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
Dennis Kuypers
Product Developer, Software

Online Manual
Dennis Kuypers
coolux Germany
 
Posts: 771
Joined: Thu Jul 05, 2012 12:18 pm

Re: Arduino and "COM Script" read

Postby dark_dragon » Wed Aug 03, 2016 11:50 am

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
dark_dragon
 
Posts: 4
Joined: Mon May 23, 2016 5:34 pm

Re: Arduino and "COM Script" read

Postby dark_dragon » Wed Aug 03, 2016 12:14 pm

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 ;)
dark_dragon
 
Posts: 4
Joined: Mon May 23, 2016 5:34 pm

Re: Arduino and "COM Script" read

Postby dark_dragon » Wed Aug 03, 2016 3:30 pm

I got it!
Thank you! :)
Works well with two Arduinos. One for input (Remoting), the other for output (ComSend).
Florian
dark_dragon
 
Posts: 4
Joined: Mon May 23, 2016 5:34 pm


Return to Widget Designer V4.7

Who is online

Users browsing this forum: No registered users and 6 guests