10/24/2018 5:06 PM | |
Joined: 12/12/2015 Last visit: 6/30/2022 Posts: 7 Rating:
|
Hello I write function block for servodrives control. See Ctrl_Servo.txt file. It works good, I set SP_S (in mm) and SP_V (speed in mm/s) and I set to 1 bit named "is_TO_POS" - it is start bit for movement begining. Or I set bits is_JOG_forward and is_JOG_backward for manual control (via button on machine panel). But it works for only one servodrive, because FB don't contains any DBs inside.There are all DBs outside my FB and I can to create only one instance DB of my FB, because this function call MC_Power, MC_Home and other functions for external DBs (MC_Power_DB, MC_Home_DB etc.) and it use external technology object - Axis_1.I want to include DBs to my FB. I can create static variables inside DB as instances DBs of MC_Power, MC_Home functional blocks etc. It is not problem. But, how to create internal DBs for technology objects (Axis)? I cannot creating variable with type of DB for TO_PositionAxis. How include it into my FB? I read Siemens instruction "Advantages of Using Data Type DB_ANY with Motion Control Applications", it contain example, where they create Datablock with DB_ANY type variable. Then they write: "During the startup of the CPU (in OB 100, for example) you assign the corresponding technology objects of the project to the separate array elements.". They made it via command " := ". In next they write: " technology object "PositioningAxis" retains the data type "TO_PositioningAxis" even when using DB_ANY. ". Okay, I create DB_ANY variable named DB_Axis in my FB. The I write in OB100 function Ctrl_Servo_1.DB_Axis := "Axis_1"; but TIA swears on it: Data type 'Block_DB' cannot be converted implicitly into data type 'DB_ANY'. My attempt to use DB_ANY on MC_Power_DB - also TIA error: Parameters of the function or the function block do not match the transferred formal parameters. What do I do incorrectly? P.S> I use TIA Portal v13 SP1 AttachmentCtrl_Servo.txt (664 Downloads) |
10/25/2018 11:35 AM | |
Joined: 12/12/2015 Last visit: 6/30/2022 Posts: 7 Rating:
|
>>> So, do not hope to make the selection. Write out the datatype and press enter. It works! Incredible )) I hope it would be successfull Thanks for all AttachmentCtrl_Servo_new.txt (797 Downloads) |
Last edited by: Nicolayy at: 10/25/2018 11:35:33 AMLast edited by: Nicolayy at: 10/25/2018 11:49:51 AMLast edited by: Nicolayy at: 10/25/2018 11:50:25 AM |
|
Follow us on