Jump to content
OMRON Forums

A quick glance at Power PMAC Gather setup


Sina.Sattari
 Share

Recommended Posts

The following is an example on how to setup the gather feature in the Power PMAC. Gather.enable = 0 ;disable = 1 ; pause & setup = 2 ; run & setup Gather.addr[] ;source address Ldata.Type ; After assign address and Ldata.Type will be return gather.type Gather.type[] = 0 ;unsigned 32bit = 1 ;signed 32bit = 2 ;unsigned 24bit = 3 ;signed 24bit = 4 ;float 32bit = 5 ;double 64bit Gather.Items ;# of items to gather (128 sources) Gather.Period = 1 ;every servo = 2 ;2 every other servo etc. Gather.MaxLines ; after assign address and Gather.enable=1 then Maxlines will ;calculate Max buffer size, so MaxSamples have to be less then ;Maxlines Gather.MaxSamples ;# of samples to gather if doing a traditional gather that fits into ;internal buffer, do not exceed Gather.MaxLines Gather. ******************** Examples ***************** Gather.enable = 0 Gather.addr[0]=Sys.ServoCount.a Gather.addr[1]=Motor[0].ActPos.a Gather.addr[2]=Motor[0].DesVel.a Gather.addr[3]=Motor[0].PosError.a Gather.items=4 Gather.Period=1 Gather.MaxSamples=2147483647 Gather.enable = 2 Gather.Enable = 0 Gather.Phaseenable = 0 Gather.Phaseaddr[0]= Sys.ServoCount.a Gather.Phaseaddr[1]=Motor[0].ActPos.a Gather.Phaseaddr[2]=Motor[0].DesVel.a Gather.Phaseaddr[3]=Motor[0].PosError.a Gather.Phaseitems=2 Gather.PhasePeriod=1 Gather.PhaseMaxSamples=200000 Gather.Phaseenable = 1 Gather.Phaseenable = 2 Gather.Phaseenable Gather.Phaseaddr[0] Gather.Phasetype[0] Gather.Phaseaddr[1] Gather.Phasetype[1] Gather.Phaseaddr[2] Gather.Phasetype[2] Gather.Phaseaddr[3] Gather.Phasetype[3] Gather.Phaseitems Gather.PhasePeriod Gather.PhaseMaxSamples Gather.Phaseenable Gather.Phaseenable How to export the gather to a file in ftp:// …/Gather folder In the telnet session, Issue the following Commands: sync gather -u /var/ftp/gather/gatheroutput.txt if gather at phase rate: sync gather -p -u /var/ftp/gather/gatheroutput.txt
Link to comment
Share on other sites

  • 1 year later...
  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

This process has worked for me in the past, but today I receive the following error when trying to download the gather data: login as: deltatau deltatau@192.168.100.210's password: Linux powerpmac 2.6.30.3 #12 Tue Nov 17 13:58:49 PST 2009 ppc --------------------------------- -- PowerPMAC Motion Controller -- --------------------------------- You have new mail. Last login: Thu Oct 7 03:57:41 2010 from 192.168.100.215 deltatau@powerpmac:~$ sync deltatau@powerpmac:~$ gather -u /var/ftp/gather/oct14_100hz.txt Xenomai: binding failed: Operation not permitted. deltatau@powerpmac:~$ Any ideas? I am using the 8/26/2010 IDE and firmware 1.2.1.5. This is the first time I've tried to transfer data after the firmware update. Thanks, Scott
Link to comment
Share on other sites

Lack of permissions as you are trying this as a non root. You can use ftp and login in as user ftp with a password ftp and get the file. If you really want to try doing it through deltatau check out this link. I have not tried this myself. [url]http://www.xenomai.org/index.php/Non-root_RT[/url] [quote='scott.eichhorn@etrema.com' pid='772' dateline='1287085629'] This process has worked for me in the past, but today I receive the following error when trying to download the gather data: login as: deltatau deltatau@192.168.100.210's password: Linux powerpmac 2.6.30.3 #12 Tue Nov 17 13:58:49 PST 2009 ppc --------------------------------- -- PowerPMAC Motion Controller -- --------------------------------- You have new mail. Last login: Thu Oct 7 03:57:41 2010 from 192.168.100.215 deltatau@powerpmac:~$ sync deltatau@powerpmac:~$ gather -u /var/ftp/gather/oct14_100hz.txt Xenomai: binding failed: Operation not permitted. deltatau@powerpmac:~$ Any ideas? I am using the 8/26/2010 IDE and firmware 1.2.1.5. This is the first time I've tried to transfer data after the firmware update. Thanks, Scott [/quote]
Link to comment
Share on other sites

