Jump to content
OMRON Forums

windell747

Members
  • Posts

    119
  • Joined

  • Last visited

Everything posted by windell747

  1. Aloha, I have a C program that writes to a set of P-variables and a motion program reads from those same variables. Since the Power PMAC I have is a 32-bit machine, it will take 2 processor cycles to write to a 64-bit memory location. Therefore, with multiple threads running, it is possible to read only half of an updated 64-bit floating point number. You can imagine that this can give crazy behavior if this variable is a commanded position. To be responsible, I am using mutexs to ensure that I cannot read a variable while I'm writing to it. 1) Does DT have any existing mutex schemes for writing and reading shared global memory P-variables? I can do my own per Dekker's algorithm for example, but depending on how the C optimization occurs, the mutex may not work as intended. I wanted to make sure I check what comes out of the box before doing my own mutex. Thanks, windell
  2. Hi Steve, 1) Per our conversation on Friday, you said that a firmware isn't needed for your suggestion to work. Since my compile wasn't working. I did a sanity check and I went into my preprocessed pp_proj.h file looking for the _PP_PROJ_HDR_ #ifndef section that would make your suggestion work and I don't see one. However I do see a _PP_PROJ_H_ section that is essentially around the entire file. Perhaps this is what you really mean? My IDE version is: 1.6.0.109 My firmware version is: 1.5.8 2) Also discussed on Friday, do I need to upgrade my IDE or firmware so that the automatically generated pp_proj.h file has the PP_PROJ_HDR? Or if _PP_PROJ_H_ is really what you mean, then an upgrade isn't necessary right? thanks, windell
  3. I just tried your _EnumMode_ suggestion and I come up with the same errors as the OP. Both modes share the same set of function definitions so this is why I cannot use the _EnumMode_ either until the new firmware is released for the PMAC. So right now it seems that my only option is to read and write to these P variables manually. That is unless I want to restructure my project which does not make much sense to do. Do you have any suggestions? thanks, windell
  4. Hi Charles, Unfortunately, our class ran behind enough that we just brushed over this. So I apologize for not knowing more about this before asking. Also in the training slides, where the _EnumMode_ and _PPScriptMode_ preprocessor directive are mentioned, there is no mention of the syntax to use to access the same P-variable variable on the motion program side. 1) I understand for _PPScriptMode_ you would use just the variable name (training slides don't mention this), but what about for _EnumMode_? Thank you, Windell
  5. Hi Steve, I just tried your suggestion and I'm still getting the same errors as the OP. Looks like I'll have to try the alternative methods that you suggest. thanks, windell
  6. Thanks Steve and Charles! I will try soon and will let you know.
  7. Aloha DT, Has there been any progress towards a solution to this? If not, could you suggest an alternative way to write to a global P variable and access it on the motion program without using _PPScriptMode_. I really need to make some headway on this issue. thanks, windell
  8. Much Mahalos Charles and Dave for looking so deeply into this. I see what you are saying Dave about the pp_prog.h being included in multiple files. I'm happy to hear that you were able to compile my code my modifying the pp_prog.h and that is promising. I am open to any suggestions that will help make my code work easier with the way DT wants to do things. The firmware version that I am running is 1.5.8.0 and the IDE build is 1.6.0.109.
  9. Hi Charles, My apologies for being unclear. The errors I am getting are the same as in the original post. These files are part of a working project in which I have made a few modifications too. The project is code for the PMAC acting as a server to receiving commands from a host computer and moving our telescope. You will see the overall structure in tcsmain.c. They aren't generated by simulink. Leaving out a few files will not work since the main function calls all of the other functions in the other files that are necessary. The compile goes through fine without defining _PPScriptMode_ in tcspmac.c. However, when I define _PPScriptMode_ in tcspmac.c the doubly defined errors come out. In your previous reply, you claimed that the errors were possibly from doubly including glib.h and for including RtGpShm.h unnecessarily. I have since taken those out, but the compile errors are still there when _PPScriptMode_ is defined. I have looked up the locations of the errors an they are contained in pp_proj.h automatically generated header file. Here is the text I know its something that I am doing, but with the provided documentation, I do not know what about _PPScriptMode_ that I am not understanding. Thanks for your patience! windell C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\PowerPMACProject.ppproj(326,5): Error : tcspmac.o: In function `SetEnumGlobalVar': C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\C Language\Background Programs\TCSserv\..\..\Include\pp_proj.h(134,0): Error : multiple definition of `SetEnumGlobalVar' C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\C Language\Background Programs\TCSserv\tcsctrl.o:..\..\Include\pp_proj.h(134,0): Error : first defined here C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\PowerPMACProject.ppproj(326,5): Error : tcspmac.o: In function `GetEnumGlobalVar': C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\C Language\Background Programs\TCSserv\..\..\Include\pp_proj.h(139,0): Error : multiple definition of `GetEnumGlobalVar' C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\C Language\Background Programs\TCSserv\tcsctrl.o:..\..\Include\pp_proj.h(139,0): Error : first defined here C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\PowerPMACProject.ppproj(326,5): Error : tcspmac.o: In function `SetEnumGlobalArrayVar': C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\C Language\Background Programs\TCSserv\..\..\Include\pp_proj.h(144,0): Error : multiple definition of `SetEnumGlobalArrayVar' C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\C Language\Background Programs\TCSserv\tcsctrl.o:..\..\Include\pp_proj.h(144,0): Error : first defined here C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\PowerPMACProject.ppproj(326,5): Error : tcspmac.o: In function `GetEnumGlobalArrayVar': C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\C Language\Background Programs\TCSserv\..\..\Include\pp_proj.h(149,0): Error : multiple definition of `GetEnumGlobalArrayVar' C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\C Language\Background Programs\TCSserv\tcsctrl.o:..\..\Include\pp_proj.h(149,0): Error : first defined here C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\PowerPMACProject.ppproj(326,5): Error : tcspmac.o: In function `SetEnumCSGlobalVar': C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\C Language\Background Programs\TCSserv\..\..\Include\pp_proj.h(154,0): Error : multiple definition of `SetEnumCSGlobalVar' C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\C Language\Background Programs\TCSserv\tcsctrl.o:..\..\Include\pp_proj.h(154,0): Error : first defined here C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\PowerPMACProject.ppproj(326,5): Error : tcspmac.o: In function `GetEnumCSGlobalVar': C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\C Language\Background Programs\TCSserv\..\..\Include\pp_proj.h(159,0): Error : multiple definition of `GetEnumCSGlobalVar' C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\C Language\Background Programs\TCSserv\tcsctrl.o:..\..\Include\pp_proj.h(159,0): Error : first defined here C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\PowerPMACProject.ppproj(326,5): Error : tcspmac.o: In function `SetEnumCSGlobalArrayVar': C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\C Language\Background Programs\TCSserv\..\..\Include\pp_proj.h(164,0): Error : multiple definition of `SetEnumCSGlobalArrayVar' C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\C Language\Background Programs\TCSserv\tcsctrl.o:..\..\Include\pp_proj.h(164,0): Error : first defined here C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\PowerPMACProject.ppproj(326,5): Error : tcspmac.o: In function `GetEnumCSGlobalArrayVar': C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\C Language\Background Programs\TCSserv\..\..\Include\pp_proj.h(169,0): Error : multiple definition of `GetEnumCSGlobalArrayVar' C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\C Language\Background Programs\TCSserv\tcsctrl.o:..\..\Include\pp_proj.h(169,0): Error : first defined here C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\PowerPMACProject.ppproj(326,5): Error : tcspmac.o: In function `SetEnumPtrVar': C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\C Language\Background Programs\TCSserv\..\..\Include\pp_proj.h(174,0): Error : multiple definition of `SetEnumPtrVar' C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\C Language\Background Programs\TCSserv\tcsctrl.o:..\..\Include\pp_proj.h(174,0): Error : first defined here C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\PowerPMACProject.ppproj(326,5): Error : tcspmac.o: In function `GetEnumPtrVar': C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\C Language\Background Programs\TCSserv\..\..\Include\pp_proj.h(179,0): Error : multiple definition of `GetEnumPtrVar' C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\C Language\Background Programs\TCSserv\tcsctrl.o:..\..\Include\pp_proj.h(179,0): Error : first defined here C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\PowerPMACProject.ppproj(326,5): Error : tcspmac.o: In function `SetEnumPtrArrayVar': C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\C Language\Background Programs\TCSserv\..\..\Include\pp_proj.h(184,0): Error : multiple definition of `SetEnumPtrArrayVar' C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\C Language\Background Programs\TCSserv\tcsctrl.o:..\..\Include\pp_proj.h(184,0): Error : first defined here C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\PowerPMACProject.ppproj(326,5): Error : tcspmac.o: In function `GetEnumPtrArrayVar': C:\Documents and Settings\cleanroom\Desktop\TCS_SVN\Software\PowerPMACProject\C Language\Background Programs\TCSserv\..\..\Include\pp_proj.h(189,0): Error : multiple definition of `GetEnumPtrArrayVar'
  10. In my previous reply (now deleted due to false information), I said that it compiled fine after removing the duplicate #include entries. It appears that I was wrong and probably compiled my code with the #define _PPScriptMode_ commented out by mistake because it no longer compiles and generates the same duplicate entry issues. I've attached my project for you to take a look. The file that is causing the issue is tcspmac.c. You'll see that there is another file that uses _PPScriptMode_ and it is tcsctrl.c. With the dulpicate header files entries removed its no logner obvious as to what the issue could be. Does anyone have a suggestions? Thanks, windell PowerPMACProject.zip
  11. Hi, I'm making a modification to a set of working code by defining a few extra "globals" in global definitions.pmh and putting #define _PPScriptMode_. When I compile I get the following errors Error : tcspmac.o: In function `SetEnumGlobalVar': Error : multiple definition of `SetEnumGlobalVar' Error : first defined here Error : tcspmac.o: In function `GetEnumGlobalVar': Error : multiple definition of `GetEnumGlobalVar' Error : first defined here Error : tcspmac.o: In function `SetEnumGlobalArrayVar': Error : multiple definition of `SetEnumGlobalArrayVar' Error : first defined here Error : tcspmac.o: In function `GetEnumGlobalArrayVar': Error : multiple definition of `GetEnumGlobalArrayVar' Error : first defined here Error : tcspmac.o: In function `SetEnumCSGlobalVar': Error : multiple definition of `SetEnumCSGlobalVar' Error : first defined here Error : tcspmac.o: In function `GetEnumCSGlobalVar': Error : multiple definition of `GetEnumCSGlobalVar' Error : first defined here Error : tcspmac.o: In function `SetEnumCSGlobalArrayVar': Error : multiple definition of `SetEnumCSGlobalArrayVar' Error : first defined here Error : tcspmac.o: In function `GetEnumCSGlobalArrayVar': Error : multiple definition of `GetEnumCSGlobalArrayVar' Error : first defined here Error : tcspmac.o: In function `SetEnumPtrVar': Error : multiple definition of `SetEnumPtrVar' Error : first defined here Error : tcspmac.o: In function `GetEnumPtrVar': Error : multiple definition of `GetEnumPtrVar' Error : first defined here Error : tcspmac.o: In function `SetEnumPtrArrayVar': Error : multiple definition of `SetEnumPtrArrayVar' Error : first defined here Error : tcspmac.o: In function `GetEnumPtrArrayVar': Error : multiple definition of `GetEnumPtrArrayVar' Error : first defined here CError : collect2: ld returned 1 exit status From the looks of it, I have something doubly defined somewhere, however I certianly only have one instance of "#define _PPScriptMode_" in the file. I've successfully used this in other C files in the working code and everything is fine, however, when I try to implement using the globals in this file I get these compile errors. I know the issue is one my side, but I'm not quite sure about how to approach finding the bug. I've attached two files for reference: tcspmac.c (doesn't compile) tcsctrl.c(compiles fine) Any suggestions? tcspmac.c tcsctrl.c
  12. Aloha, What can I do to invoke a soft watchdog trip? I'm trying to see what my application does when a soft watchdog trip occurs. Is there a limit that I can set to low in which it will most definitely trip? thanks, windell
  13. Aloha, I'm wondering how to record the value of the Sys.WDTFault status element from within a background C program. I tried watchdogbits = pshm->Sys.WDTFault; but I get a compile error saying that Sys is not an element of shm. Does anyone know how to poll this status element? thanks, windell
  14. Aloha, I'm trying to debug some behavior on our power PMAC and my hypothesis is that we're experiencing a soft watchdog trip. I know that I could check the Sys.WDTFault bits but I found this after I did a reboot. Here are the symptoms that I see: 1) The encoders jump to a bogus position that is off at nowhere. 2) The velocities, following error, and encoder positions all freeze. 3) It seems that the background programs are still running. 4) The ssh terminal still works and to recover I have to do a reboot. Has anyone experienced this before? Does this sound like a soft watchdog trip? thanks, windell
  15. Aloha, Has anyone had any experience mounting a spinning drive on the power PMAC? Other than USB, I'm wondering what my options are. Does DT offer a spinning drive card? thanks, windell
  16. Thanks very much Charles! I should probably add that my application requires tracking targets that are constantly moving. They aren't moving too fast, but after the steps coming in, new positions are still coming in as the telescope is responding to the step. Right now I'm not in dire need of these examples, just was moreso giving input for my specific application. I'm sure responding to these is like drinking water from a firehose!
  17. Thanks very much Curt. I think I'm getting what you're saying, but I want to clarify. All my calculations for the position commands are being done in a C program that is running in parallel to the motion program. This C program modifies a bunch of global variables that the motion program has access to. The positions are sent to the PMAC by a remote computer at precisely 50 ms intervals. The PMAC does extrapolations into 5 smaller, 10 ms, moves based on the incoming positions from the remote computer. These 5 smaller increments are stored in global variables which are then access by the motion program. 1) So I'm pretty much trying to figure out the timing of the PVT move commands motion program. Specifically, when do they pull the value from the global variable and use it in the move? From your explanation, it seems that when the previous PVT move finishes, the next move will lookup the global variables for the next move and then execute that move etc. Am I correct on this? So if there are 10 PVT commands in the "PVT_TRACKING" part of the loop and the motion time for each of those commands are each 10 ms then it will take 100 ms for that loop to come back around? 2) The global variable for the linear commands is updated by the C program at 50 ms intervals. If my response to (1) above is true, then what happens when the linear command is moving for several seconds and the global variable is updating every 50 ms? From your response above, I'm gathering that the linear move mode will not evaluate the next global variable update until the previous linear move is complete? If this is true, is the global variable evaluated just before the deceleration part of the linear move command? I'm trying to see if the linear move mode updates its end position in real time like a jog move that is issued every 50 ms. thanks very much, Curt! I apologize if these are really dumb questions that can be answer in the manuals. I've taken a look and so far to me its a bit unclear.
  18. Thanks Charles! These slides are very helpful and I can see that they took a vast amount of time. I have a copy of them right next to my UG and SRM. I like that it takes the perspective of starting with a new PMAC.
  19. Gosh, I'd hate to create enemies at DeltaTau, since I'm a huge fan of your controllers! On the flip side, I do think it would be of great help to have a beginning users guide that includes going beyond setting up the motors, coordinate systems, and encoder tables. Of course assuming that the user already knows how to program in K & R C. For me more proven examples from a C-program interfacing with a continually running motion program, blending, timing issues would be wonderful. Maybe a case study approach? I've found that I have to piece information between the SRM and UG to get a full picture sometimes. It makes me wonder sometimes what I'm missing. From the user guide perspective I feel that the C program and motion program part at the end is lacking. For me I learn most effectively by analogy so I tend to like to see the big picture application first and then the implementation. I find that I can come up with a solution way faster than reading cover to cover looking through the UG to piece together the features I would like. I strongly believe that something like this will save a lot of time and money on DT's side by them not needing to answer as many "basic" questions. Again, I hope there are no hard feelings here :) I'm only trying to help. BTW, I'll be attending the DT PMAC class later this month so it will be great to see where the magic happens!
  20. Thank you KEJR! This really helps me a lot. You know one thing that I haven't found any mention of in the users manual is the line #define _PPScriptMode_ I tried compiling without this line, and the variables weren't recognized in the C program. It compiled fine when I put it in though. What does this do? Do you know where I can find mention of this in the manual? I am looking at the System Global Variables section in the manual and I see no mention of it. I just want to make sure that I have all of my bases covered. thanks again!
  21. Hi, I working on making my motion program more robust and I'm trying to find out the particulars about when each position command executes for PVT. Background: I've attached my motion program for reference. There are comments in the motion program to try and help you out with what I'm doing. Essentially the motion program waits until a global flag is raised from the main C program and executes once. The main C program loops around at about 1 kHz. The position commands update at 20 Hz. Question: 1) When the PVT move command are read from the motion program, are they read in all at once, and then executed internally one at a time? Or are they read one at a time and the next one is read when the previous move has completed? 2) If the motion program is looping at 1 kHz (as governed by that flag), the motion program will essentially be sending dulplicate positions a lot (the positions only change at 20 Hz). How does the PMAC deal with this? The current motion program seems to be working, but is there a better way to do this? thanks so much! windell ha_pvt_p1.pmc
  22. Hi All, Is there any way to limit the acceleration of an axis that is running currently in PVT mode? thank you, windell
  23. Hi, I'm working on an existing project that using a background program that loads some P-variables with floating point constants that are then accessed by a motion program to make decisions. I'm adding some new P-variables and I'm having a bit of trouble. Can someone outline the process to properly add more P-variables? What I have done is the following: 1) I've added the variables to global_definitions.pmh in the form #define {variable_name} P400 #define {variable_name2} P401 ... 2) I've added the variables to globalp.h in the following way #define {variable_name} pshm->P[400] #define {variable_name2} pshm->P[401] 3) The C code uses these macros. 4) The motion program accesses these variables using the same names. 5) globalp.h is included in the C files that access these P-variables. ... Is there anything that I'm missing to do? From my method above it looks like I'm doing things manually, but the PMAC manual seems to imply that these is a way to assign and name the variables via the IDE... How do I do this?
  24. Hi, I'm converting some of my code from using Jogs to using the linear mode. When using jogs specifying the JogTa and JogTs was easy to limit the acceleration. However with the linear mode, I have to either specify ta and td. However, this is a bit inconvenient because I really know the rate in which I want to limit the acceleration, and not the time. Of course, I can calculate this based on the starting and ending velocities, but I'm just wondering if there is any way that I can specify the acceleration differently? Also, is there a way to specify the maximum speed in which the linear mode speed would saturate? thanks, windell
  25. I'm still having this trajectory over acceleration problem and its very hard to debug as it isn't easily reproduceable. I've put in a small delay of 20 ms between when the abort is called and when the next jog is called. However, I'm still getting a few trajectories which are 3 times what the Ta specifies. Again the rate is 1 time in maybe 500 times. As another thing to try, I am implementing the Motor[x].InPos fix right now where I wait until this flag goes high before sending the jog after the motion program is stopped. However, I'm not sure it will solve the problem since the Motor[x].InPos flag goes high when a Motor[x].InPosBand condition is met so technically the motor is still decelerating when the next jog is issued. So right now I'm not seeing how waiting longer helps with the trajectory for the next jog. Maybe I'm humbly looking over something? Can you give me some suggestions for things to print out when the jog is called to debug why the trajectory sometimes doesn't follow the Jog.Ta setting? thanks, windell
×
×
  • Create New...