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

TOPIC: Data Objects and NMps

Data Objects and NMps 6 years 10 months ago #8955

  • FoxMan
  • FoxMan's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 23
  • Thank you received: 10
  • Karma: 3
Hi All,

while developing a Proview-System for an assembly line, I encountered a problem with the handling of data objects:

I’ve created a Classvolume “CvolMyFactory”, with a class “Order” and two classes (Object and Functionobject) for a conveyor belt. The main object for the conveyor has an attribute “Order” of class Order.
Inside of the conveyors function object I use Nmps:DataCopy. The “To” input is connected to the $PlcMain.Order attribute (this part works) and now I’m trying to connect the “From” to an input ($PlcFo:OrderIn) for example of type “GetData” or “GetRefData”. But I can’t get it work. What ever I tried, I get messages like:

-- Opening volume 'VolTaktstrasse'
-- Build node prvweng002
-- Plc window generated Taktstrasse1-PLC0001-W
-- Plc window compiled for x86_64_linux optimized -O3 Taktstrasse1-PLC0001-W
In file included from /usr/local/pwrp/taktstrassev2/bld/common/tmp/plc_m000_001_001_001_00000019.gc:16:0:
/usr/local/pwrp/taktstrassev2/bld/common/tmp/plc_ref000_001_001_001_00000019.gc: In function ‘M000_001_001_001_00000019_init’:
/usr/local/pwrp/taktstrassev2/bld/common/tmp/plc_ref000_001_001_001_00000019.gc:5:37: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
Z000_001_001_001_0000001b->AuftragP = &Z000_001_001_001_00000293->Out;
^
/usr/local/pwrp/taktstrassev2/bld/common/tmp/plc_ref000_001_001_001_00000019.gc:10:37: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
Z000_001_001_001_0000001c->AuftragP = &Z000_001_001_001_00000296->Out;
^
%GSX-W-CCWARNING, Warning from c compiler or linker
in window Taktstrasse1-PLC0001-W
%GSX-E-REFPARTYPE, referenced parameter type is not correct
in object Taktstrasse1-PLC0001-W-BandFo0-W-GetRefData33
%GSX-F-CWINDERR, compile errors, no object file produced
1 errors in window Taktstrasse1-PLC0001-W-BandFo0-W
%GSX-E-REFPARTYPE, referenced parameter type is not correct
in object Taktstrasse1-PLC0001-W-BandFo0-W-GetRefData33
%GSX-F-CWINDERR, compile errors, no object file produced
1 errors in window Taktstrasse1-PLC0001-W-BandFo0-W
%GSX-E-REFPARTYPE, referenced parameter type is not correct
in object Taktstrasse1-PLC0001-W-BandFo1-W-GetRefData33
%GSX-F-CWINDERR, compile errors, no object file produced
1 errors in window Taktstrasse1-PLC0001-W-BandFo1-W
-- Plc plcpgm compiled for x86_64_linux optimized -O3 Taktstrasse1-PLC0001

In the Designer’s Guide on page 196 I found: “The input <for an Fo Object> can be of
type Boolean, Float32, Int32, String80, Time, DeltaTime or of datatype (pointer to Float32).”
If this is state of the art I can’t succeed (this way).

The idea behind all that is, that I want the Order data to move with the conveyor belts.

Looking for an answer, I found an old thread on the forum:

www.proview.se/v3/index.php/forum/4-proview-forum/548-nmps#8635

This assumes, that NMps is the way to archive my goal. I played around with NMps but have no idea on how to use it.

Claes,
can you give me advice or an example of NMps usage? I’m wondering why it isn’t used (more often) by others, because I believe NMps is Proview’s big advantage over all other PLC systems.

I’m working with V5.5 on Ubuntu 16.04 LTS.

Thanks in advance
The administrator has disabled public write access.

Data Objects and NMps 6 years 10 months ago #8957

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3170
  • Thank you received: 497
  • Karma: 133
Hi FoxMan,

A data input nowadays usually has the TypeRef pwrs:Type-$Void, and the Pointer and Private bits should be set in Flags.

The input is fetched in the template plc code with a GetDataInput.

I wrote this on the forum some years ago but still haven't made any examples...

/Claes
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 leavs the plant.

As the plate objects are dynamic object (they are created in runtme), it's a bit tricky to show the content of a cell in a graph. The CellDisp objects are use for this. They collect data from different cell objects and makes it possible to display the contents of cells and plate objects in a Ge table.

There is also a c api to fetch the cell content to an application program (See NMpsAppl in the Programmer's reference guide).

Maybe I could put together some examples of how to use it if you are still interrested.
The administrator has disabled public write access.

Data Objects and NMps 6 years 10 months ago #8958

  • FoxMan
  • FoxMan's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 23
  • Thank you received: 10
  • Karma: 3
Hi Claes,

many thanks, it worked like a charm. There is only a small problem regarding the visibility of the $input parameter in the class template. As soon as I set the pointer flag, the parameter doesn't show up in the template any longer. My workaround is to link the parameter in the PLC program and set the pointer flag afterwards.

Now I'm wondering, how to achieve the same with data output. I configured $output with TypeRef:=pwrs:Type-$Void and flags Pointer and Private. But now I'm missing something like "SetDataOutput" to link the output in the PLC code from the template.

Any suggestions?

Thanks in advance
The administrator has disabled public write access.

Data Objects and NMps 6 years 10 months ago #8960

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3170
  • Thank you received: 497
  • Karma: 133
You are right, the SetDataOutput is missing. The reason is probably that it's very seldome you need it. Normally you just make data settings into the data objects, and they are immediately accessible by the caller, so you don't have to put them on an output. It's only when you select one data object from several that you need an output.

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