Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Constants in PLC Program

Constants in PLC Program 13 years 11 months ago #762

  • dannyboi83
  • dannyboi83's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 40
  • Karma: 0
Hi,

I am developing a PLC with the need for some constants, when looking around the documentation I am unable to find how to do this so I have tried to use an analogue input setting the initial value to the desired constant. This will work but every time I build the program and run it the constant go to some random number. Is there any other method that I can use for this as it is not very practical to change the values manually before each test.

Regards
Dan
The administrator has disabled public write access.

Re:Constants in PLC Program 13 years 11 months ago #763

  • nylund
  • nylund's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 11
  • Karma: 0
Hi Dan
Use an object of type Analog Value(Av) and set InitialValue in the development environment.

/Nylund
The administrator has disabled public write access.

Re:Constants in PLC Program 13 years 11 months ago #764

  • dannyboi83
  • dannyboi83's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 40
  • Karma: 0
Thank you for the tip, I have tried changing from an Ai to Av but I am still getting two of the voltages changing in value each time when I run the program. I should also let you know that they are also changing to a specific value each time. Is there anyway in which I can stop this happening?

Dan
The administrator has disabled public write access.

Re:Constants in PLC Program 13 years 11 months ago #771

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3178
  • Thank you received: 502
  • Karma: 133
Hi Dan,

I assume you are running the 4..7.0-1 release in which there is an InitialValue bug. We will build a new release where this is fixed. Until then you can use pwrp_alias to set initial values. Create $pwrp_cnf/pwp_alias.dat and write lines like

mynode_setvalp H1-H2-MyAv. ActualValue = 25

where mynode is the current node. The file is copied to $pwrp_load when the node is built from where it's read at Proview startup. See Designer's Guide Navigating the project/Special files for more info. Note that you have to use setvalp not setval.

/Claes
The administrator has disabled public write access.

Re:Constants in PLC Program 13 years 10 months ago #795

  • dannyboi83
  • dannyboi83's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 40
  • Karma: 0
Hi Claes,

Just a quick note on this, I have made the file in the correct location but still this does not work. My node is Processcontrol, and the plant heir is TempControl where the Av value 1VConst is so in the file I write:

Processcontrol_setvalp TempControl-1VConst.ActualVal = 1

This still does not set the value, and it keeps defaulting back to 0. Any pointers here? Is the structure right?

I have included a screenshot of my configurator if that helps.

Dan

Attachment Screenshot_PwR_VolProcesscontrol____pwrp_on_processcontrol_3.zip not found

Attachments:
The administrator has disabled public write access.

Re:Constants in PLC Program 13 years 10 months ago #796

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3178
  • Thank you received: 502
  • Karma: 133
Hi Dan,

You should write the network nodename, not the name of the nodeobject.

/Claes
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Time to create page: 8.635 seconds