Jump to content
OMRON Forums

sjlee5

Members
  • Posts

    24
  • Joined

  • Last visited

Posts posted by sjlee5

  1. Hi,

     

    You can find codes below in "pp_proj.h" file.

     

    #define SetPtrVar(i, x)                 SetEnumPtrVar(i, x)
    #define SetPtrArrayVar(i, j, x)         SetEnumPtrArrayVar(i, j, x)
    #define GetPtrVar(i)                    GetEnumPtrVar(i)
    #define GetPtrArrayVar(i, j)            GetEnumPtrArrayVar(i, j)
    

     

    It has better performance to access M pointer variables in you code.

    Please check it !

  2. Hi,

     

    I think this is not bug.

    The source files in your PPMAC directory may be exist before you download the Project.

    Because at boot time PPMAC copies saved project to /var/ftp/usrflash.

    So if previously saved project contains C source file, then it will be copied to /var/ftp/usrflash.

     

    Maybe "Build & Download project" does not delete files already exist.

     

    Connect to your PPMAC with Putty.

    And change directory to /var/ftp/usrflash/Project/C\ Language with "cd" command.

    Then remove all files and directories inside this folder.

    After delete all files then "build & download" project again.

     

    cd /var/ftp/usrflash/Project/C\ Language/

    rm -r *

     

    I think that you have many C source files and it takes long time to compile, not downloading project.

     

    I hope someone who is in charge of SW development can add exact replies.

  3. Hi,

     

    Did you checked my suggested filter values?

     

    In the previous thread, you attached some configuration file.

    and there the Sys.ServoPeriod is "0.442742110000000022".

    I think this is the factory setting.

     

    I tested again and this is the result of moving test and the dithering status of not moving.

     

    PlotOfStepper.thumb.png.7dd6a4a3b73f7ef45d8536a033ba43fe.png

     

    I cannot find any problems.

     

    I think you did not tuned servo or not properly set the filter values.

     

    Please check again.

    PowerPmac10.zip

  4. Hi,

     

    In my case,

     

    ptr PointerTest->Sys.Fdata[L0]
    

    Above code does not work and got an error when build and download.

     

    But below does work correctly without any error messages.

    ptr PointerTest->*
    PointerTest->Sys.Fdata[L0]
    

     

    Is there anyone who could explain differences between two codes ?

  5. Hi, mshaver.

     

    I'm using the same system configuration with steppers.

     

    If you are using the default Sys.Servoperiod, belows may be the same.

     

    This is my setup.

    close
    
    // Motor1 Stepper Axis Setup
    Gate1[4].Chan[0].EncCtrl=8;	// Internal Pulse & Direction
    Gate1[4].Chan[0].OutputMode=3;
    Motor[1].DacBias=0;
    Motor[1].pDac=Gate1[4].Chan[0].Pwm[2].a;
    Motor[1].pLimits=0;		// Disable Limits
    Motor[1].pAmpFault=0;	// Disable Amp Faults
    Motor[1].Servo.Kp = 10;
    Motor[1].Servo.Kvfb = 0;
    Motor[1].Servo.Kvff = 15;
    Motor[1].Servo.Ki = 0;
    Motor[1].Servo.SwZvInt = 0;
    Motor[1].Servo.Kaff = 0;
    Motor[1].Servo.OutDbOn = 0.5;
    Motor[1].Servo.OutDbOff = 0.5;
    Motor[1].Servo.OutDbSeed = 1;
    
    // Motor2 Stepper Axis Setup
    Gate1[4].Chan[1].EncCtrl=8;	// Internal Pulse & Direction
    Gate1[4].Chan[1].OutputMode=3;
    Motor[2].DacBias=0;
    Motor[2].pDac=Gate1[4].Chan[1].Pwm[2].a;
    Motor[2].pLimits=0;		// Disable Limits
    Motor[2].pAmpFault=0;	// Disable Amp Faults
    Motor[2].Servo.Kp = 10;
    Motor[2].Servo.Kvfb = 0;
    Motor[2].Servo.Kvff = 15;
    Motor[2].Servo.Ki = 0;
    Motor[2].Servo.SwZvInt = 0;
    Motor[2].Servo.Kaff = 0;
    Motor[2].Servo.OutDbOn = 0.5;
    Motor[2].Servo.OutDbOff = 0.5;
    Motor[2].Servo.OutDbSeed = 1;
    
    // Motor3 Stepper Axis Setup
    Gate1[4].Chan[2].EncCtrl=8;	// Internal Pulse & Direction
    Gate1[4].Chan[2].OutputMode=3;
    Motor[3].DacBias=0;
    Motor[3].pDac=Gate1[4].Chan[2].Pwm[2].a;
    Motor[3].pLimits=0;		// Disable Limits
    Motor[3].pAmpFault=0;	// Disable Amp Faults
    Motor[3].Servo.Kp = 10;
    Motor[3].Servo.Kvfb = 0;
    Motor[3].Servo.Kvff = 15;
    Motor[3].Servo.Ki = 0;
    Motor[3].Servo.SwZvInt = 0;
    Motor[3].Servo.Kaff = 0;
    Motor[3].Servo.OutDbOn = 0.5;
    Motor[3].Servo.OutDbOff = 0.5;
    Motor[3].Servo.OutDbSeed = 1;
    
    // Motor4 Stepper Axis Setup
    Gate1[4].Chan[3].EncCtrl=8;	// Internal Pulse & Direction
    Gate1[4].Chan[3].OutputMode=3;
    Motor[4].DacBias=0;
    Motor[4].pDac=Gate1[4].Chan[3].Pwm[2].a;
    Motor[4].pLimits=0;		// Disable Limits
    Motor[4].pAmpFault=0;	// Disable Amp Faults
    Motor[4].Servo.Kp = 10;
    Motor[4].Servo.Kvfb = 0;
    Motor[4].Servo.Kvff = 15;
    Motor[4].Servo.Ki = 0;
    Motor[4].Servo.SwZvInt = 0;
    Motor[4].Servo.Kaff = 0;
    Motor[4].Servo.OutDbOn = 0.5;
    Motor[4].Servo.OutDbOff = 0.5;
    Motor[4].Servo.OutDbSeed = 1;
    

     

    Please refer to the settings above.

     

    I'm sure this settings would be fine.

  6. I suggest you to use "Motor[x].MasterPos".

     

    And there are reserved bits(bit2,3) in "Motor[x].MasterCtrl".

    If you use reserved bit 3 then you can control using or not.

     

    My code is like this.

     

    double dPrevDesPos, dCurrDesPos, dDeltaPos;
    
    double user_written_servo_routine_2(struct MotorData *Mptr)
    {
       if (Mptr->MasterCtrl&0x08)
       {
           dCurrDesPos = *((double *)pushm+10);  // if use Sys.Ddata[10]
           dDeltaPos = dCurrDesPos - dPrevDesPos;
           Mptr->MasterPos += dDeltaPos;
           dPrevDesPos = dCurrDesPos;
       }
       else
       {
           dPrevDesPos = *((double *)pushm+10);
       } 
    
       return pshm->ServoCtrl(Mptr);
    }
    

     

    I don't know there would be other problems.

    Please refer to my code.

  7. I'd like to confirm daves findings.

     

    My system (v 1.6.030) always reports UserAlgo.CFunc=0. I've tried setting it =1 from the terminal window and in "pp_startup.txt". Neither works. However, despite this setting always being =0, if I try using a "CfromScript" call it works in some cases:

     

    Call from PLC 0 - yes OK

    Call from motion program - yes OK

    Call from PLC 1 (background) - not OK

     

    If I understand the manual correctly, none of these should work when UserAglo.CFunc=0!

     

    Can someone at DeltaTau explain what we are doing wrong - or whether it's in fact a system bug, and if so, whether it's being worked on?

     

    Thanks.

     

    Hi,

     

    "UserAlgo.CFunc=1" enables that the function can be called from background routines.

    If you do not set "UserAlgo.CFunc=1", you can access CfromScript from Realtime Interrupt ( RTI PLCs, RTICPLCs, kinematics, etc... ).

     

    And, as I know it's better to insert "UserAlgo.CFunc=1" in "global_definitions.pmh".

     

    Lastly, If you want to set "UserAlgo.CFunc=1", you should declare "double CfromScript(..)" in usrcode.c and usrcode.h and export Symbol.

    You cannot set "UserAlgo.CFunc=1" before declaring "CfromScript" function.

     

    I succeeded in the way described above.

  8. Please be aware that the WEB-server for Power PMAC (especially the "Diagnostics" features like the step move) was designed for the older version of firmware (1.4.0.27) and is not compatible with the new firmware (1.6.0.9). This code interfaces with the gplib library of Power PMAC.

     

    We do not have plans to update this code for later firmware. If you are familiar with Linux and you understand the gplib library of Power PMAC you could rewrite this code.

     

    Hi,

     

    Then where is the source code and what file should I rewrite.

    Could you tell me more in details ?

     

    Thank in advance.

  9. My company has been trying to solve the same problem but we were basically told to rewrite our HMI in C# instead. If you ever find a way to talk to the power pmac with C++ would you let me know?

     

    Hi, All.

     

    I was struggling with the same problem.

     

    At first, I imported C# library in VS2010 C++ compiler.

    But there was some problems with memory leakage.

    And it cannot be used with older version of VS compiler lik VC++6.0.

     

    So, I decided to make library on my own.

    It is written in C++. and you can compile with all versions of C++ compiler from VC++6.0 to VS2010.

     

    But, it's the begining step, and I will add more functions.

     

    Up to now, there are simple functions talking to PPMAC.

    Here's the list of API functions.

     

    UINT WINAPI DTKPowerPmacOpen(DWORD dwIPAddress, INT nPortNo, UINT uMode);

    UINT WINAPI DTKPowerPmacClose(UINT uDeviceID);

    UINT WINAPI DTKConnect(UINT uDeviceID);

    UINT WINAPI DTKDisconnect(UINT uDeviceID);

    UINT WINAPI DTKIsConnected(UINT uDeviceID, PBOOL pConnected);

    UINT WINAPI DTKGetResponseA(UINT uDeviceID, LPSTR lpCommand, LPSTR lpResponse, INT nLength);

    UINT WINAPI DTKGetResponseW(UINT uDeviceID, LPWSTR lpwCommand, LPWSTR lpwResponse, INT nLength);

    UINT WINAPI DTKSendCommandA(UINT uDeviceID, LPSTR lpCommand);

    UINT WINAPI DTKSendCommandW(UINT uDeviceID, LPWSTR lpwCommand);

    UINT WINAPI DTKSetReceiveA(UINT uDeviceID, PRECEIVE_PROC_A lpReveiveProc);

    UINT WINAPI DTKSetReceiveW(UINT uDeviceID, PRECEIVE_PROC_W lpwReveiveProc);

     

    ( DTK is just abbreviation of DeltaTau Korea... )

     

    I hope it may be helps to you.

     

    If you have any question about API, please do not hesitate to reply.

    PowerPMAC2010Example.zip

  10. Dear Mr. Sina,

    Is there any similar option available in Turbo PMAC? If not can you suggest me a way to display the executing line in the GUI. I don't need the "Jump to a section" option. In my GUI, I use both Rotary and Motion program buffer.

     

    Hi, Raghav

     

    I suggest to use synchronous M-variables.

     

    You can add synchronous M-variables at the front of the every single line.

     

    This is example.

     

    M100->*

     

    OPEN PROG 1 CLEAR

     

    ...

    M100==1 X 10

    M100==2 X 5 Y 20

    ...

    CLOSE

     

    Then you can monitor "M100" variable in you GUI.

     

    I hope this may be help to you.

  11. If your command is correct,

     

    please test code below.

     

    if you want to use system command with argument in terminal (on-line command),

    as I know,

    you should use with cx or cpx command.

     

    p1=500

    cx system"ethercat -m0 -p0 -t int16 download 0x607D 0 %d", p1

     

    try it, and please check again.

  12. Hi, andyf.

     

    As I said before... there's no compile action in terminal.

     

    And you can check your subprogram in terminal.

     

    if you list your subprog in terminal, there's response like below.

     

    list subprog testsub

     

    return;

    n10000:

    L1=L0+2

    return

     

    As you see, "testsubinside" tag is changed to "n10000".

    so you can use like this.

     

    cx R0=3; call testsub.01; P1=R1;

     

    This is all I know about subprogram call in terminal.

     

    Anyone who know more about this subject, please tell us in more detail.

     

    Thanks.

  13. Hi, ..

     

    I think you can use "cx" or "cpx" on-line command.

     

    You cannot use "call" or "callsub" command directly in terminal.

    As I know, it's a buffer program command ( can only be used in prog or subprog or plc script )

     

    So, you have to use "cx" or "cpx" command to execute "call".

     

    "cx" is a command that can execute plc command in terminal.

    "cpx" is a command that can execute prog command in terminal.

     

    And one thing to keep in your mind is that,

    compiler is not working in the on-line command.

     

    for example there are subprog below.

     

    open subprog AddData(data1, data2, &result)

    result = data1+data2

    close

     

    and you can call subprogram in motion prog or plc like below.

     

    open plc 1

    local data1, data2, result;

    data1 = 3

    data2 = 4

    call AddData(data1, data2, &result)

    P1 = result

    disable plc 1

    close

     

    you can use "call AddData(data1, data2, &result)" in the buffer program.

    but can not use in the terminal because there's no compile action.

     

    So you must use L & R variables to use subprogram with arguments.

     

    in terminal.

     

    cx R0=3;R1=4;call AddData;P1=R2

     

    then, you can read the result in P1 variable.

     

    P1 = 7

     

    I hope this helps.

  14. Hi, dro.

     

    Thanks for your fast reply.

     

    I tested again.

     

    And there's no process which is named "make.exe",

    but there appeared new process which is named "cmd.exe".

     

    I killed 5 times this process, then it resumed building project and download.

     

    TaskManager.PNG.0ccf5ce8a32c9a57c143a4dbe4cb89c1.PNG

     

    And up to now there's no malfunction in PPMAC.

     

    Um... it worked but hard to use like that.

     

    I need your solution.

     

    This is the same in other PCs using Windows 8 OS.

     

    waiting for your reply...

     

    thanks.

  15. Hi,

     

    I'm in trouble with open/make new Power PMAC project in Windows 8 OS.

     

    The communications and others are fine.

     

    But when I open or make project, IDE hangs up.

     

    The Output message is stopped at

     

    "Please wait while setting up the compile options".

     

    How can I fix it up?

     

    Please answer ASAP.

    Thanks in advance.

  16. Hi,

     

    I got a same problem in gathering Coord[1].Q[0].

     

    It should be a bug in Plot program.

     

    When I added Coord[n].xxx, then Plot program set Coord[0].xxx .

    It's the problem.

     

    I checked Gather.Addr[x] and found out the address is changed

    after I pushed "Gather Data" button in Plot program.

     

    But, temporarily you can fix this problem with script plc etc.

    (Don't start gathering with "Gather Data" button in Plot)

     

    After you added items to gather, then check Gather.Addr[x].

    If you push "Gather Data" and check Gather.Addr[x].

     

    The address is changed like this

     

    [Data to Sample]

    Coord[1].Q[0]

     

    [ in Terminal ]

    Gather.Addr[x]

    Gather.Addr[x]=3190152032

     

    "3190152032" is the address of Coord[0].Q[0]

    you can check in Terminal.

     

    [ in Terminal ]

    Coord[0].Q[0].a

    Coord[0].Q[0].a=$be25db60 ; (3190152032 in decimal)

     

    Plot program always uses Coord[0] as index.

    It should be a bug.

     

    My temporary solution is this.

     

    1. Add Gather Items in Plot

    - Coord[1].Q[0]

    2. In your plc, write like this. ( or command sequentially in you termianl )

     

    ...

    Gather.Addr[x] = Coord[1].Q[0].a

    Gather.Enable = 2

     

    3. After Gather is done.

    ...

    Gather.Enable = 0

     

    4. Then, "Upload Data" in Plot, and plot data.

     

    It's just temporary solution.

     

    It should be fixed in next update.

     

    I hope you will succeed.

  17. I think that you should choose another ip class on eth1.

     

    for example,

     

    auto eth0

    iface eth0 inet static

    address 195.0.0.4

    netmask 255.255.255.0

    gateway 195.0.0.4

     

    auto eth1

    iface eth0 inet static

    address 195.0.1.4

    netmask 255.255.255.0

    gateway 195.0.1.4

     

    then I can connecting a PC to eth0 via 195.0.0.4

    and connecting a PC to eth1 via 195.0.1.4

     

    Before do that, you should add another IP address such as "192.0.1.123" to your network card in windows network settings.

     

    I hope you solve this problem.

     

    good luck!

  18. Hi, I'm wondering that what is the precision of "TM" and "DELAY" in using external timebase. In "Turbo SRM.pdf", it explaines that the resolution of "TM" is 0.5 msec when using LINEAR or CIRCLE commands. And "DELAY" is a floating point variable. But In "Turbo PMAC User Manual.pdf", there's an example about External timebase which is different from explained aboves. In this example, ... TM 585.9375 X10000 DELAY 500 TM 953.125 ... Is this sample code is right? Please confirm that what is the resolution of TM and DELAY in external timebase exactly. I think it is very important in using external timebase. Have a nice day!
×
×
  • Create New...