Importing using Blocks #1939
Replies: 2 comments
-
Not very stable idea but I think you could make a variable with a list of the devices you need to pass. Maybe too simple, just a thought after diner. Bert |
Beta Was this translation helpful? Give feedback.
-
What you're doing does seem like the right approach. Another approach with fewer blocks overal would be to use global variables. So in your "library program" (your first picture) you could make a variable (red block) called drive base and leave it at 0. Then make a function called "set drive base" and pass the drive base object to it. This is much like you already do, but then you only have to make one such function. This function will set the drivebase variable to the drivebase you just passed in. Then you can make any other number of drive functions without passing in the drivebase object again. They can use the variable instead. |
Beta Was this translation helpful? Give feedback.
-
Dear Community.
I was wondering whether it is possible to make a call to an imported my_task which uses a device (e.g. a drive base) set up in the main program?
The only way I found was to pass all defined devices to the imported task, but that is quite combersome for complex tasks.
Beta Was this translation helpful? Give feedback.
All reactions