Jump to content
OMRON Forums

edlay

Members
  • Posts

    10
  • Joined

  • Last visited

Recent Profile Visitors

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

edlay's Achievements

Newbie

Newbie (1/14)

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

Recent Badges

0

Reputation

  1. Recoding will guarantee that the C APP is run at the priority and scheduling policy you intended which usually is as a non-RT Linux APP. If it is started at power-on, it will without the new code run as a RT Linux APP at the same priority as the Power PMAC background tasks which we prefer it not to be. So yes I would recommend it.
  2. You may have to send us a reduced version of your project that you are willing for us to test since we can't repeat it here. Send it to Stephen Milici and he will get it to the right people. More info on the blank project: The F/W that matched the 2.0.xx IDE wasn't ready to ship with it so the build issue with NANO_5MSEC. Why the change in the CAPP template? A CAPP inherits the priority and scheduling policy of the task that started it. If you had the CAPP set to run after load: 1. At download from the IDE it was run as a NON RT APP 2. After a SAVE and $$$ it was run as a RT APP with the same priority as the Power PMAC's background task that started it. Thus if it took a long time to yield to the Linux scheduler the Power PMAC's Background Watchdog triggered for this case but not on an IDE download. To insure your CAPP is run at a consistent priority and scheduling policy for these two cases it is required that you use the sample code shown in the new blank project. All the sample Example projects have been changed to this format along with the new blank project CAPP which gives you a template of how to do that.
  3. On the empty project: 1. load latest F/W or 2. uncomment // #define NANO_5MSEC 5000000 as explained in the example
  4. Another path since you aren't passing an array of Local variables and are using global variables : #define MY_ARRAY_SIZE 100 global MY_ARRAY(MY_ARRAY_SIZE ); // these go in you global definition.pmh file local array_sum; call mysub(50, &array_sum); // The '&' designates a return variable in a CALL or SUBPROG call_list. open subprog mysub(start_index, &rtn) // The '&' designates a return variable rtn = 0.0; while(start_index < MY_ARRAY_SIZE ) { rtn += MY_ARRAY(start_index); start_index ++; } close
  5. Click on the Folder Name of each "C" APP. It will show "Run at Startup" No or Yes. Click on the "No" and select "Yes" for both and they will both run at startup. You are okay to run them as different APPs with different usleep(1000) times to select your rate of communication.
  6. Power Pmac will have Modbus Client support for Script and "C" in the scheduled June release
  7. Make sure that the string has the same case as the replacement is case sensitive
  8. [quote='Sina' pid='827' dateline='1289436129'] Kejr, I think this is a bug. If you please report the bugs you find in our bug report system: [url=http://forums.deltatau.com/bugzilla/]http://forums.deltatau.com/bugzilla/[/url] This way our development team can assign/track/resolve the bugs in a more efficient way. Also, you'll be notified about all the progress on the bug you've reported. [/quote]
  9. Another way: In your "global definitions.pmh" you have your M-ptr definition ptr MyPtrVar1->*; In your "C" program you would have something like #include #include // Global Rt/Gp Shared memory pointers //------------------------------------------------------------- // The following is a projpp created file from the User defines //------------------------------------------------------------- #include "../../Include/pp_proj.h" int main(void) { double MyMvar; InitLibrary(); //Put your code here MyMvar = GetPtrVar(MyPtrVar1); CloseLibrary(); return 0; } [quote='CharlesP' pid='826' dateline='1289435593'] [quote='Amir' pid='824' dateline='1289428140'] How do you access an M variable from a C PLC (user_plcc())? [/quote] One way is to use the function GetPmacVar, whose prototype is as such: int GetPmacVar (char * pinstr, double * pdata) For example, to read M400, one could use this code snippet inside the CPLC: [code] int ErrorCode; double M_Var_Result; ErrorCode = GetPmacVar("M400",&M_Var_Result); if(ErrorCode != 0) { printf("\nThere was an error in reading the M-Variable.\n"); } [/code] After running that, the value in M400 should be stored in your C variable "M_Var_Result". Note that in this example, I used a string literal to input "M400" into the GetPmacVar function. One could also use the sprintf function to dynamically create the string to pass into GetPmacVar if needed. [/quote]
×
×
  • Create New...