News:

  • May 03, 2024, 01:30:13 AM

Login with username, password and session length

Author Topic: Parameterized network master instructions  (Read 35487 times)

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3561
  • Darth Ladder
Re: Parameterized network master instructions
« Reply #30 on: June 27, 2013, 02:25:49 AM »
It is one thing to add a compiler to a PC...we have one of those called Do-more Designer. ;) It is a far, far different thing to add such to the PLC itself.

Is this also an issue for paramaterizable function calls and expressions everywhere a variable will go?

Quote
We originally thought about the MOVE(single reg)/ASSIGN as just shorthand for LD/OUTW...then realized that when we make every qualified input parm into an expression (coming later), that functionally, MATH == ASSIGN/MOVE(single reg). It was at that point that we started thinking of MOVE as a multi-register table function...COPY if you will...and we're not really sure what to do with MATH/ASSIGN/MOVE(single reg). So we did nothing...which I find to be the best choice given no better alternative.
« Last Edit: June 27, 2013, 07:29:16 AM by franji1 »
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 5991
  • Yes Pinky, Do-more will control the world!
Re: Parameterized network master instructions
« Reply #31 on: June 27, 2013, 02:44:57 AM »
Anything that can take a variable has the capacity to take an expression, and we have tried to make virtually everything take variables. So the only limitation will be us deciding where to allow expressions. Callable functions will work fine for the same reason expressions work.

This one particular case we chose to use constants only to simplify entry, to allow us to bounds check, and to offload some of the work from the CPU to DmD by preprocessing. Truthfully, it made great sense for the DL instructions, but not as much for Modbus. We designed the DL instructions first though, then modified for Modbus, and once designed we try to stick to repeatable patterns for the same reasons you guys do. It just never crossed our mind that we were doing a Very Bad Thing. It's fixed now.
"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

CReese

  • Hero Member
  • *****
  • Posts: 184
Re: Parameterized network master instructions
« Reply #32 on: June 27, 2013, 10:50:06 AM »
Ok...done and lightly tested, and it works great. Currently allows for any valid integer variable or array reference in MRX and MWX boxes. As was previously mentioned, DmD does some protocol translation for DLRX and DLWX, so we aren't doing them at this point. Given that most of our stuff speaks Modbus as well as DL, that shouldn't be too limiting.

Prior to this change, we were likely going to release 1.1 within a few days, but I think we need to do another release candidate and kick the tires a bit more. Barring critical problems in general, it will likely be late next week for final release.

Super. Thanks for your timely help.

IP isn't one of the parameters, is it?

CReese

  • Hero Member
  • *****
  • Posts: 184
Re: Parameterized network master instructions
« Reply #33 on: June 27, 2013, 10:59:55 AM »
So back to the application question: given the capability of DoMore PLCs, an attached PC, and network access, how would you PLC gurus set up logging and periodic network upload?

What is a good PC/PLC interface that will play nice with DoMores and make configuration a snap?

While I'm asking, are there any linux apps or drivers for DoMores?

Ideally we could see tag names rather than having to do straight MODBUS and enter a map.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3665
    • Host Engineering
Re: Parameterized network master instructions
« Reply #34 on: June 27, 2013, 11:21:35 AM »
So back to the application question: given the capability of DoMore PLCs, an attached PC, and network access, how would you PLC gurus set up logging and periodic network upload?

What is a good PC/PLC interface that will play nice with DoMores and make configuration a snap?

While I'm asking, are there any linux apps or drivers for DoMores?

Ideally we could see tag names rather than having to do straight MODBUS and enter a map.
I would definitely use TCP.  If the Do-more is initiating the data (e.g. Do-more is logging events), use OPENTCP to your PC's IP Address on an unused TCP port, then use one or more STREAMOUTs, followed by CLOSE to terminate the TCP connection.

If the Do-more is passive and waiting for some recipe data from some PC app, use the TCPLISTEN instruction on a specific port, then use 1 or more STREAMINs, waiting for the other side to close the TCP connection (by monitoring a bit in the TCP Server structure in your Do-more).

UDP can also be used, if you want more of a serial type interface (uses PACKETIN/PACKETOUT), or use serial ;D (built-in or H2-SERIO module, which uses STREAMIN/STREAMOUT).

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 5991
  • Yes Pinky, Do-more will control the world!
Re: Parameterized network master instructions
« Reply #35 on: June 27, 2013, 12:50:20 PM »

IP isn't one of the parameters, is it?

It wasn't, but that was one we already wanted to do, so we are going to go ahead and do it.
"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

plcnut

  • Hero Member
  • *****
  • Posts: 803
    • premiersi.com
Re: Parameterized network master instructions
« Reply #36 on: June 27, 2013, 01:08:23 PM »
So back to the application question: given the capability of DoMore PLCs, an attached PC, and network access, how would you PLC gurus set up logging and periodic network upload?

What is a good PC/PLC interface that will play nice with DoMores and make configuration a snap?

While I'm asking, are there any linux apps or drivers for DoMores?

Ideally we could see tag names rather than having to do straight MODBUS and enter a map.

If you really want to learn, and make a powerful configuration tool, then see this example: http://forum.hosteng.com/index.php/topic,1117.0.html

This server has the ability to display and/or modify any memory area in the Do-more via html and JavaScript coding and GET (or otherwise delimited) variables. I have many more examples I have used for myself, but each part is so custom that you really can't just throw together an example that shows all of the possible uses. The possibilities are close to endless. If you attempt to use this sample and run into trouble, I will try to help if time allows.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

CReese

  • Hero Member
  • *****
  • Posts: 184
