Jump to content
OMRON Forums

Eric Hotchkiss

Omron
  • Posts

    558
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by Eric Hotchkiss

  1. You can move your structure definition to a .h file. Here is my example which sets P0=12 through the member of a structure defined in structs.h. capp1.c /*For more information see notes.txt in the Documentation folder */ #include #define _PPScriptMode_ // for enum mode, replace this with #define _EnumMode_ #include "../../Include/pp_proj.h" #include "structs.h" int main(void) { InitLibrary(); // Required for accessing Power PMAC library struct AStruct MyStruct; MyStruct.MyVar1=12; pshm->P[0]=MyStruct.MyVar1; CloseLibrary(); return 0; } structs.h typedef struct AStruct { double MyVar1; double MyVar2; };
  2. Are you still having these issues? This App Note might help, it shows a method to increase the communication speed. It involves doing everything on one core, but making the change temporarily can help with development.
  3. The Power PMAC Linux installation keeps itself clean by mounting its file system as read only most of the time and copying the contents of “/.readonly/etc” and “/.readonly/var” to “/etc” and “/var” on power up. Before making changes the file system must be mounted as read/write and after making changes it must be set back to read only. mount -o remount,rw / cp /media/disk/rc.local /.readonly/etc/ mount -o remount,rw / I believe this could be placed in a shell script on the USB stick and ran from the IDE terminal with a command like the following: system /media/disk/file.sh
  4. I am assuming both encoders are quadrature. If not, the Geo Brick Drive Manual shows how to set up each encoder type. First, set up the rest of the Motor 1 normally, then change Ixx03 and Ixx04. This is how to tell the motor to use the first two encoder table entries for position and velocity. I103 = $003501 I104 = $003502 If Motor 2's output is on channels 3 and 4, the following is used. There is a table in the Software Reference Manual Entry for Ixx03 and Ixx04 with more addresses. I203 = $003503 I204 = $003504 Then from the Software Reference Manual Entry on Ixx09.
  5. Is this a hardware watchdog? Does PMAC have a red light? Did you see it in the Global Status window? If this is a soft watchdog, you should be able to prevent it by setting Sys.WDTReset and Sys.BgWDTReset to large values in pp_disable.txt. They should be set back to their default value of zero in pp_startup.txt. pp_disable is ran before the build and download to disable PMAC, pp_startup is ran once PMAC finishes the download. It may also help to use pp_disable.txt to disable PLC other processes that you believe may be an issue.
  6. The IDE only knows how to handle the folders that are built in (or in certain cases added through right click options). In your case it looks like the file containing the PLC was downloaded to PMAC, but the variables were not mapped and the code was not ran, it just went along for the ride. Normally if you want this behavior you would put your file in the download location. The PLC file can still be read in from PMAC's hard drive, but if the PLC has a name or requires any declared variables it will not work. This is the same behavior you would get if you selected the PLC code and dragged it into the terminal. If it works you would then be able to run the PLC with the command "ENABLE PLC X", where X is the name or number. The following commands can be used to read a file on pmac in the correct sense. Replace {/path/File.plc} with the actual plc file and location. Remove the {}. SSH: gpascii -i{/path/File.plc} IDE Terminal/Gpascii: system gpascii -i{/path/File.plc} Prog/PLC: system "gpascii -i{/path/File.plc}" Since you probably want your PLC to be handled normally by the IDE, I would suggest using the "PLC Programs" folder.
  7. If the hostname task were continually running, it would set the hostname based on /opt/etc/hostname (after that replaces /etc/hostname which had already been replaced by /.readonly/etc/hostname). We have have disabled it due to a past issue. Currently the name in /.readonly/hostname "wins" on boot if it is different from the name in /opt/etc/hostname. I would recommend changing both values so a future change or running /etc/init.d/hostname.sh will not change your behavior.
  8. Was this PMAC shipped with firmware 2.6.0.0 or did you have to upgrade it?
  9. This requirement starts with firmware 2.5.4.0. You need a license (it's an option in the part number) and you need Sys.EcatType=1 (or 0 for EtherLab). To change Sys.EcatType to 1, issue the following commands. system mount -o remount,rw /opt/ system sed -i 's/EcatType=2/EcatType=1/g' /opt/ppmac/usrflash/Project/Configuration/pp_proj.ini system sed -i 's/EcatType=2/EcatType=1/g' /opt/ppmac/usrflash/Project/Configuration/pp_default.ini system mount -o remount,ro /opt/ reboot
  10. I believe the difference between the CPUs is what firmware they are shipped with. Starting at firmware 2.5 or 2.6 we require that Sys.EcatType=2 for a second ethernet port. Otherwise the firmware will try to set that port up for EtherCAT (which won't work without a license). This change was to make it easier to switch between EtherCAT and a second ethernet port. Normally Sys.EcatType is write protected. To change it issue the following commands. The last command will reboot PMAC so the changes can take affect. system mount -o remount,rw /opt/ system sed -i 's/EcatType=1/EcatType=2/g' /opt/ppmac/usrflash/Project/Configuration/pp_proj.ini system sed -i 's/EcatType=1/EcatType=2/g' /opt/ppmac/usrflash/Project/Configuration/pp_default.ini system mount -o remount,ro /opt/ reboot PMAC will now maintain the setting through $$$***.
  11. If the address assigned by dhcp is 192.168.0.X, then this should assign both ip addresses to the first physical port. If it is not, both eth0 and eth1 should work independently.
  12. For the original error, please right click the bgcplc tab associated with the download error and select "Open Containing Folder". The files "err.log" and "msg.log" should have some information about the cause of the error. As far as the end of file warnings go, adding a dummy function is the best way to prevent those errors for now.
  13. Does this PMAC have two physical ethernet ports? Does it have EtherCAT? What is the response to "Sys.EcatLicense" in the IDE terminal? Could it currently be set up as one port ethernet and one port EtherCAT? What is the response to "more /opt/etc/network interfaces" over SSH?
  14. We do not offer a way to access this register from C because of complexity. CamTable[].PosData[] belongs to a dynamic shared memory table. If targetPosn was a script global variable array I believe you would be able to use the "Command" function in C to send the script assignment.
  15. Do you get this error if you try to build and download a new project? Would removing the queues include file (or any of the others for that matter) get rid of the original end of file error? I wonder if one of them ends improperly.
  16. The serialnum command works on firmware 2.4 or higher, but it requires hardware that I believe only CK3M has. Each PMAC CPU of any type does have a unique MAC ID #, which could be used to track CPUs internally. The following commands can be used to query this value. SSH: ip link show IDE Terminal/Gpascii: system ip link show Prog/PLC: system "ip link show"
  17. That information is mostly calculated by the IDE from Sys. variables within PMAC. The following Delta Time variables can be used to calculate instantaneous frequencies. Phase Also has a min and max (which the user can reset). Sys.PhaseDeltaTime Sys.ServoDeltaTime Sys.RtIntDeltaTime Sys.BgDeltaTime Sys.MinPhaseDeltaTime Sys.MaxPhaseDeltaTime Then there are also time variables that show how long each task takes to finish execution once started. Each of these time variables also has filtered, minimum and maximum values. Sys.PhaseTime Sys.ServoTime Sys.RtIntTime Sys.BgTime For Each: Sys.FltrServoTime Sys.MinServoTime Sys.MaxServoTime These can contain time from higher priority interrupts, which would need to be subtracted out to find CPU usage. If you look at Sys.FltrRtIntTime and Sys.RtIntTime in the SRM, you will find equations for filtered and instantaneous task times. For the filtered version, you can also filter the Delta Time with your own code if desired. ECAT task time comes from the following ECAT[0]. variables. Both also have a max value. ECAT[0].ServoExtension can be used with Sys.ServoDeltaTime to find an instantaneous frequency. ECAT[0].RxTime ECAT[0].TxTime ECAT[0].MaxRxTime ECAT[0].MaxTxTime ECAT[0].ServoExtension EcatTaskLoad = 100*(ECAT[0].RxTime+ECAT[0].TxTime)/(Sys.ServoDeltaTime*(1+ECAT[0].ServoExtension))
  18. Is either core of your CPU heavily loaded? Can you show your "Tasks" tab in your IDE "Task Manager"? Do you have a Shift Time defined in your "Distributed Clock" tab? I know default settings work most of the time. Ideally "Cycle Time" should be set to your servo/ecat period and "Shift Time" should be set to half of that.
  19. If the CPU was sold with the UMAC rack, then any serial number on the rack would be attached in our records. Can you get to any serial numbers?
  20. This is a known issue. The FunctionPlc has a timer that is too short. Open the "ppnc_function.plc" within the IDE project. I am attaching a screenshot. Scroll down to the first if statement. It should look like the code box below. // -------------------- Handshake GUI Initialize Bit - Login -------------- if (CommandReg == UI_Initialize) { CommandReg = UI_None // Send Initialized Handshake - Dwell 100 msec for slower PC's call timer(0.1) send1 "Initialized" } Change the timer to 1 to 2 seconds. You will have to $$$***, SAVE, $$$, Build and Download, SAVE, $$$ and reconnect with the NC software after making this change.
  21. Is it possible that the script PLC had not yet set M1 to 0 when the User Written Servo set it to 1? If you define an M-Variable to a single bit of a larger register (M1->u.user:$001880.26.1) and then set that bit to a value, there is an implicit operation. PMAC still has to read the whole value, change one bit and write that new value. In your C code you are doing the same thing explicitly. Either way there is a chance for a higher priority task to interrupt after the read and before the write, ignoring the higher priority task's changes. This should not make a difference.
  22. I have never seen the "Syntax Error - EOF" warning you are referring to. Can you show an example? Do you get it from a new project? What do you mean by a dummy function call? After you right click the CPLCs folder and add a new CPLC it should come in with all the needed function declarations.
  23. You can set the encoder up with manual settings. I used the settings below. EncTable[5].type = 11 EncTable[5].pEnc = Motor[1].IqCmd.a EncTable[5].index1 = 5 EncTable[5].index2 = 0 EncTable[5].index3 = 0 EncTable[5].index4 = 0 EncTable[5].index5 = 255 EncTable[5].index6 = 0 EncTable[5].ScaleFactor = 1 / (256 * (EncTable[5].index5 + 1) * EXP2(EncTable[5].index1)) Motor[5].ServoCtrl = 1 You can probably get better results with an actual force sensor.
×
×
  • Create New...