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

TOPIC: Parameter Table

Parameter Table 12 years 1 month ago #3416

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

There was already one question concerning the management of array of data but I prefere to raise the question from a functionnal point of view in order to have perhpas a workaround solution.

I have a modbus link to another equipement (can be proview or else) (with my proview plc acting as master) that must be able to set some parameters of my internal plc pgm.

As there will be more than hundred paramaters the idea is not to manage them one by one but rather with a address / value based access. In the software I will then use Param in the code rather that having to declare and initialise Param1234.

I alwo would like to be able to initialise this table or data at proview startup and I saw some object DataFRead and DataFwrite that look more or less to what I'm looking for but it is not clear for me how to use this. Can someone supply a basic example with two or three parameters for a particular data. Does this data require to to be declared as class ??

What are the different way in proview to manage this kind of addressing ? I also saw in the plc some object named NMps I can't find good documentation on it so I don't know if this can be a solution or not ?

Many thanks for any feedbacks from those who have encounter this question.

Best regards

Snarf
The administrator has disabled public write access.

Re: Parameter Table 12 years 1 month ago #3420

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

There is an example of DataFRead and DataFWrite here http://www.proview.se/doc/en_us/man_exlib_exlib_datafread.html
although not exactly the way you want to use it. The DataFRead and DataFWrite reads and writes the content of one object from /to a file. You fetch a pointer to the object with the GetData which is connected to the Data inputs of the DataFRead and DataFWrite. The Condition input is used to trigger a read or write.
An alternative is to set initial values in the configurator and use the backup to keep modifications after a restart.

To fetch an element from an array attribute in the plc you use the GetAp, GetIp or GetDp. It is also possible to fetch a pointer to the object the contains the array with a GetData object, and connect it to a DataArithm object. Then you can access the content of the object in the code with for example Da1->Param.

Note that if you plan to use the new Bi and Bo signal arrays, these doesn't contain the values itself, but pointers to the values that are stored in area objects. In this case you use GetBiFloat32, GetBiInt32 etc to fetch the values. These signal arrays can not be used in the code of DataArithm objects.

I don't think NMps is what you are looking for. The only documentation about NMps is the one in object reference manual.
Here is a short description I've copied from a previous thread.

NMps is a simple material planning system integrated with the plc-program. We use NMps to keep track of the plates in the plant and to fetch data from them the as input to the control system. When a plate arrives to the plant, data is fetched from a level 3 system and a plate object is created in the realtime database, containing data for the plate. A reference to the plate object is inserted into a NMpsCell and can be transported to other cells as the plate is moved through the plant. As NMpsCell is a function object in the plc editor, data from the plates in a cell can be extracted and input to logical and analog functions objects and affect the control. Finally the plate object is transported to an NMpsOutCell when the plate leave the plant. The only documentation is the one in object reference manual, but I don't think this is what you are looking for.

/Claes
Last Edit: 12 years 1 month ago by claes.
The administrator has disabled public write access.

Re: Parameter Table 12 years 1 month ago #3436

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


Thanks for answers. I saw the link you pointed me at but I didn't know the link between the Data strcuture and what we see on the drawing. I mean is the Data, the full piano with one attribute per key or only the values displayed on the top right of the display ? I understood the principle but wanted to understand better how to handle it ie what is the Data structure wihtin the object manager that correspond to this example.


Concerning the array I thought about it but for the moment my "table" is not separated from interger or float. It is a table of 32bits data which can be floats or integers ... That's why I was looking for a "neutral" format which can be casted after extraction.

One related question to both previous answer is can an Array be managed as a Data object ? ie Can I use the DataFRead and FWrite for an array which can be very interesting to me.


Concerning NMps thank for answer, it is obviously not the answer to my need but I think this can useful for other things. Will probably come back later on that item :-)

At last, do you have further information concerning Bi and Bo (any doc ? or example ?).


Thanks for answering me

Regards

Snarf
The administrator has disabled public write access.

Re: Parameter Table 12 years 1 month ago #3440

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

It's only the sound setting from a Sound object (http://www.proview.se/doc/en_us/orm/pwrb_sound.html) that is stored in the file. If you want to store an array with DataFRead you have to store the whole object that contains the array. Individual array attributes can't be stored separatley.

If you need to type cast the array elements you have to use a DataArithm and do the type casting in the c-code. The GetAp and GetIp object makes a type check so you can't fetch an element declared as an integer with a GetAp.

There is a short description of Bi and Bo in Release Nodes V4.8. Here is also an example of how to read and write an integer array with modbus.

/Claes
Attachments:
Last Edit: 12 years 1 month ago by claes.
The administrator has disabled public write access.

Re: Parameter Table 12 years 1 month ago #3441

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

Thanks for information.

I just have a look at the release note v4.8 and ... Wow Great Work !!

I think I will upgrade soon to discover your new Bi/Bo object and your report function seems really a good one.

I hope I will be able to seperate my integer / float data table to be able to use Bi / Bo as you described.


Congratulations again

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