Jump to content
OMRON Forums

Read value at address


andyf

Recommended Posts

I have a motion program subroutine that performs a homing routine common to several motors. I want to pass the motor number to the routine and then have the routine home that motor. The routine needs to read the HomeCapt register value, which is pointed to by Motor[n].pCaptPos. Since that gives me the address of the register I want to read, what is the syntax to read the value at that address? I do not want the routine to have to know which ACC24E3 IC and channel to access, but instead just use the Motor[n] pointers.
Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

The value of Motor[x].pCaptPos is the address of the gate channel HomeCapt register. If I try to assign this to a variable in the motion program, the variable value is set to the address, not the value of HomeCapt. I want to set my variable to the value of the HomeCapt register. In C language speak, I want: *pCaptPos
Link to comment
Share on other sites

OK. I assigned the Mxx03 in my global definitions. Then in the motion program code I can use the motor number as the xx part and read Mxx03. Not pretty, but it works.

 

I would add to the wish list the ability to dereference pointers.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...