Hi Henry, I think I must be missing something. Per Sina's instructions, I thought I needed to create the gather text file though a Telnet session: [i]How to export the gather to a file in ftp:// …/Gather folder In the telnet session, Issue the following Commands: sync gather -u /var/ftp/gather/gatheroutput.txt[/i] Then I would FTP in to transfer the text file. The errors I posted were when I tried to create the text files in the Telnet session. I hadn't had permission issues before. I'm hesitant to mess with Xenomai since I don't have the slightest idea what unintended issues I might cause. Do Sina's instructions need to be revised for the latest firmware, or is there something fundamental I am not grasping? Thanks again, Scott
Link to comment
Share on other sites

  • 5 weeks later...
This works as far as it goes, but I want to use the 'indefinite;' gather mode, where Gather.Enable = 3. I also want to acquire the data in a binary format rather than the csv that gather() logs. I'd hope to be able to do all that with a background C program, but could do wiith a little help on the C interface to the gather system. -artag
Link to comment
Share on other sites

  • 4 months later...
The Gather Buffer is just a series of bytes so to access the Gather Buffer Data from a C App you must know what type of variables you gathered. Then you can access the buffer directly and offset your pointer the correct number of bytes for each element that was gathered. pGatherBuffer = (char *)(pSharedMem->Gather.Buffer); samples = pSharedMem->Gather.Index; *timeConstant = 0.0; fpGather = fopen ("/var/ftp/gather/autotune_gather.txt", "w"); //-------------------------------------------------------------------------- // Read in gathered data and compute the following error and min max // following error //-------------------------------------------------------------------------- for (i = 0; i < samples; i++) { memcpy(&t, (unsigned char*)pGatherBuffer, sizeof(unsigned)); pGatherBuffer += sizeof(unsigned); memcpy(&cmdpos,(unsigned char*) pGatherBuffer, sizeof(double)); pGatherBuffer += sizeof(double); memcpy(&actpos, (unsigned char*)pGatherBuffer, sizeof(double)); pGatherBuffer += sizeof(double); memcpy(&dac, (unsigned char*)pGatherBuffer, sizeof(float)); pGatherBuffer += sizeof(float); fprintf(fpGather, "%u %lf %lf %lf\r\n", time, cmdpos, actpos, dac); } fclose(fpGather);
Link to comment
Share on other sites

Here is a cleaned up version of the above code, put into an actual Background C App for reference: [code] //-------------------------------------------------------------------------------- #include // Global Gp Shared memory pointer //------------------------------------------------------------- // The following is a projpp created file from the User defines //------------------------------------------------------------- #include "../../Include/pp_proj.h" int main(void) { char *pGatherBuffer; double samples,time,cmdpos,actpos,dac; unsigned int i; FILE *fpGather; InitLibrary(); pGatherBuffer = (char *)(pshm->Gather.Buffer); samples = pshm->Gather.Index; fpGather = fopen("/var/ftp/gather/autotune_gather.txt", "w"); //-------------------------------------------------------------------------- // Read in gathered data and output to data file //-------------------------------------------------------------------------- for (i = 0; i < samples; i++) { memcpy(&time, (unsigned char*)pGatherBuffer, sizeof(unsigned)); pGatherBuffer += sizeof(unsigned); memcpy(&cmdpos,(unsigned char*)pGatherBuffer, sizeof(double)); pGatherBuffer += sizeof(double); memcpy(&actpos, (unsigned char*)pGatherBuffer, sizeof(double)); pGatherBuffer += sizeof(double); memcpy(&dac, (unsigned char*)pGatherBuffer, sizeof(float)); pGatherBuffer += sizeof(float); fprintf(fpGather, "%u %lf %lf %lf\r\n", time, cmdpos, actpos, dac); } fclose(fpGather); CloseLibrary(); return 0; } [/code]
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...