News:

  • July 02, 2026, 08:04:51 AM

Login with username, password and session length

Author Topic: PID setup fields  (Read 7593 times)

jeremyjo

  • Newbie
  • *
  • Posts: 4
PID setup fields
« on: June 17, 2015, 02:25:43 PM »
Is there a way to address the PID setup fields in a Do-More directly from a C-More screen? I'm using the Do-More driver in the screen but it won't accept PID0.SP as an address for use with the PID Faceplate Trend graph object.

I'd like to make the Gain, Reset, Rate, etc. editable from the screen, but moving the values to or from accessible memory locations seems to make it a one-way process that breaks autotune and PID setup from Do-More Designer.

I'm sure I'm missing something simple, but I have no idea what it is. This is my first foray into the Do-More ecosystem, so I'm not all that familiar with it yet.

Thanks!

-Jeremy

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3833
    • Host Engineering
Re: PID setup fields
« Reply #1 on: June 17, 2015, 04:05:30 PM »
I think not.  C-more does not understand user defined heap-items EDIT: or user defined data-blocks.

If you are using the Do-more driver, you should move it in and out via R (real) memory.

Then you have to be "smart" in your ladder logic, because you could be MONTIORING it or WRITING to it from your HMI...

I would recommend two sets of R's, one for "reporting" to your HMI (so read-only field on HMI), then have another set for "writing" from your HMI with a "button" event to cause a single WRITE.  I am not familiar enough with C-more do know how you would do this on the C-more side.  Let us know if this makes sense.
« Last Edit: June 17, 2015, 04:25:32 PM by franji1 »

PLCGuy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 677
Re: PID setup fields
« Reply #2 on: June 18, 2015, 12:47:17 AM »
Not that hard to do. You would want to write (send) a value to you plc program and put it in a memory location then move that to the pid memory. Use the handshaking to verify you did move the number correctly. It is not that hard to do. It will take some programming in the plc, but it does work.

jeremyjo

  • Newbie
  • *
  • Posts: 4
Re: PID setup fields
« Reply #3 on: June 18, 2015, 12:38:26 PM »
...I would recommend two sets of R's, one for "reporting" to your HMI (so read-only field on HMI), then have another set for "writing" from your HMI with a "button" event to cause a single WRITE...

The one-shot write was the part I missed. I had the move instruction wired on with an ST1 contact so it was constantly overwriting the PID settings. It was odd that after doing an autotune (which works pretty well), it was returning the values that were already there.

I don't suppose there's a way to move a group from say R0 through R9 to PID0.PV through PID0.MODE? If you can't tell, I'm used to the DirectSoft way of doing things where everything is mapped to a Vmem somewhere that you can move things into and out of using the normal instructions. I've got no issues with doing an individual move for each field, I'm just trying to avoid having to replicate those instructions for all the loops that need to be accessible from the C-More.

-Jeremy

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3833
    • Host Engineering
Re: PID setup fields
« Reply #4 on: June 18, 2015, 02:14:36 PM »
It appears you are using a block for your PID.  I would use a FOR/NEXT loop of your PID index using V100 (or some V) and then calculate the R index (using another V) from the PID index.

V100 is the PID data-block array index
FOR V100 0 to 9 // assuming 10 PID loops, PID0..PID9

put the R array index into V101, starting at R20 by groups of 4 (.Gain, .Reset, .Rate, .SampleTime) or 5 or 6 or whatever parms you are pushing), so R20, R24, R28...
MATH V101 "20 + (V100 * 4)"

// this is the cool part, using array indexing for both sides, and even using array index + offset!
MOVE R[V101] PID[V100].Gain
MOVE R[V101+1] PID[V100].Reset
MOVE R[V101+2] PID[V100].Rate
MOVE R[V101+3] PID[V100].SampleTime

NEXT