Jump to content
OMRON Forums

steveneads

Members
  • Posts

    107
  • Joined

  • Last visited

1 Follower

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

steveneads's Achievements

Collaborator

Collaborator (7/14)

  • First Post
  • Collaborator Rare
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. Hi Curt / Dro Thanks for looking into this. We have done some more investigation here and have found the root cause of my results. It looks like I was being fooled by some sort of compiler optimization which meant that for some of the function tests, the calculation wasn't really being repeated the number of times that I thought is was. However, we have noticed that using the rticplc seems to be significantly slower than using a C from script call from PLC 0 for the same function test. It's particularly bad for sqrt. Is this what you would expect? Thanks
  2. My application is gradually growing the PPMAC processor loading, and so I'm always trying to ensure that I write my code as efficiently as I can. I use a significant amount of trig function calculations and I want to have some guidance on what methods are most efficient. My code is running in C from script from PLC 0. I used this to do some timing tests evaluating some functions 1000 times. This yielded the following approximate times (microsecs) on a 465 PPMAC: atan2(x,y): 97 atan: 0.12 sqrt(1 + x*x): 57 1/x: 0.1 cos: 0.12 acos: 57 I was staggered to see the differences between atan2 and atan in particular and was also surprised by some of the other differences. I'm almost doubting my own results. Can DeltaTau shed any light on why atan2 and atan are so different in efficiency, and what functions are very costly / efficient? I remember some notes being provided on this years ago with the original PMACs!
  3. Thank you - I've made it work using "floor" with some logic to adjust the result for negative inputs (as I wanted to round towards zero). Is there an easy way to find a list of C functions that are and are not supported in the Kernel C code?
  4. I am trying to use it in C code that is included with usrcode.c
  5. What is the best way to do the equivalent of "trunc" in code that runs in the kernel?
  6. Hi, I have found a problem when downloading a motion program. PPMAC vers 2.3.2.5 and IDE 3.1.4.0. I have a "sub" program which is called from a "subprog". The structure of the sub program is like this: ------------------------------------------------------------------- sub: DoCalcs(void) local var //some code here if (error) { //some code return; } var = a + b; //some code using "var" return; ------------------------------------------------------------------------ This code does not download because the local variable "var" is not recognised as an L variable. If I move the local declaration after the return that's inside the if loop, it will download. It seems that the sub doesn't get its end point right. If I make a similar code structure in the higher level "subprog", it downloads perfectly ok - so it only seems to be a problem in the lower level "sub" program. Steve
  7. Searching this issue on the web, I found the comment "Most systems, including x86 GNU/Linux and Microsoft Windows, use signed char, but those based on PowerPC and ARM processors typically use unsigned char." This presumably explains the behaviour I saw since the 485 is a PowerPC chip. Am I right in thinking there is an Omron "Delta Tau" product on the way that uses an x86 processor? If so, it seems that we will need to watch code portability here.
  8. Hi I have come across a problem in C code that's called as C from script from a motion program, which has surprised me (probably not difficult)! My C function had a variable declared like this: char initialCubicTrue = 0; In the code the value of initialCubicTrue is set to a positive or negative value to control logic in the code. I found that the logic didn't work when the value was -3 (for instance) and I'm guessing that it didn't work for any negative number. The problem was resolved when I changed the variable declaration to: signed char initialCubicTrue = 0; My understanding of the C complier used is that it would default to treating char as signed - but in this case it seems not. (I am using a 465 card running 2.3.2.5 firmware). Can you let me know if there are any other similar things to beware of? Steve
  9. Yes to the first question - and no to the next.
  10. Running as administrator seems to fix the watch window issue, but it makes no difference to the screen size and position being lost or to the inability of the intillisense to recognise global variables. I am using Windows 7 - does this have any bearing on this all?
  11. Just to clarify this, the IDE version is 3.1.1.0, and I'm closing it down using the X in the top right of the screen. It isn't a crash. Another issue is that the intellisense only seems to work for pointers and locals - it doesn't spot global vars. It worked on the older IDE. Is something not configured correctly on my system?
  12. Hi I've just migrated to this new version of the IDE and noticed that it doesn't seem to store changes that I've made to the contents of the watch window after I've shut the IDE down. The changes are lost when I restart and the watch window is reverted to its original state. Is there something that I need to do to save these - or is it a bug? Another annoyance is that the IDE does not remember its position and size after closing down. I use it spread across 2 screens but it always starts up filling just one screen. The earlier IDE was fine on both of these counts. Thanks
  13. Hi Brad I'm still getting this fault - but it doesn't happen all the time. I have just had it again after being very careful to make sure that nothing I could think of was running. Firstly I set UserAlgo.CFunc=0, then using the task manager I made sure that all PLCs and C applications were stopped. I then did a build and download which generated the segmentation error (attached). Finally I checked that UserAlgo.CFunc was still zero and that nothing was running. This was the case. What can be generating the error? It seems to me that there's a problem in the download process. Is it because we have a large project? It seems that our problems have recently appeared with a sizeable amount of C application code being added. We need some help here! Steve download error 2.txt
  14. Hi Brad Currently my pp_startup.txt contains: UserAlgo.CFunc=1; enable plc 1; I will try removing UserAlgo.CFunc=1 from pp_startup.txt, adding a 2 second delay at the start of PLC 1 and then set UserAlgo.CFunc=1 in this plc, to delay these actions. Is this what you had in mind? I'll see whether this helps. Steve
  15. Hi I've recently started to experience code down-loading failing with the message "Download process failed with a segmentation fault" (465 board). I have now updated to IDE version 2.2.1.25 (PPMAC firmware is 2.1.1.3), but the problem persists. If I repeat the download it's often OK the second time. What's going wrong? Another colleague is also having the same problem. I've attached a copy of the messages given by the IDE during compiling and downloading. Thanks Steve download error.txt
×
×
  • Create New...