Jump to content
OMRON Forums

ptr array (interesting use of cx command)


Recommended Posts

This is an interesting use of cx command for generating ptr arrays:


ptr mytestbuf(20)->*;
cx L0=0while(L0<20){CMD"mytestbuf(%d)->Sys.Udata[%d]",L0,L0 L0++} Close


The first line defines a self referencing ptr array.

The second line uses a single line plc with a builtin loop and uses CMD command within to generate all of the definitions. All sorts of math logic and target locations can be included here.


Have fun with Power PMAC!



UPDATE: Execution of this command depends on available space in the CMD buffer. If the command buffer is full, some portion of the command may not execute. Use caution.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

This topic is now closed to further replies.

  • Create New...