daves Posted July 8, 2011 Posted July 8, 2011 In UMAC I looked at bit 0 in the coordinate system status word to get the Program Running flag: coordSysStatus->X:$002040,0,16 programRunning->X:$002040,0,1 This address doesn't translate in the TP2PP program. 1: I found the Coord[1].ProgRunning parameter in the manual. Is this the new thing to look at and is it exactly the same? 2: Or should it be Coord[1].ProgActive? (Turbo talks of executing, not running/active) 3: Or should it be bit 16 in Coord[1].Status[0] labelled as TimerEnabled? 4: If it is one of the first two then how do I get that in a C program? They are not part of the pshm->Coord[] structure... Why? Thanks Dave
Sina.Sattari Posted July 8, 2011 Posted July 8, 2011 Dave, The TP2PP program only translates the addresses of external devices to CPU. The address you're pointing out is not an external device and it is a part of CPU memory. The answer to your question is in this post: http://forums.deltatau.com/showthread.php?tid=113&pid=1773#pid1773
curtwilson Posted July 8, 2011 Posted July 8, 2011 Dave: We got feedback from Turbo PMAC users that the "program running" status bit did not cover from a user's point of view all the cases where the program might be considered to be "running" or "not running". For example, after it has finished calculating the last move, this bit goes to 0, even while the last move is still executing. Users would commonly "OR" this bit with a motor "timer-enabled" bit to cover this case. So in Power PMAC, we created a few "user-viewpoint" status bits that are logical functions of multiple internal status bits. These do a much better job of telling the user what he wants to know. In the Script environment, we can hide the fact that these are actually function calls, but not in C. Between ProgRunning and ProgActive, which you want to use depends on what you want to know. ProgActive stays true even when the program is suspended in a way that permits resumption (as from a q or s command). Both will stay true as the last move(s) are executing, even though program computation is completed. Presently I see two ways of querying these from a C program. One is to use a generic "getResponse" function and look at the text response. The second is to have a Script PLC copy the bit value into something a C program can access. Before too long, we will have a C API call for these bits to permit more direct access. Curt
daves Posted July 11, 2011 Author Posted July 11, 2011 Thanks for the information. I will have to try one of your suggestions and work out which status I want. (I am currently converting a Turbo UMAC project to PowerPMAC, and my background is software development rather than motion control, so a lot of my questions are hoping to find the direct conversion until I am more familiar with the whole system)
Recommended Posts