Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: willpoll on October 17, 2017, 07:17:43 PM

Title: Modbus / PUBLISH issue?
Post by: willpoll 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!!
Title: Re: Modbus / PUBLISH issue?
Post by: BobO 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.
Title: Re: Modbus / PUBLISH issue?
Post by: willpoll 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!!
Title: Re: Modbus / PUBLISH issue?
Post by: BobO 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.
Title: Re: Modbus / PUBLISH issue?
Post by: willpoll 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
Title: Re: Modbus / PUBLISH issue?
Post by: franji1 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.
Title: Re: Modbus / PUBLISH issue?
Post by: b_carlton 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?
Title: Re: Modbus / PUBLISH issue?
Post by: Evilbeard 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.

(https://i.imgur.com/oE4ER2K.png)
Title: Re: Modbus / PUBLISH issue?
Post by: franji1 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.
Title: Re: Modbus / PUBLISH issue?
Post by: ADC Product Engineer 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.
Title: Re: Modbus / PUBLISH issue?
Post by: BobO 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!
Title: Re: Modbus / PUBLISH issue?
Post by: willpoll 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