I am working with a cell with a robot + sensor that takes measures on a workpiece, but I am experiencing a problem:
Connected to the plc there is a laser sensor that reports a distance reading all the time though profinet (robot is also connected through profinet), the robot grips a part, moves it to the sensor an start rotating the workpiece it while the PLC catches the data from the sensor and the robot current Z angle with the selected UFrame, the purpose is to detect a hole and get the Z angle in order to do some more operations.
A little time before starting the rotation, there is a secondary task launched with a RUN that takes the value from the variable $SV_INFO.$CART_POS_UF, multiplies the angle x100 and sends the position though a GO, but I am taking a lot of readings on the plc side with the same angle repeated every scan cycle.
It seems the sensor is providing data every 2ms, but the robot is executing the other task or the variable or GO is only updating on a 10 to 20ms interval (maybe the io board is limiting the data transfer?)
Do you guys know if there is a way to give highter priority to a task? I know this can be done on bglogic but I don't know the diference betwheen Normal and High priority, if bglogic is faster than a task called from a run statement I can switch the method of data capture. The task only has like 8 instructions and no math other than a multiplication is done so it should be pretty fast to execute.
PLC is taking readings with a cyclic interrupt to ensure all data is catched and saved every 2ms, I have recorded the data of all the process on a DB and as I've said, there are a lot of different readings on the sensor part, even from previous scan to next data varies slightly, but the data from the robot is repeated around 5/10 cycles of the cyclic interrupt.
I think my problem is caused by the task not being executed fast ennough, so any advice will be appreciated. Thanks.