DM1 messages, convert from J1939 to ModBus bit/byte

Discuss issues and ideas you have to configuring displays with PowerVision
Ocelot
Posts: 77
Joined: Thu Oct 06, 2011 10:43 am

DM1 messages, convert from J1939 to ModBus bit/byte

Post by Ocelot » Fri Feb 03, 2012 12:06 pm

Hello everyone

I am currently trying to convert DM1 messages recieved over CAN into a Modbus bit active/not active state.

Hardware: PV450
Serial Port 1: set as a Modbus RTU Slave, baud rate: 9600, Parity: None, Stop Bits: 1
I already have the bit/byte structure that I need set in Environment Setup under Local Modbus Slave. All values are initialized to 0 when unit is booted.

example/problem,

PV450 recieves SPN 110 FMI 16 DM1 message. I set register 40001, Bit 0 to active. I can get this to work correctly, but I am encountering an issue when there is more than one DM1 message active at the same time.

I can only set a bit active based upon the current values of Dm1.SPN, Dm1.FMI and Dm1.IsActive. I need to be able to set multiple bits to be active (at the same time) until Dm1 faults are no longer detected.

The DM1-Popup View display sets Dm1.SPN, Dm1.FMI and Dm1.IsActive based upon the current value of the Dm1.ListPointer variable (which is set based upon the Dm1Next and Dm1Prev Transitions inside of the Dm1 State machine). I need to loop through the 'table' of current Dm1 messages to check for active status to properly broadcast these faults in ModBus, but the only way I can do that is by looping through Dm1.ListPointer, which basically puts the DM1-Popup View (in Page Designer - Overlay Layer) on a slideshow (which I do not want). I am only trying to broadcast specific SPNs and FMIs over ModBus, not the whole list.

Is there any better way of doing something like this that I am missing? Currently, the only way I have of checking the Dm1 messages is by using Dm1.ListPointer. Which is not a workable solution for me as it messes up the DM-1 Popup View.

Even by using scripts I cannot really think of a simple/good way of doing this that would work, as everything ends up being linked back to Dm1.ListPointer.

Any help would be greatly appreciated, I can attach a sample configuration, if that would help you on your end.

Thank you for your time
Kyle Bruneau
Applications Engineer - MurCal Inc
rschrock
Enovation Controls Development
Enovation Controls Development
Posts: 6
Joined: Wed Sep 08, 2010 10:37 am

Re: DM1 messages, convert from J1939 to ModBus bit/byte

Post by rschrock » Mon Feb 06, 2012 9:02 am

Ocelot, There are two ways to accomplish this. One is to write a script that will run through the list created by the DM1 application. The second is to use the DTC mapping to set a variable. The second optons sounds like the best way for your application.
To use the DTC mapping, go to the enviroment setup tab and select the device your DM1 messages are received from. Next Select the DTC Mapping tab in the center of the screen. Next click the plus sign in the lower section to create a mapping for each DM1 message you would like to receive and map to a variable. Note that you will need to also setup the DM1 message in the database tab/DTC for this option to be available. Now you can tie this to your modbus variable to complete your configuration.

Thank You
Ocelot
Posts: 77
Joined: Thu Oct 06, 2011 10:43 am

Re: DM1 messages, convert from J1939 to ModBus bit/byte

Post by Ocelot » Tue Feb 07, 2012 4:34 pm

rschrock,

Thanks for the quick reply, sorry about not getting back to you sooner. I have not been able to revisit this until about 30 mins ago.

The second proposed solution sounded the best to me and I tried it out, it works.

Thanks for saving me a considerable amount of time, I appreciate it.
Kyle Bruneau
Applications Engineer - MurCal Inc