So, you want to produce data from the robot that emulates the quadrature signals of a linear encoder?
Your root problem here is that the robot's internal clock only operates on a 12ms update rate (4ms in special cases with RSI, in IPO_FAST mode). So even if you could transmit data faster than once every 12ms, $POS_ACT_MES only updates every 12ms.
Your current code only "works" b/c you're essentially "cheating" with the Advance Run Pointer. A better solution would be to put the data transmission into the SPS, and build the SPS loop so it avoids any pauses or branches, and use TRIGGER commands in your motion program to enable/disable the SPS transmission.
Alternatively... in your motion program, create an Interrupt linked to a $TIMER_FLAG. Put your EKI_SEND into the Interrupt Service Routine, and have the ISR reset the $TIMER to -12ms each time it's called.
No offense but... Topic already got TEN responses and... still no clue what exactly you need help with. Would you please try to get to the point and - be specific?
Q: so what is it that you need?
A: I need to simulate ..., but this is not my problem right now,this function ...., but it is not my problem right now. quadrature... not a problem.
Instead of telling what is "NOT the problem", try to narrow down your any and all of your issues to ONE specific and most important thing... What is the single issue that would ultimately help your project move forward? how what you have done with it, what do you want and tell how it does not meet your expectations. that is it.
and before you respond, please lookup GIGO principle and read pinned topic READ FIRST. it is supposed to tell YOU how to ask for help.
for example "my interrupt code does not work. it is exactly the same code as before" is not going anywhere. your code in original post has not a single INTERRUPT command. are we supposed to imagine what your code may look like now?
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!