How can I read the position of a servo controller in order to relay it back to a PLC via a signal?
I can use the getJointValue method to return the position in Python, but I am struggling to then assign this to a signal so a PLC can read it.
I read the value of the servo position and convert it to an int. Then I print assign the value to the signal. I print both the signal value and the signal object itself to verify it still exists.
But on the connectivity tab, the value is always only 0
Hmmm could it be that you map an PLC Output to your Signal? And could it be that the PLC overwrites its value cyclic?
In your script you are not using vcSignal.signal(newValue) but instead assigning to the .Value property which does not trigger the signal.
Ui jes, I thought too complicated…
Yes, this was my problem.
I was trying to assign the value of signals using:
Load.Value = True
The correct way to do it is
(Just in case anyone comes looking for the same answer)