Jump to content
OMRON Forums

shansen

Members
  • Posts

    186
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by shansen

  1. When I order a Power PMAC with the dual EtherCAT master option, can I use both Ethernet ports and both EtherCAT ports at the same time?
  2. Very cool, thanks for the info Sina!
  3. As of 2012, it looks like the Power PMAC can be purchased with a maximum clock speed of 1GHz (PowerPC 460EX?). Does Delta Tau have any future plans to offer Power PMACs with faster CPUs or multicore CPUs?
  4. Could you post your usrcode.c and usrcode.h files?
  5. dennisg: Right click on usrcode.c in the solution explorer tree and select 'Properties'. Verify that the Build Action is set to 'Compile'. Then do another build and download, and verify that your user routine compiles and downloads.
  6. pmurcutt: I have already written a quick setup guide on using Eclipse for PPMAC development, but it isn't fully completed yet. Seeing as you and several other individuals have asked me for something similar, I will try to clean it up and get it to a workable state (maybe by next week)? It depends on my workload... The main thing is getting Eclipse setup to use the cross-compiler and then linking the correct libraries. The rest is cake!
  7. @MClement: I've just been using Eclipse CDT, in addition to the RSE plugin. Here is how my IDE is setup: 1) Windows 7 with Eclipse CDT and MinGW installed 2) My Eclipse projects are built using DT's cross-compiler (powerpc-405-linux-gnu-gcc/g++) and linked to the DT provided PPMAC libraries. NOTE: I did have to upgrade the version of 'make' (the version provided by DT isn't completely compatible with Eclipse for some reason) 3) Eclipse automatically generates the makefiles as part of the build process 4) RSE lets you create remote targets and build groups. For example, I have one build group that builds all of my projects and downloads them to the correct location on the PPMAC when finished. 5) RSE also provides pretty convenient telnet terminal(s) for debugging + starting and stopping apps 6) The Eclipse debugger CAN debug remotely, but it requires upgrading the PPMAC from Lenny to Squeeze (so you can install gdbserver on the PPMAC). I haven't taken it this far, but plan to do so in the future. If you have any specific questions, let me know. It took a little bit to get everything working, but it is almost completely seamless the way I have it set up now. As a side note, using Eclipse for PPMAC development is definitely not for everyone! For example, I cannot do motion programs or PLCs in Eclipse (I haven't tried it at least). However, Eclipse does let you create your own project structure, and the more advanced intellisense, auto-coloring, and refactoring support is great! Plus, you can build and download applications and libraries individually, which (last I checked) you cannot do with the vanilla DT IDE.
  8. pmurcutt - If you're looking for a C++ capable IDE, I've had good success using Eclipse CDT for both C and C++ on the Power PMAC. You can even use the Remote Systems plugin to automatically download your executables after a build, so it's pretty seamless. YMMV.
  9. Michael, As far as I know, this isn't doable out of the box as of 04/12. To solve this issue, my company ended up writing a custom Capp (similar to gpascii) that provides tagname based access to certain Delta Tau structures in addition to any user defined variables/structures. As a poor man's substitute, you could make each element in your custom structure be a pointer, and then define global variables for each structure element. Then, all you'd have to do is point each structure element to the address of its associated global variable, and they would be accessible via gpascii. Unfortunately, this wouldn't allow you to encapsulate your tagnames (e.g. you would have to access myApp.myAxis[3].defaultSpeed as "myAppAxis3DefaultSpeed" or whatever name you choose). -Steven
  10. I would highly recommend writing your own custom driver using sockets (a "Capp" may work for your application). We currently pull about 65k bytes of data from the PPMAC every 20 ms using our own custom socket driver. The fastest benchmark we were able to achieve was about 17 MBytes/s (direct Ethernet connection between PPMAC and peripheral). To keep the CPU usage on the PPMAC down, I would recommend transferring larger amounts of data at slower rates (as opposed to transferring small amounts of data quickly). Here are some links that I found useful for socket programming: http://www.yolinux.com/TUTORIALS/Sockets.html http://beej.us/guide/bgnet/output/print/bgnet_USLetter.pdf
  11. Charles, I have looked at the manual, but it doesn't really answer my question. In the terminal, I can type Gate1[4].PartData[0] to access this variable. In my C-code, I am currently doing this: unsigned int *pPartData0 = (unsigned int *)(0xD00040 + piom); I am asking if I there is a way to do this: GateArray1 *pGA1 = GetGate1MemPtr(x); unsigned int *pPartData0 = &pGA1->PartData[0];
  12. Is there a way to access Gate1[x].PartData in C-code through the GateArray1 structure? I know I can hardcode a pointer to that address, but I'd prefer to use a tagname if possible. Thanks!
  13. When writing user phase code, I have noticed that the IDE compiles both a .ko and .so version of useralgo. The problem is if I use kernel specific functions (e.g. kmalloc, etc) in my code, then useralgo.ko compiles successfully but useralgo.so fails. I've been getting around this by putting #ifdef __KERNEL__ statements around kernel-mode functions, but I was hoping someone could clarify the purpose of useralgo.so and why it is compiled in user-mode. Thanks!
  14. HRS, I'm pretty sure you can't do this because the SHM structure is defined in one of Delta Tau's header files, and C# does not allow you to reference C headers directly. Another problem is that C# isn't exactly pointer friendly (although it can be done with the 'unsafe' keyword, it is highly discouraged). What is inside pSHM that you need access to? Could you access what you need through GetResponse() or any of the other pre-defined functions?
  15. Henry, That is the info I needed. Thanks!
  16. Henry, If I create and compile my own device driver, what is the proper way to link a function within the driver to the phase interrupt?
  17. Just trying to keep up to date. I will probably try this upgrade in the next month or so, it should be fairly straightforward but I just wanted a quick sanity check to make sure I'm not doing something I'm not supposed to. Per Henry's last comment, I think everything should work fairly smoothly. -Steve
  18. KEJR, Yes, my jitter requirements are the reason I need a kernel mode thread. I am writing a current/voltage regulator for a 3 phase PWM converter, and I would prefer to create my own thread so I can easily hook into some of the shared memory extensions my company has written for the PPMAC. I can also use DT's motor phase interrupt (i.e. user phase code), but that will not be as clean in terms of interfacing to our custom shared memory code. To clarify what I am asking, I was hoping that I could write user phase code and use the IDE to compile it (it already does this, i.e. adding the compiler switches to compile for kernel-mode), but then be able to start that kernel-mode thread from a background "capp" instead of using the right click->user servo setup. So, as a summary: 1) Write DT user phase code 2) Use IDE to compile user phase code 3) Use user-mode code to create a kernel mode thread that would run the compiled user phase code
  19. KEJR, Did you ever get around to upgrading to Squeeze? Any gotchas?
  20. I seem to be getting higher than expected jitter on my phase code routine. If I create and run an empty user phase routine, I am getting about +/-8% jitter when the phase interrupt is set to 18kHz (i.e. the measured time between phase code executions varies between 49-60 us, and the nominal is 55 us). I am using fclock() inside the phase code and writing the calculated time to a Pvar to measure the time between phase code executions.
  21. I have been using the Threading library created by KEJR and Delta Tau, and it has been working very well so far. Thanks for your effort guys! Now, I'm trying to figure out if I can create a kernel-mode thread from a user-mode program...does anyone know if this is possible? And if so, what is the syntax for associating an IRQ with a kernel-mode thread?
  22. Hi all, Is there any way to add a custom struct to the preprocessor for GetResponse access? In other words, I can do this: GetResponse("Motor[1].ActVel"). I would like to be able to do this: GetResponse("MyCustomStruct[1].Parameter1") Any thoughts?
  23. I am using the Help->Contents in the Power PMAC IDE. Look under PowerPmacCLanguageManual->gplib.h->ConvertSymbolicToPmacExp(). Here is the function prototype: void ConvertSymbolicToPMACExp (unsigned char * inpstr) So I guess my previous example is a little off. My visual basic is rusty, so here is the equivalent C# code: [DllImport(DllLocation)] private static extern void GetResponse(string query, out StringBuilder response, int maxlen, byte echoMode); [DllImport(DllLocation)] private static extern void ConvertSymbolicToPMACExp(ref string query); private string DoGetResponse(string var) { ConvertSymbolicToPMACExp(var); // converts var tagnames to Pmac variables StringBuilder response = new StringBuilder(); GetResponse(var, out response, 65535, 0x07); // do get response return response.ToString(); } Those dll import statements are probably a little bit off, I did them off the top of my head and I don't know if you can directly convert a string pointer to a ref or not.
  24. Is your program running on the Power PMAC? If so, check out the ConvertSymbolicToPMACExp() function. It converts tagnames (AxesEnabled) to a GetResponse compatible string (P249). Example: _ Private Shared Function GetResponse(<[in](), MarshalAs(UnmanagedType.LPStr)> ByVal q As String, ByVal a As StringBuilder, ByVal maxlen As Int32, ByVal echomode As Byte) As Integer End Function _ Private Shared Function ConvertSymbolicToPMACExp(...) 'need to fill in parameters here End Function Public Function GetPVarAddress(ByVal sVariableName As String) As Integer Try Dim sResponse As New StringBuilder("A", 4096) Dim sTagStr As String Dim sResponse2 As String Dim sResult() As String Dim sAddress As String Dim iResult As Integer sTagStr = ConvertSymbolicToPMACExp(sVariableName); iResult = GetResponse(sTagStr, sResponse, 512, 0) sResponse2 = sResponse.ToString() sResult = sResponse2.Split(New Char() {"="c}) sAddress = Mid(sResult(1), 1) Return Integer.Parse(sAddress) Catch ex As Exception Console.Write("GetPVarAddress Error: " & ex.Message & vbCrLf) End Try End Function
  25. shansen

    MonoTools?

    No, we eventually dropped it because we were having other issues with the Power PMAC that have since been fixed. It would be pretty cool if someone figured out how to get it running though.
×
×
  • Create New...