DINMOD4 / MOD4 issue with javascript + RS232 Onboard

40 views
Skip to first unread message

nicolas Hovnanian

unread,
Feb 16, 2014, 11:13:14 PM2/16/14
to commandfusi...@googlegroups.com
Hi,

Just need understand why my demo doesn't work with onboard Din-Mod4 or Mod4. Working very well with CFmini.

I got last firmware and my LANBridge is connect with 192.168.2.120.

Can send and received RS232 Onboard with System commander but not in iViewer with DinMod4 and MOD4.

Some help please will be very apreciated :)

Best regards !
demo.gui.zip

Jarrod Bell

unread,
Feb 16, 2014, 11:31:28 PM2/16/14
to commandfusi...@googlegroups.com
One difference I can find between LAN Bridge onboard RS232 class and the DIN-MOD4 class, is that when its initialised its not providing the model string.
Not sure this is the actual fix, but try this:

In cflink.js, find line 2839
Change it to:
this.rs232Port = new CFLink.RS232Port(systemName, id, "MOD");
And also try moving that line to below the $super call on line 2854. I noticed that the LAN Bridge and CF Mini both create the rs232Port object after the $super calls.

One thing you can do is intercept all the incoming and outgoing data of the cflink.js processing. This is done by adding this to your demo.js file (within your setTimeout function):

    CFLink.interceptNetworkDialog = function(incoming, systemName, data) {
            var cflinkID = "[" + ("00" + data.charCodeAt(1).toString(16).toUpperCase()).slice(-2) + "] ";

            if (incoming) {
                CF.log(" IN: [" + systemName + "]" + cflinkID + data.substring(3));
            } else {
                CF.log("OUT: [" + systemName + "]" + cflinkID + data.substring(3));
            }
        };

Then please let me know what happens in the log when you call the sendCOMData functions.

Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com


--
You received this message because you are subscribed to the Google Groups "CommandFusion Hardware" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commandfusion-har...@googlegroups.com.
To post to this group, send email to commandfusi...@googlegroups.com.
Visit this group at http://groups.google.com/group/commandfusion-hardware.
For more options, visit https://groups.google.com/groups/opt_out.

nicolas Hovnanian

unread,
Feb 17, 2014, 7:44:35 AM2/17/14
to commandfusi...@googlegroups.com, jar...@commandfusion.com
Hi,

I change that and now my regex can display command nicely but log in http://pastebin.com/iN7MqnSm

Thx a lot for your help I will udate all my cflink.js in all my projects.

Best regards

To unsubscribe from this group and stop receiving emails from it, send an email to commandfusion-hardware+unsub...@googlegroups.com.
demo.gui.zip

Jarrod Bell

unread,
Feb 17, 2014, 8:18:44 AM2/17/14
to commandfusi...@googlegroups.com
OK great - so it is all resolved now? Or is there something still not working?


Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com


To unsubscribe from this group and stop receiving emails from it, send an email to commandfusion-har...@googlegroups.com.

nicolas Hovnanian

unread,
Feb 17, 2014, 8:49:54 AM2/17/14
to commandfusi...@googlegroups.com, jar...@commandfusion.com
resolved now ,)

thx 

nicolas Hovnanian

unread,
Feb 17, 2014, 8:36:05 PM2/17/14
to commandfusi...@googlegroups.com, jar...@commandfusion.com
Sorry another try with modules. I keep all other files and now I change my js to get feedback from RS (serial COM4 is in slot 3 like your old exemple)




I can see IN or OUT in log for all intercept dialog but nothing in loginfo variable :/

Thx again ;)

Jarrod Bell

unread,
Feb 17, 2014, 8:42:24 PM2/17/14
to commandfusi...@googlegroups.com
Try using the attached script - it is an updated version of the one available from github (updated recently when testing at ISE where we came across a few bugs in the script).



Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com


To unsubscribe from this group and stop receiving emails from it, send an email to commandfusion-har...@googlegroups.com.
cflink.js

nicolas Hovnanian

unread,
Feb 18, 2014, 1:19:20 AM2/18/14
to commandfusi...@googlegroups.com, jar...@commandfusion.com
thx for file but same issue :/ perhaps it's in my code :/

Florent Pillet

unread,
Feb 18, 2014, 3:40:19 AM2/18/14
to commandfusi...@googlegroups.com
This is because this code is wrong:

dev.dinmod4.modules[2].watchCOMPorts(null, function (deviceObject, moduleObject, portNumber, data) {

You are not talking to your module object, but to the constant that's in the modules array. Instead, you should write:

dev.dinmod4.getModule(3).watchCOMPorts(null, function (deviceObject, moduleObject, portNumber, data) {

Note that modules in the getModule() function use the logical module number (1 to 4).

Florent

On 18 Feb 2014, at 02:36, nicolas Hovnanian <armandpe...@gmail.com> wrote:

Sorry another try with modules. I keep all other files and now I change my js to get feedback from RS (serial COM4 is in slot 3 like your old exemple)




I can see IN or OUT in log for all intercept dialog but nothing in loginfo variable :/

Thx again ;)




--
Florent Pillet - Software Engineering Lead



Jarrod Bell

unread,
Feb 18, 2014, 8:24:39 AM2/18/14
to commandfusi...@googlegroups.com
getModule is just a shortcut call for the same thing in Nicolas' code, so I don't think this code is the issue.

I have attached an updated cflink.js file, please test it out. The changes are made in line 1884.
I believe the portNum was not being extracted correctly. I don't have a DIN-MOD4 with me right at the moment, so let me know how you go, and I will test with an actual unit as soon as I can.


Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com


--
You received this message because you are subscribed to the Google Groups "CommandFusion Hardware" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commandfusion-har...@googlegroups.com.
cflink.js

nicolas Hovnanian

unread,
Feb 18, 2014, 11:59:25 AM2/18/14
to commandfusi...@googlegroups.com, jar...@commandfusion.com
same issue with both solution:/

I m in IRC if you have some free time

Regards
To unsubscribe from this group and stop receiving emails from it, send an email to commandfusion-hardware+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages