String copy using SCF 20 in an FC

Werner

Member
Join Date
Apr 2005
Location
IJsselstein
Posts
336
Does anybode know whats happening here?

I have an FC that gets the name of a product type. As input I have product nr (INT). As output of the function I have an any pointer to the name of the product name (STRING[10]). I am using SFC 20 (Block move) to copy the name from a DB to a other DB for display usage.

This works:

Code:
	 CALL SFC 20
	 SRCBLK :=P#DB15.DBX0.0 BYTE 12
	 RET_VAL:=#Return
	 DSTBLK :=P#DB16.DBX0.0 BYTE 12

This does not work:

Code:
	 CALL SFC 20
	 SRCBLK :=P#DB15.DBX BYTE 12
	 RET_VAL:=#Return
	 DSTBLK :=OUT_ANY_OF_FC // This is not allowed?

I must be missing something?!
 
According to Berger, complex parameter types at inputs or outputs (as opposed to elementary parameter types) can only be passed on to other block calls if the calling block is a function block.
 
SimonGoldsworthy said:
According to Berger, complex parameter types at inputs or outputs (as opposed to elementary parameter types) can only be passed on to other block calls if the calling block is a function block.

I was trying to avoind using FB's because of all the DB's that are generated by it. Thanks for the answer.
 
Why not use multiple instances - that way you only have use one DB. You have to update the blocks "up the chain" if you make an interface change but this soon becomes second nature if you are doing it regularly.
 

Similar Topics

Hello Inside a FB, I´m trying to transfer a string from a DB to a IN_OUT var that was define as a UDT. The problem is that i can´t determine the...
Replies
4
Views
122
I feel like I'm going crazy, new to Siemens, coming from AB, and I cannot get a dang string copied in SCL. This is a S7-300, V16 PLC. I have a...
Replies
10
Views
3,454
HI Guys So i am trying to write a real SINt or DINT value into a string tag. If in string browser I write it manually, no problem. But how can I...
Replies
8
Views
5,893
I am using v14 with a 1215 dc/dc/dc. I need to copy a 50 element array of strings to another 50 element array of strings. I can work it out for...
Replies
3
Views
4,006
I'm guessing there is a simple way to do this, but I'm not very experienced with timers, so maybe one of you can help me out. I have two string...
Replies
7
Views
2,082
Back
Top Bottom