Welcome, Guest
Username: Password: Remember me

TOPIC: handling valve operation in PLC

handling valve operation in PLC 5 years 4 months ago #10066

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3173
  • Thank you received: 499
  • Karma: 133
Hi Trygve and barnes,

Most configuraion values, as the BaseMValve.Node.OpAutoOnly can be set in the configurator. Otherwise you can use the FirstScan object and connect it to SetDp or CStoAp to set values at startup. In the BaseMValve case you can set Mode.OpAuto to simulate a click on the Auto button.

If you want realtime performance you should use the plc objects, and not gdh_GetObjectInfo and similar. Most gdh function uses a database lock and can be forced to wait for processes with lower priority.

About the switch statement I can't see anything wrong. If you compile the PlcPgm with debug, the generated c-code is kept on $pwrp_tmp and you can see which line the compiler is complaining about.

/Claes
The administrator has disabled public write access.

handling valve operation in PLC 5 years 4 months ago #10067

  • TrygveHe
  • TrygveHe's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 42
  • Karma: 0
Hi and thank you for the reply.

If you specify OpAutoOnly in the configurator will you then disable the possibility to set the valves in manual? I will need that option.

How can I use SetDp or CStoAp to set the valve in auto? The function block for BaseMValve does not have an input for OpAuto, does it? Do you have an example of how this can be done?

Regards
Trygve
The administrator has disabled public write access.

handling valve operation in PLC 5 years 4 months ago #10069

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3173
  • Thank you received: 499
  • Karma: 133
Right, only Auto is available with OpAutoOnly set.

Any attribute is reachable with a Get, Set, Res or Sto,

firstscan.png


/Claes
The administrator has disabled public write access.

handling valve operation in PLC 5 years 4 months ago #10070

  • TrygveHe
  • TrygveHe's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 42
  • Karma: 0
As simple as that.
Thanks a lot.

Trygve
The administrator has disabled public write access.

handling valve operation in PLC 5 years 4 months ago #10071

  • barnes
  • barnes's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 92
  • Karma: 0
Its always simple when you know the answer. :)

Thanks for the debug hint. The switch statement works fine when you fix the syntax errors.

I will also use the first scan block, very good.
The administrator has disabled public write access.

handling valve operation in PLC 5 years 4 months ago #10072

  • barnes
  • barnes's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 92
  • Karma: 0


For completeness and future reference CArithm blocks with three state HOA and open/close or stop/start functions.
Last Edit: 5 years 4 months ago by barnes.
The administrator has disabled public write access.
Time to create page: 8.048 seconds