Jump to content
OMRON Forums

dennisg

Members
  • Posts

    37
  • Joined

  • Last visited

Posts posted by dennisg

  1. Dennis,

     

    You have to define two pointers in global include section under Script Language section of the project:

    ptr LowerWord->u.io:$A00000.8.24;    // upper 24-bits of a 32-bit word
    ptr UpperWord->u.io:$A00004.8.8;     // bits 8 through 15 of a 32-bit word
    global CombinedWord;

    the definitions here are based upon an ACC-84E memory map. The ACC-84E was designed for use with Turbo UMAC. All Turbo UMAC compatible accessories use a 24-bit data bus. When these 24-bit bus accessories are used with Power PMAC, the data is always in the upper 24-bits of Power PMAC's 32-bit data bus. As you can see in the pointer definition, the second value is always 8, indicating that the LSB of the data is located at bit 8.

    Then in a script PLC you can read or write to the pointed register. (In case of an ACC-84E these registers are read-only)

    CombinedWord = (UpperWord<<24)|LowerWord;
    

     

    Thanks Sina.

  2. I am trying to figure out how to access IO space from inside a PLC script. I would like to just read it into P values. It will be a 26 bit value at piom + $A00000 (lower 24 bits), and piom + $A00004 (upper 8 bits).

     

    What is the syntax to accomplish this ?

  3. Still learning the Delta Tau architecture. I would like to begin to understand how to set things up so the PPMAC comes up and runs our application and servo routines at power up. Pointers on where to read up on doing this would be appreciated.
  4. dennisg,

     

    The user servo routine is running in real time kernel and is being called every servo interrupt. You wouldn't expect for us to be able to interrupt and interrupt, correct?

     

    May I ask what you're trying to do in your user servo?

     

    Not breaking in an interrupt context makes perfect sense, had not thought of it that way.

     

    Right now I am just trying to become familiar with the Delta Tau architecture and environment. Quite a bit different from embedded controls programming I have done in the past.

     

    Thanks

  5. You should be able to do the following:

     

    int *LowerWord, *UpperWord;
    int EncoderValue;
    
    LowerWord = (unsigned*)((unsigned)piom+0xA00000);
    UpperWord = (unsigned*)((unsigned)piom+0xA00004);
    
    EncoderValue = ((*UpperWord&0xFF)<<24)|(*LowerWord);
    

     

    Thanks Sina, I am also trying to debug this user servo routine but I don't think the breakpoints are working or I am using the debugger incorrectly.

     

    I entered it in the servo table and I know it's running because I can set a watchpoint on a Motor variable that I am incrementing inside of it.

  6. I am now on the learning curve for C coding on the PPMAC. I would like to access I/O memory that I believe the ACC84E occupies. Mainly the raw data coming in from a Renishaw BiSS encoder. In script this is defined as

     

    Sys.piom + $A00000; // address of lower 24 bit

    Sys.piom + $A00004; // address of upper 8 bits

     

    How can I access these using C ?

  7. 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.

     

    Thanks, that gets it to "compile" now. A whole bunch of errors though. All functions in usercode.c are currently empty so not sure what is causing all these errors. I must not have environment variables set correctly or something. I'm running 1.4.0.62 of the IDE, the PPMAC has the Sept 2011 firmware on it. The error dump is below:

     

    ------------------------------------------------------

     

    Please wait while mapping Power PMAC variables.

    End of syncing the database.

    PMAC variables are mapped successfully.

    Build Process For usralgo.ko has ended.

     

    Build Process For capp1.out has started.

    Build Process For usralgo.so has started.

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\/usr/local/bin/../lib/gcc/powerpc-405-linux-gnu/4.2.2/../../../../powerpc-405-linux-gnu/sys-include/linux/sched.h(16,0): Warning : in file included from /usr/local/bin/../lib/gcc/powerpc-405-linux-gnu/4.2.2/../../../../powerpc-405-linux-gnu/sys-include/linux/sched.h

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\/usr/local/bin/../lib/gcc/powerpc-405-linux-gnu/4.2.2/../../../../powerpc-405-linux-gnu/sys-include/linux/module.h(9,0): Warning : in file included from /usr/local/bin/../lib/gcc/powerpc-405-linux-gnu/4.2.2/../../../../powerpc-405-linux-gnu/sys-include/linux/module.h

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\usrcode.h(1,0): Warning : in file included from usrcode.h

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\usrcode.c(26,0): Warning : in file included from usrcode.c

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\/usr/local/bin/../lib/gcc/powerpc-405-linux-gnu/4.2.2/../../../../powerpc-405-linux-gnu/sys-include/linux/signal.h(2,0): Warning : #warning "You should include . This time I will do it for you."

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\/usr/local/bin/../lib/gcc/powerpc-405-linux-gnu/4.2.2/../../../../powerpc-405-linux-gnu/sys-include/linux/sched.h(79,0): Warning : in file included from /usr/local/bin/../lib/gcc/powerpc-405-linux-gnu/4.2.2/../../../../powerpc-405-linux-gnu/sys-include/linux/sched.h

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\/usr/local/bin/../lib/gcc/powerpc-405-linux-gnu/4.2.2/../../../../powerpc-405-linux-gnu/sys-include/linux/module.h(9,0): Warning : in file included from /usr/local/bin/../lib/gcc/powerpc-405-linux-gnu/4.2.2/../../../../powerpc-405-linux-gnu/sys-include/linux/module.h

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\usrcode.h(1,0): Warning : in file included from usrcode.h

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\usrcode.c(26,0): Warning : in file included from usrcode.c

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\/usr/local/bin/../lib/gcc/powerpc-405-linux-gnu/4.2.2/../../../../powerpc-405-linux-gnu/sys-include/linux/resource.h(2,0): Warning : #warning "You should include . This time I will do it for you."

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\/usr/local/bin/../lib/gcc/powerpc-405-linux-gnu/4.2.2/../../../../powerpc-405-linux-gnu/sys-include/linux/sched.h(10,0): Warning : in file included from /usr/local/bin/../lib/gcc/powerpc-405-linux-gnu/4.2.2/../../../../powerpc-405-linux-gnu/sys-include/linux/sched.h

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\/usr/local/bin/../lib/gcc/powerpc-405-linux-gnu/4.2.2/../../../../powerpc-405-linux-gnu/sys-include/linux/module.h(9,0): Warning : in file included from /usr/local/bin/../lib/gcc/powerpc-405-linux-gnu/4.2.2/../../../../powerpc-405-linux-gnu/sys-include/linux/module.h

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\usrcode.h(1,0): Warning : in file included from usrcode.h

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\usrcode.c(26,0): Warning : in file included from usrcode.c

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\/usr/local/bin/../lib/gcc/powerpc-405-linux-gnu/4.2.2/../../../../powerpc-405-linux-gnu/sys-include/linux/rbtree.h(128,0): Error : expected ',' or '...' before 'new'

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\usrcode.h(1,0): Warning : in file included from usrcode.h

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\usrcode.c(26,0): Warning : in file included from usrcode.c

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\/usr/local/bin/../lib/gcc/powerpc-405-linux-gnu/4.2.2/../../../../powerpc-405-linux-gnu/sys-include/linux/module.h(41,0): Error : field 'attr' has incomplete type

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\/usr/local/bin/../lib/gcc/powerpc-405-linux-gnu/4.2.2/../../../../powerpc-405-linux-gnu/sys-include/linux/module.h(49,0): Error : field 'kobj' has incomplete type

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\/usr/local/bin/../lib/gcc/powerpc-405-linux-gnu/4.2.2/../../../../powerpc-405-linux-gnu/sys-include/sched.h(32,0): Warning : in file included from /usr/local/bin/../lib/gcc/powerpc-405-linux-gnu/4.2.2/../../../../powerpc-405-linux-gnu/sys-include/sched.h

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\/opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/posix/sched.h(58,0): Warning : in file included from /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/posix/sched.h

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\/opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/posix/pthread.h(147,0): Warning : in file included from /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/posix/pthread.h

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\/opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/RtGpShm.h(26,0): Warning : in file included from /opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/RtGpShm.h

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\usrcode.h(2,0): Warning : in file included from usrcode.h

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\usrcode.c(26,0): Warning : in file included from usrcode.c

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\/usr/local/bin/../lib/gcc/powerpc-405-linux-gnu/4.2.2/../../../../powerpc-405-linux-gnu/sys-include/bits/sched.h(62,0): Error : redefinition of 'struct sched_param'

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\/usr/local/bin/../lib/gcc/powerpc-405-linux-gnu/4.2.2/../../../../powerpc-405-linux-gnu/sys-include/linux/sched.h(109,0): Error : previous definition of 'struct sched_param'

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\/opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/ecrt.h(96,0): Warning : in file included from /opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/ecrt.h

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\/opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/ethercat.h(2,0): Warning : in file included from /opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/ethercat.h

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\/opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/RtGpShm.h(32,0): Warning : in file included from /opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/RtGpShm.h

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\usrcode.h(2,0): Warning : in file included from usrcode.h

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\usrcode.c(26,0): Warning : in file included from usrcode.c

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\/usr/local/bin/../lib/gcc/powerpc-405-linux-gnu/4.2.2/../../../../powerpc-405-linux-gnu/sys-include/stdlib.h(536,0): Error : declaration does not declare anything

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\usrcode.c(46,0): Error : redefinition of 'double user_pid_ctrl_new(MotorData*)'

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\NewAMS2Solution\NewAMS2Solution\C Language\Realtime Routines\usrcode.c(36,0): Error : 'double user_pid_ctrl_new(MotorData*)' previously defined here

    Done building project "NewAMS2Solution.ppproj" -- FAILED.

     

    Build FAILED.

    Build process failed during the Realtime Routines build and download.

  8. dennisg,

     

    You need to assign your user-written servo algorithm to the desired motor first and then build and download the project. All your steps were correct, you only have to switch their orders around.

     

    Hi Sina,

     

    I'm not sure usercode.c even builds, below is my status window output.

     

    Please wait while mapping Power PMAC variables.

    End of syncing the database.

    PMAC variables are mapped successfully.

    Build Process For capp1.out has started.

    Build Process For capp1.out has ended.

     

    Build Succeeded.

     

    Please wait while downloading to Power Pmac.

    Downloading capp1.out to Power Pmac.

    Downloading global definitions.pmh to Power Pmac.

    Downloading subprog1.pmc to Power Pmac.

    Downloading prog1.pmc to Power Pmac.

    Downloading butterfly.plc to Power Pmac.

    Downloading encoder_test.plc to Power Pmac.

    Downloading populate conv table.plc to Power Pmac.

    Downloading selectable_freqs.plc to Power Pmac.

    Downloading stepped sine.plc to Power Pmac.

    Downloading pp_startup.txt to Power Pmac.

    Downloading pp_disable.txt to Power Pmac.

    Downloading pp_proj.ini to Power Pmac.

    uploading pp_error.log file from the Power Pmac.

    uploading pp_proj.log file from the Power Pmac.

    uploading pp_error_hist.log file from the Power Pmac.

    uploading pp_debug.txt file from the Power Pmac.

    uploading pp_proj.h file from the Power Pmac.

    Downloading NewAMS2Solution.ppproj to Power Pmac.

    Uploading and syncing PMAC variables.

    Download Successful.

  9. I am trying to write/use my first user written servo routine. I am following the instructions given starting on page 493 of the users manual.

     

    I compile and download using the "Build and download all programs" selection, this appears to work. Then I go into Realtime Routines User Servo Setup after right clicking the selection. In the dropdown I see my user_pid_ctrl as an available selection, and I chose that as User Servo 1. When I hit "apply" I get a popup window that says "Please BUILD and DOWNLOAD the project for the User Servo Setup Changes to take effect".

     

    I am apparently missing a step here but unsure what that is. Actually I am not totally sure that usercode.c is even being compiled because I put a typo in it to see if it would error on the build and it does not. All I see in the status window is that capp1.c built.

  10. Can somebody upload the screen capture of the problem?

    There is one more suggestion, you may want to update the IDE and Firmware to the last release that is Sept 2011.

    Thanks,

    Atul

     

    I am running the Sept 2011 firmware here. The next time I see this I will do a screen cap. FWIW this seems to happen to windows that getting frequent updates (velocity, watches, etc.)

     

    Followup: I have attached a screen cap of the watch window in this failure mode. I've also seen it at least on the velocity too.

    13035873_WindowFailure.thumb.jpg.6fe8533ab3123be2797f2321edafcc0d.jpg

  11. Please make sure to click some where else (leave the drop-down list) so the value to be sent to PMAC. You can check the actual value of the Sys.MaxRtPlc in the terminal window. I have checked this and it is working fine for me.

     

    Thanks Sina, I see it in the terminal window and it appears to change to 3 when I input sys.maxrtplc=3. However when I subsequently load mt PLC that is set to 2 via open plc 2 and look at the task manager, it shows up as a PLC instead of an RTPLC. I do have two other PLC's loaded with it and they are numbered 0, and 1.

  12. I am trying to increase Sys.MaxRtPlc from 1 to 3 via the IDE window Delta Tau->Configure-Setup Variables. It will change but reverts to 1 as soon as I try and run a PLC. I am obviously not using this correctly but I'm at a loss to figure out how to get the change to take.
  13. Are you sure you have a 4 channel version of ACC-28E and not a 2 channel one?

     

    Thanks to CharlesP there who was kind enough to send me a new unreleased draft version of the ACC-28 manual which I found easier to read, I was able to determine we did indeed only have a 2 channel board. I did some looking around here and found another 2 channel and brought it up for my 3rd channel.

  14. dennisg,

     

    Please check the , under section titled: "Acc28E Status Data Structure Elements".http://forums.deltatau.com/filedepot/download.php?f=Power%20PMAC/Manuals/Power%20PMAC%20Software%20Reference%20Manual.pdf [FILE REMOVED]

     

    In order to read an analog input, you don't have to assign it to a motor. You can either read the Acc28E.AdcSdata[j] or Acc28E.AdcUdata[j] directly, or you can define your own custom name for it:

    #define InputTemp Acc28E[0].AdcSdata[0]

     

    If you want to read the analog feedback as an input to a motor servo loop, you should read the input using encoder conversion table, which is explained in the , under the section titled: "Setting Up the Encoder Conversion Table". You should use entry Type 1: Single-Register Parallel Read.http://forums.deltatau.com/filedepot/download.php?f=Power%20PMAC/Manuals/Power%20PMAC%20User [FILE REMOVED]

     

    Thanks Sina, is there anything I have to do to specifically enable 3 & 4? I ask because I see the expected raw data on 1 & 2 (Acc28E[1].AdcUdata[0].a, Acc28E[1].AdcUdata[1].a) but not 3 (Acc28E[1].AdcUdata[2].a).

  15. [quote='dennisg' pid='3623' dateline='1340722303'] [quote='bradp' pid='3622' dateline='1340722071'] Yes you can put it there or make a seperate .pmh file. Make sure the settings match what your system needs. At the moment this is covered in the Power Pmac User's Manual and in the PPmac training class. Search for IDE in the user manual and although all data is not in one spot after reading all the things you find you will have enough information. [/quote] Thanks. The PPmac training class is unfortunately not in the picture for me presently so doing this the "hard way". I'll search the manual as you described. [/quote] Another newbie question. I have a basic PLC running and have included much of your code into my global_definitions.pmh file. While debugging it I set some watchpoints to see if I can see inputs. If I set the raw inputs to the encoder table as watches (i.e. Sys.piom + $A00000, and Sys.piom + $A00004) I see activity that looks like floating inputs. My current understanding (misunderstanding?) is that Motor[1].pEnc = EncTable[1].a and Motor[1].pEnc2 = EncTable[1].a are what get the output of the encoder table. If I set those as watchpoints I just see integer values that do not change. Understanding that I am still trying to understand how the I/O works I am sure I am viewing this incorrectly. How can I set watchpoints that display the output of the table? I think this output represents a "smoothed" version of the raw inputs. I have attached the PLC I'm using, it was written before my time here but does work. Our setup seems similar to the one in your example although I could be completely wrong. We would like to use the the Renishaw and ACC-84E on our project under development. We are at the proof of concept stage right now.
  16. [quote='bradp' pid='3622' dateline='1340722071'] Yes you can put it there or make a seperate .pmh file. Make sure the settings match what your system needs. At the moment this is covered in the Power Pmac User's Manual and in the PPmac training class. Search for IDE in the user manual and although all data is not in one spot after reading all the things you find you will have enough information. [/quote] Thanks. The PPmac training class is unfortunately not in the picture for me presently so doing this the "hard way". I'll search the manual as you described.
  17. [quote='bradp' pid='3619' dateline='1340696207'] I used it as just a configuration file (.pmh) to load and make a setup at power-on / reset [/quote] Should I just put this code in the global_definitions.pmh file? Also is there a document that describes the use of that file or any .pmh file? I am still coming up to speed with this development environment and hardware. TIA
  18. I have another of my newbie to Delta Tau questions. I am just now embarking on getting this particular combination of hardware running. I am still figuring out how the different program types work. Is this code intended as a PLC or something else ? Thanks, Dennis [quote='bradp' pid='688' dateline='1284046430'] The standard manual is found at this link. It only describes Turbo PMAC http://www.deltatau.com/manuals/pdfs/ACC-84E.pdf?id=634158233091868750 Here is an example on how to use it with Power PMAC: [/quote]
  19. I am working with and inherited project/solution, and I'm new to this development environment. the .sln I am using was created 2 years ago. So far I have been able to get the PLC's to download and run, now I am tackling warnings and errors during compilation of usercode.c a typical error shows up like this

     

    C:\Users\dennis.gabler\Documents\PowerPmacSuite\AMS2C\AMS2B\C Language\Realtime Routines\/usr/local/bin/../lib/gcc/powerpc-405-linux-gnu/4.2.2/../../../../powerpc-405-linux-gnu/sys-include/stdlib.h(536,0): Error : declaration does not declare anything

     

    I do not know if this code ever actually compiled, the author is long gone. I'm trying to figure out what is happening. I downloaded and installed the latest version of the PMAC IDE which I assume is using a newer version of the gcc suite. These errors may be related to when the solution file was created and it's referencing the wrong files when it spawns the compiler. Any suggestions would be greatly appreciated. All errors seem to come from gcc header files.

  20. Do you want to show the plot in your own HMI or do you just need the information during the product development using IDE?

     

    This would be for information during product development.

×
×
  • Create New...