WinCC Flex recipes, calling ...

userxyz

Member
Join Date
May 2002
Location
any
Posts
2,768
I know that you can use LoadDataRecord..., it will load the record number u want.

But,

I want to save under a name and calling with a name...

I mean:

SaveDataRecord with a name like: Recepexcv787

And I want to be able to call the same Recepexcv787 with a string varible, not by the recipenumber...


Is this possible ?
 
I have not been able to do it. when I made my recipe search program I made two arrays putting the name in one and the number in another. That way I could search the name list and still get back to load the number.

If you find a way to do it let us know.
 
hmm

This is a real pitty, because I need this.

Depending on a productnumber, the right recipe should be loaded...


I have not been able to do it. when I made my recipe search program I made two arrays putting the name in one and the number in another. That way I could search the name list and still get back to load the number.

If you find a way to do it let us know.
 
Okay

Changed my way of thinking a little bit.
In the office I have a recipe/batching system with csv file's (import/export).

On the PLC side I will do it in a different way, so that I can connect to a varible from the batchsystem. Like CharlesM said, I did it with arrays.

I made DB's with arrays made of 15000 reals.
I've written a "write on empty space", "overwrite when exists", "fetch out of list".

This works


Code:
[FONT=Arial][SIZE=2]
[LEFT]FUNCTION_BLOCK FB1200

VAR_INPUT
SAVE_CORRECTIE: BOOL;
FETCH_CORRECTIE: BOOL; 
Active_Artikel: DINT;
END_VAR 

VAR 
MEM_SAVE: BOOL; 
MEM_FETCH:BOOL;
FETCHED: BOOL;
SAVED: BOOL;
PREV_ACTIVE: DINT;
Index_Store: INT; 
END_VAR

VAR_TEMP
SAVE_FLANK: BOOL;
FETCH_FLANK: BOOL; 
i: INT;
END_VAR 

 
BEGIN

SAVE_FLANK:= SAVE_CORRECTIE AND (NOT MEM_SAVE);
FETCH_FLANK:= FETCH_CORRECTIE AND (NOT MEM_FETCH);

//Bij oproepen van een nieuwe batch => status wissen
IF PREV_ACTIVE <> Active_Artikel THEN
FETCHED:= FALSE; 
SAVED:= False;
PREV_ACTIVE:= Active_Artikel;
END_IF;

// Ophalen uit database
IF FETCH_FLANK AND NOT FETCHED THEN
FOR i:=1 TO 15000 do
IF Active_Artikel = "Corr_Artikel".Index[i] THEN
"Correcties_Open".Hoek1:="Corr_Hoek1".Index[i];
"Correcties_Open".Hoek2:="Corr_Hoek2".Index[i];
"Correcties_Open".Unit1:="Corr_Unit1".Index[i];
"Correcties_Open".Unit2:="Corr_Unit2".Index[i];
"Correcties_Open".Hoogte:="Corr_Hoogte".Index[i]; 
FETCHED:= TRUE; 
END_IF; 
END_FOR;
END_IF;

// Opslaan in database
IF SAVE_FLANK THEN
IF NOT SAVED THEN
FOR i:=1 TO 15000 DO
IF "Corr_Artikel".Index[i] = Active_Artikel AND NOT SAVED THEN
"Corr_Hoek1".Index[i]:="Correcties_Open".Hoek1;
"Corr_Hoek2".Index[i]:="Correcties_Open".Hoek2;
"Corr_Unit1".Index[i]:="Correcties_Open".Unit1;
"Corr_Unit2".Index[i]:="Correcties_Open".Unit2;
"Corr_Hoogte".Index[i]:="Correcties_Open".Hoogte;
SAVED:= TRUE; 
END_IF; 
END_FOR;
END_IF; 
IF NOT SAVED THEN
FOR i:=1 TO 15000 DO
IF "Corr_Artikel".Index[i] = 0 AND NOT SAVED THEN
"Corr_Artikel".Index[i]:=Active_Artikel;
"Corr_Hoek1".Index[i]:="Correcties_Open".Hoek1;
"Corr_Hoek2".Index[i]:="Correcties_Open".Hoek2;
"Corr_Unit1".Index[i]:="Correcties_Open".Unit1;
"Corr_Unit2".Index[i]:="Correcties_Open".Unit2;
"Corr_Hoogte".Index[i]:="Correcties_Open".Hoogte;
SAVED:= TRUE; 
END_IF; 
END_FOR;
END_IF; 
END_IF; 

MEM_SAVE:= SAVE_CORRECTIE;
MEM_FETCH:= FETCH_CORRECTIE;

END_FUNCTION_BLOCK[/LEFT]
[/SIZE][/FONT]
 

Similar Topics

Hi, I've got a nasty job to do. I have very old TP 27 protool project that involves area pointers such as ACK, Data Mailbox, Interface Area and...
Replies
3
Views
5,985
If I have a panel and a PC runtime. But I don't buy the option for recipes on the PC... is it possible to control the recipesystem via tags...
Replies
1
Views
2,483
Hi all I have a project that uses a Siemens 315-2DP and two HMI's. The two HMI's are at separate ends of the line. One of the HMI's has a...
Replies
4
Views
2,952
Hi, I have an OP277. I need recipes... Very short explanation: I have 10 machines in a production line. Each machine can do actions...
Replies
0
Views
3,296
I'm continuing my Siemens education. I need some help with compatibility details. My customer has a machine that was made by a company no longer...
Replies
6
Views
4,039
Back
Top Bottom