Johnny T
Member
Hi,
I've written a function block that takes in a few parameters and then outputs #motor_in_pos declared in the variable declaration table.
The problem is that the FB is only called occasionally (as and when I need to check if a motor is in position).
What seems to be happening is that if the last motor checked was in position ie. #motor_in_pos = 1. Then when I call it again to check either the same motor or a different one, the output is already set to a 1 so the software assumes that the next motor is in position. (hope this is making sense).
I need some way of calling the FB and initially (ie. just the first scan) clear all the variable declaration table back to their initial values. Then to continue to scan the block and report back to the calling block.
Can this be done?
Many thanks
JT
I've written a function block that takes in a few parameters and then outputs #motor_in_pos declared in the variable declaration table.
The problem is that the FB is only called occasionally (as and when I need to check if a motor is in position).
What seems to be happening is that if the last motor checked was in position ie. #motor_in_pos = 1. Then when I call it again to check either the same motor or a different one, the output is already set to a 1 so the software assumes that the next motor is in position. (hope this is making sense).
I need some way of calling the FB and initially (ie. just the first scan) clear all the variable declaration table back to their initial values. Then to continue to scan the block and report back to the calling block.
Can this be done?
Many thanks
JT