Getting status of dry contact on a din-mod4

52 views
Skip to first unread message

simon...@xtra.co.nz

unread,
Oct 10, 2017, 3:54:11 AM10/10/17
to CommandFusion Software
I'm trying to get the status of a dry contact on CFlink - 11, module - M3, port - P08 when iViewer starts up so I can toggle a digital join(6) on a button to show if a garage door is opened or closed.

First question am I using the dry contact input correctly? Closed circuit equals 1 open circuit equals 0?

I'm trying to use the example in https://github.com/CommandFusion/CFLinkJS/tree/master/Demo. I have added the script cflink-simple.js to my project and I'm using the CFL.queryRelays and CFL.watchRelays to operate some relays on a CF Mini and show status on a button they are working fine. Similar to the watchRelays example I currently have a tag on the button being used 'Relay_M3_P08'

I don't understand the 'callback' part of the CFL.queryIO function. Is there another example to help me understand a little better or is there a different way of doing it?

In a nut shell I want a button to be used to open and close a garage door and show the position on the button open=active closed=inactive. The dry contact I'm using is on Din-Mod4 CFlink 11, Module 3, Port 08.

Any help, leads would be great.
Thank you
SIMON

Jarrod Bell

unread,
Oct 10, 2017, 7:29:10 PM10/10/17
to comman...@googlegroups.com
Yes, dry contact closed is 1 (circuit closed).

You can do this more simply with a feedback item, rather than using JavaScript.
Your regex would look like this:
\xF2\x11\xF3RIOXCHA\xF4M3:P08:(\d)

Then add a capture group item to your feedback processing list, with index 1 (first set of brackets we are capturing) and set it to digital join matching your button.
Leave the on value and off values empty (it will automatically set the join high when capturing a 1 (dry contact closes) and set the join low when capturing a 0 (dry contact opens)

Also, make sure your IO port is configured correctly as a Dry Contact within System Commander.

Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com

--
You received this message because you are subscribed to the Google Groups "CommandFusion Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commandfusio...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

simon...@xtra.co.nz

unread,
Oct 12, 2017, 4:21:23 AM10/12/17
to CommandFusion Software
Thanks for the reply Jarrod but I can't seem to get it to work. I've spent the last day playing around with it not sure where I'm going wrong. I'll add a couple of screen shots below. I have noticed I added \xF5\xF5 at the end of this particular try.


What am I missing?

Thank you
SIMON

Jarrod Bell

unread,
Oct 12, 2017, 4:25:40 AM10/12/17
to comman...@googlegroups.com
Sorry, my regex was wrong. Try this:

\xF2\x11\xF3RIOXCHA\xF4M3\|P08:(\d)

Also, try removing the name from the capture group properties if the above doesn't work.


Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com

simon...@xtra.co.nz

unread,
Oct 13, 2017, 5:33:17 AM10/13/17
to CommandFusion Software
Gave that a go Jarrod but still no joy. What I did notice is when I debug it and go to the 'Mixed Log' I wasn't seeing it 'match'. So I have had a bit of a play around and I can get:

\xF2\x11\xF3RIOXCHA\xF4M3|P02:(\d)

to work, it matches when iViewer starts and the capture groups I have added show the right join changes. However when I open/close the dry contact P02 on the DIN-MOD4, Module 3 I get nothing. Now also if I make it any port above P04 eg P05-P08 it doesn't start the feedback leading me to believe that it's not seeing the module ID 11 I have entered. I have also tried to change it from the DIN-MOD4 to the CFMini but no joy either.

I'm testing it by getting a small bit of wire and closing the contact.

Any ideas?

guiDesigner Ver. 2.7.4.705
DIN-MOD4  Firmware 1.14.7
iPhone 6

Thank you
SIMON

Jarrod Bell

unread,
Oct 13, 2017, 5:59:29 AM10/13/17
to comman...@googlegroups.com
Check that the message is showing up in the log in System Commander.
Then base your regex off the data that shows in the log.

Make sure you have "report on change" enabled for the MOD-IO8 as well.


Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com

Reply all
Reply to author
Forward
0 new messages