Jump to content
OMRON Forums

CfromScript call


Recommended Posts



I have a CfromScript call from a motion program as below:


null = CfromScript(PFsetSafety,0,tst_indx(look_ahead),0,0,0,0);


This seems to work as I expect, but I've noticed that the manual states:


"The calling program must pass to CfromScript() all seven arguments of type double, even if CfromScript() does not use all of the arguments internally. If CfromScript() does not use one of the arguments, it is recommended just to pass a zero to CfromScript() for that argument. All general-purpose user variables in Power PMAC (P, Q, L, R, C, D) are of type double. Some data structure elements are of type double, but the value in an element of a different type can be converted to double simply by copying the value into a general-purpose



My variable "tst_indx(look_ahead)" is part of a 16 bit integer M variable array stored in user shared memory. Is this OK even though it's not a double, or could I get unexpected problems? - as I said, it seems to work.




Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Unless I am mistaken, PMAC will automatically convert your M-Variable to a double equivalent when passing it to CfromScript, so you should have nothing about which to worry. As for using "null" as a return value, that looks wrong, but maybe it is something new with which I am not familiar. If I were you, I would just create a local variable named "dummy" or something to catch the CfromScript output as I have the feeling null might be reserved.
Link to comment
Share on other sites

  • 4 weeks later...
This topic is now closed to further replies.

  • Create New...