News:

  • October 14, 2025, 10:08:06 AM

Login with username, password and session length

Author Topic: Modbus / PUBLISH issue?  (Read 4744 times)

willpoll

  • Sr. Member
  • ****
  • Posts: 54
Modbus / PUBLISH issue?
« on: October 17, 2017, 07:17:43 PM »
Hi, I'm having an issue getting PUBLISH to give expected result.

I have two N registers N601 = 16672 and N602 = 0.  When I use PUBLISH to convert to a Real, under no circumstances do I get the expected result, which is 9.0.  I've tried swapping bytes, words, both, neither and no luck.

Am I having a brain fart?

Thanks!!

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: Modbus / PUBLISH issue?
« Reply #1 on: October 17, 2017, 07:47:43 PM »
Two problems:
1. PUBLISH is for converting native Do-more values to non-native values. An example of that would be to take R0 containing a value of 9.0, and then writing that to Modbus registers like MHR1 and MHR2 (or N1 and N2). SUBSCRIB is for converting non-native values and converting them to native Do-more values. An example of that would be taking the MHR1 and MHR2 in the previous example and converting them to 9.0 stored in R0. What you are trying to do is a SUBSCRIB.
2. 16672 and 0 will produce 10.0, not 9.0.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

willpoll

  • Sr. Member
  • ****
  • Posts: 54
Re: Modbus / PUBLISH issue?
« Reply #2 on: October 17, 2017, 07:57:24 PM »
See, BobO.  This is why I post, because you keep helping...

1.  Thanks, I'll look at SUBSCRIB - funny, I've never used it, yet I deal with Modbus devices all the time.

2.  You're right it's 10, the value changed from 9 to 10 when I took the screenshot, but I had 9 in my head.

One more question, the DoMore appears to be little-endian, that is, the first byte is the least significant, whereas Modbus is big-endian or 1st byte most significant, right?

Is Dmd manual available for download, either in PDF or CHM format?  I have only one PC which I can install the software but several where I'd like to have the manual available.

Thanks!!
« Last Edit: October 17, 2017, 08:02:12 PM by willpoll »

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: Modbus / PUBLISH issue?
« Reply #3 on: October 17, 2017, 08:06:07 PM »
Just think of SUBSCRIB as Modbus --> Do-more and PUBLISH as Do-more --> Modbus. Most of what PUB/SUB do can be manually done with MATH or MOVE or casts or etc, we just created PUB/SUB to put it into table form, clean up the conversions, and make the code self-documenting.

Do-more's processor (and most modern processors) is little-endian. Modbus really doesn't specify, but the processors it was originally developed for were big-endian. It's kinda all over the map these days, so that's why we support BYTE and WORD swapping independently in PUBLISH and SUBSCRIB.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

willpoll

  • Sr. Member
  • ****
  • Posts: 54
Re: Modbus / PUBLISH issue?
« Reply #4 on: October 17, 2017, 08:13:24 PM »
Thanks again BobO!  Good explanation as always.

My device doesn't specify, but it has floats stored in two consecutive 16-bit registers, they didn't come through correctly when I attempted to do a MRX directly into R type, which I've successfully done with other devices, so I assume it's not in the order that DoMore likes, hence the Publish/Subscribe debacle.

I'll give Subscribe a shot in the morning.

-Will

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3761
    • Host Engineering
Re: Modbus / PUBLISH issue?
« Reply #5 on: October 17, 2017, 08:16:35 PM »
Is Dmd manual available for download, either in PDF or CHM format?  I have only one PC which I can install the software but several where I'd like to have the manual available.

Here's a link to the manual page.  There is a link at the top to download it as a single .PDF
https://www.automationdirect.com/pn/doc/manual/DM-PGMSW

If you want the Help file, which is a .CHM file, just look at your install folder's HELP folder, e.g.
c:\Do-more\Designer2_1\Help\DmDesigner.chm
This is NOT the manual, but the HTML Help system.

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: Modbus / PUBLISH issue?
« Reply #6 on: October 18, 2017, 12:35:45 PM »
franji1 - while your first link seems to suggest that it is pointing to a manual for the Do-more software it redirects to here:

https://cdn.automationdirect.com/static/manuals/h2dmm/h2dmm.html

is that the PDF you intended?
« Last Edit: October 18, 2017, 12:39:53 PM by b_carlton »
An output is a PLC's way of getting its inputs to change.

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
Re: Modbus / PUBLISH issue?
« Reply #7 on: October 18, 2017, 01:15:50 PM »
franji1 - while your first link seems to suggest that it is pointing to a manual for the Do-more software it redirects to here:

https://cdn.automationdirect.com/static/manuals/h2dmm/h2dmm.html

is that the PDF you intended?

Seems to be the manual for me. I don't think there is a "software" specific manual.


franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3761
    • Host Engineering
Re: Modbus / PUBLISH issue?
« Reply #8 on: October 18, 2017, 01:18:53 PM »
franji1 - while your first link seems to suggest that it is pointing to a manual for the Do-more software it redirects to here:

https://cdn.automationdirect.com/static/manuals/h2dmm/h2dmm.html

is that the PDF you intended?

Actually, no.  :-\

Not sure where the Software User Manual would be.  I thought Designer's manual was just a "Quick Start" manual anyway, but that link obviously directs you to the hardware manual.

ADC Product Engineer

  • Hero Member
  • *****
  • Posts: 270
Re: Modbus / PUBLISH issue?
« Reply #9 on: October 18, 2017, 03:00:45 PM »
Right now it is in the BRX User manual.  We are discussing making it a separate item and linking to it from the other manuals.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: Modbus / PUBLISH issue?
« Reply #10 on: October 18, 2017, 03:53:39 PM »
Right now it is in the BRX User manual.  We are discussing making it a separate item and linking to it from the other manuals.

Narf!
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

willpoll

  • Sr. Member
  • ****
  • Posts: 54
Re: Modbus / PUBLISH issue?
« Reply #11 on: October 19, 2017, 11:35:23 AM »
Thanks again BobO, SUBSCRIB did exactly what I wanted.

franji1, I was able to copy the CHM file to my other computers, so I now have access to documentation without have to get on my field laptop. 

Thanks All