Re: Parameterized network master instructions
« Reply #37 on: June 27, 2013, 01:47:16 PM »
So back to the application question: given the capability of DoMore PLCs, an attached PC, and network access, how would you PLC gurus set up logging and periodic network upload?

What is a good PC/PLC interface that will play nice with DoMores and make configuration a snap?

While I'm asking, are there any linux apps or drivers for DoMores?

Ideally we could see tag names rather than having to do straight MODBUS and enter a map.

If you really want to learn, and make a powerful configuration tool, then see this example: http://forum.hosteng.com/index.php/topic,1117.0.html

This server has the ability to display and/or modify any memory area in the Do-more via html and JavaScript coding and GET (or otherwise delimited) variables. I have many more examples I have used for myself, but each part is so custom that you really can't just throw together an example that shows all of the possible uses. The possibilities are close to endless. If you attempt to use this sample and run into trouble, I will try to help if time allows.

When I heard js, my interest was piqued. Have been doing a lot of sql and js in my other business. It would be excellent if I could negotiate an sql-type dump of all memory, or simply direct-reading all memory into an sql database on the PC periodically. I could then use js on the PC side to parse the sql into something pretty for the user, or just ssh in to retrieve the dump.

On the above, however, I'd prefer to run a 'nix box for security and familiarity sake. All I'd really need is a "read all memory" command that I could parse into a database. I suppose there have to be all sorts of MODBUS TCP/IP drivers out there for linux.

CReese

  • Hero Member
  • *****
  • Posts: 184
Re: Parameterized network master instructions
« Reply #38 on: June 27, 2013, 01:48:22 PM »
and here we go ... http://www.freemodbus.org/

CReese

  • Hero Member
  • *****
  • Posts: 184
Re: Parameterized network master instructions
« Reply #39 on: June 27, 2013, 01:50:39 PM »

IP isn't one of the parameters, is it?

It wasn't, but that was one we already wanted to do, so we are going to go ahead and do it.

Now we're cooking with fire.

I promise code excerpts if there is an easy way to do so once I get everything nailed down.

plcnut

  • Hero Member
  • *****
  • Posts: 803
    • premiersi.com
Re: Parameterized network master instructions
« Reply #40 on: June 27, 2013, 02:00:11 PM »
The only problem with MODBUS (also part of what makes it good...) is that it is restricted to only being able to read what you put into the Do-more MODBUS registers(correct me if I misunderstand on this one). The beauty of the custom protocol/webserver, is that you STREAMOUT any and every memory area you like, and in the order you like... to whatever you like.
It is seriously very cool!

BTW: Using a php script and the String/STREAM instructions, I am able to dynamically update an entire MySQL database from my Do-more at the press of a button... on a webpage... from anywhere...
« Last Edit: June 27, 2013, 02:03:06 PM by plcnut »
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

CReese

  • Hero Member
  • *****
  • Posts: 184
Re: Parameterized network master instructions
« Reply #41 on: June 27, 2013, 02:52:43 PM »
The only problem with MODBUS (also part of what makes it good...) is that it is restricted to only being able to read what you put into the Do-more MODBUS registers(correct me if I misunderstand on this one). The beauty of the custom protocol/webserver, is that you STREAMOUT any and every memory area you like, and in the order you like... to whatever you like.
It is seriously very cool!

BTW: Using a php script and the String/STREAM instructions, I am able to dynamically update an entire MySQL database from my Do-more at the press of a button... on a webpage... from anywhere...

Ok, so unlike the DL series, you can't just attempt a read + offset from particular registers. You have to have it mapped. I had not yet wrapped my head around the implications of that. Interesting. Much more powerful.

That's neat and interesting. I'm not sure I want to insert that functionality into the PLC. My instinct would be to port some other code I've used to have js/ajax to pass to/from python scripts that run sqlite or mysql queries on the database that lives on the server. This way any barfing I do server-side is isolated from the PLC. I stay as far away from php as possible. phpmyadmin and phpliteadmin are nice tools, but I don't touch the stuff aside from that. No need to these days.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 5991
  • Yes Pinky, Do-more will control the world!
Re: Parameterized network master instructions
« Reply #42 on: June 27, 2013, 02:56:32 PM »
Ok, so unlike the DL series, you can't just attempt a read + offset from particular registers. You have to have it mapped. I had not yet wrapped my head around the implications of that. Interesting. Much more powerful.

Not sure I understand the comment, which I assume refers to plcnut's server sample. There are additional levels of indirection available in Do-more that were not in DL, but I don't think we removed any. Can you elaborate?
"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

CReese

  • Hero Member
  • *****
  • Posts: 184
Re: Parameterized network master instructions
« Reply #43 on: June 27, 2013, 03:26:44 PM »
Maybe I'm missing something, but in the DL series, if you wanted to read a Vmem location, you found the address, calculated the offset from the beginning of the address block, converted number formats, and send a modbus read. There is no mapping required.

What I understood from the previous comment (and what makes sense, give the editable memory blocks and references), is that you have to explicitly map address locations to exposed modbus addresses. Is this correct?

plcnut

  • Hero Member
  • *****
  • Posts: 803
    • premiersi.com
Re: Parameterized network master instructions
« Reply #44 on: June 27, 2013, 03:37:58 PM »
Not sure I understand the comment, which I assume refers to plcnut's server sample. There are additional levels of indirection available in Do-more that were not in DL, but I don't think we removed any. Can you elaborate?

If I create a data block called "MyBlock", I cannot use a MODBUS read from another PLC(or PC) to reference that block. I would have to use MOVE(R)/MEMCOPY to move MyBlock to another memory area accessible by MODBUS.

Correct? (I have never gotten deep at all into MODBUS)
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com