MatheusPereira Posted March 15, 2019 Posted March 15, 2019 Hello, I'm having some trouble when trying to gather Sys.Time values into a file. I'm running a motion program: gather.enable = 0 Gather.addr[0]=Sys.Time.a Gather.addr[1]=Motor[2].ActPos.a Gather.addr[2]=Motor[4].ActPos.a Gather.addr[3]=Motor[2].ActVel.a Gather.addr[4]=Motor[4].ActVel.a Gather.items=5 Gather.Period=1 gather.enable = 3; dwell 0 --motion code--- gather.enable = 0; dwell 0 enable plc GATHERPLC // sends system "gather -u /var/ftp/gather/data.txt" But when I check the generated data file, the first column values does not match with the values I expected and see for Sys.Time on the Watch window. I tried to change Gather.Type[0] to 5, but I got weird numbers. The rest of the columns are ok with the variables as it was specified. I would like to have Sys.Time value in seconds. Another problem I'm having is that the full motion program have duration of 51 seconds, and the gather file has only information for the last 12 seconds, it's missing data. Is it beacause of any file limitation size?
Omron Forums Support Posted March 19, 2019 Posted March 19, 2019 Is this number a large integer? If so it should be a number of servo counts. You can multiply this by Sys.ServoPeriod/1000 to get time in seconds.
MatheusPereira Posted March 20, 2019 Author Posted March 20, 2019 Is this number a large integer? If so it should be a number of servo counts. You can multiply this by Sys.ServoPeriod/1000 to get time in seconds. Yes, it worked, really thank you. I still have the issue of the file limitation. Even if a change Gather.MaxLines to a high number (around 1000000), I'm still getting only 16000 lines that are just for the last 3.5 seconds of a 20 seconds motion program I'm running right now.
Omron Forums Support Posted March 20, 2019 Posted March 20, 2019 Gather.MaxSamples is not used in this mode, and the buffer is used in “rotary” fashion, with new samples overwriting older samples as necessary. You may need to increase your gather period or lower the number of variables to sample.
Alex Anikstein Posted March 22, 2019 Posted March 22, 2019 Matheus, If you're already using a system command to do the gather, try instead system "gather >> /var/ftp/gather/data.txt" (after the gather has already started but before your motion/data to gather occurs) or "gather -w >> /var/ftp/gather/data.txt" (before you issue the gather command--the "-w" will tell the pmac to "wait" for a gather to start).
MatheusPereira Posted March 25, 2019 Author Posted March 25, 2019 Changing gather.period to 2 worked. I guess that 10 kHz sampling frequency (servo frequency) was too fast for acquiring and wiriting data properly in this case. Thank you all for the attention.
Recommended Posts