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

TOPIC: Proview Project creatino headless

Proview Project creatino headless 5 years 5 months ago #9974

  • Snarf77
  • Snarf77's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 847
  • Thank you received: 2
  • Karma: 5
Hello Claes,

I'm trying to configure my various proview project with the same kind of options for easy debugging (I mean NodeConfig option or BuildOptions to be always the same) which are today created by each developper independantly

To avoid diffrent options according to differnt coder, I would like to create the project automatically based on a LibreOffice Calc sheet gathering the number of plc I want (ie the number of RootVolume) and then let the coder only deals with the RootVolume once created.

I have tried to do this in a script and at the moment, I automatically created the Project_list.dat and the directory.wb_load with all my desired nodeconfig but I failed on RootVolume creation.

What function do you use behind the proview wizard to create a rootvolume with a given volume id (assuming its unique and correct of course) ? I'm lost in the wb_cmd source files but can't find what I'm looking for.

Is what I intend to do possible ? or am I on complex track ?

Thanks for your help in advance

[EDIT]
It looks like a simple directory .db creation and an insertion in the global volume list .dat file is sufficient.
I will try to reload the database from a basic skeleton .wb_load to check if volume recovers correctly from scratch.
[/EDIT]

Snarf
Last Edit: 5 years 5 months ago by Snarf77.
The administrator has disabled public write access.

Proview Project creatino headless 5 years 5 months ago #9975

  • Snarf77
  • Snarf77's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 847
  • Thank you received: 2
  • Karma: 5
It looks that I'm stuck for tonight there:
- How can you save a classvolume from a .wb_load file using wb command or equivalent ?

Beacause my rootvolume reload phase fails because of unknown class contained in classvolume (normal)
I need to save my classvolume and probably build it before to reload the rootvolume database but I don't know how to do it ?
Can someone help ?
Thx

Snarf
The administrator has disabled public write access.

Proview Project creatino headless 5 years 5 months ago #9977

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

A class volume is stored in a wb_load file so it already is in it's "stored" format. You only have to create or copy the wb_load file to $pwrp_db and create a ClassVolumeConfig object in the directory volume.

A dbs-file for the class volume is created with the wb command 'create snapshot'

pwr> create snapshot /file="$pwrp_db/myclassvolume.wb_load" /out="$pwrp_load/myclassvolume.dbs"

and the structfile with the shell command

> co_covert -so -d $pwrp_inc $pwrp_db/myclassvolume.wb_load

See $pwr_exe/reload.sh how this is used.

If you configure the directory volume I think it's 'save /quite' that creates all databases without any questions. Take a look in the directory volume wizard $pwr_exe/wb_wiz_directoryvolume.pwr_com.

Maybe you need a combination of shell script and pwr_com script to achieve what you want, but I'm sure it's possible.

/Claes
The administrator has disabled public write access.

Proview Project creatino headless 5 years 5 months ago #9978

  • Snarf77
  • Snarf77's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 847
  • Thank you received: 2
  • Karma: 5
Hi Claes,

Thank for help.
I still have three issues:
1) co_convert seems to proceed without error (I tested the return value like in reload.sh and I didn't get any wrong return value) but I have nothing created in $pwrp_inc ? What could be wrong ?
Thus my reload dump file still fails but without the struct file I'm not surprised at all. Do you confirm this is this struct file that is required by proview to be aware of existence of module that will be reloaded ?

2) I couldn't use any $pwrp_ alias as I can't use sdf in my script (it doesn't look to work inside a bash script).(note: If I did externally on my newly created project, it works so it not an issue with the content or structure of the project).
I wanted as a workaround to reproduce the beahvior of sdf command by adding alias in my script but I couldn't locate sdf command source or script ?

3) I had a look in wb_wiz_directoryvolume.pwr_com but as far as I can remember the mentionned "save" function is useful only if you add element to db using script (as you do in this pwr_com script with create object and so on). In my case, I planned to simply declare the volume (keep empty / unconfigured) and then to reload a dump file with basic content (skeleton) using wb_cmd wb load /load=\"mydumpfile\".
I guess in this case save/quiet in useless but can you confirm ? Is my method not appropriate ?

Thank you
Snarf
The administrator has disabled public write access.

Proview Project creatino headless 5 years 5 months ago #9979

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

1) Only the dbs-file is needed to load the dump. The struct file is only used when compiling the plc.

2) In $pwra_db/pwr_setup.sh

3) I don't understand what you mean. Are you planning to create the project without configuring the directory volume? You have to create a RootVolumeConfig object, and you also need to create a ClassVolumeConfig for the class volume to ensure that the dbs-file for the class volume is loaded when wb is started. If you save with /quiet you don't need to confirm, and an empty database for the root volume is created. 'wb load' will load into the empty database.

/Claes
The administrator has disabled public write access.

Proview Project creatino headless 5 years 5 months ago #9980

  • Snarf77
  • Snarf77's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 847
  • Thank you received: 2
  • Karma: 5
1) OK thx, so I will need the add the create snapshot option in that case as you mentionned already

2) Thank you

3) Indeed, the ClassVolumeConfig and RootVolumeConfig are within the directory volume not in the rootvolume (right ?)
I already configure the directory volume by writing directly inside directory.wb_load file so those object appears correctly when I open the project. Now I want to open the rootvolume, this is where I am for the moment and it remains empty until I will be able to load the dump file.

This is only the rootvolume itself that I would like to initialize with default variable and PLCPgm using a reload from a dump file. (But all the volume .db directory will be empty at that moment)

Hope this is more clear (and not too stupid ..)

Snarf
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Time to create page: 9.046 seconds