Using return values from oWord subroutines

More
1 year 22 hours ago #337500 by scsmith1451
I've been trying to develop a routine to repeatedly measure the four corners of my X/Y table and its center for leveling purposes.  The attached file is currently working great though it only does one set of measurements each run.  The M100 code at the end of the routine is a small python routine to read the proberesults.txt file, converting the values to floats and storing them into an excel spreadsheet.

Having had success with the routine I modified it to wrap the 5 measurement calls and the M100 call in a WHILE LOOP.  However, only the last set of measurements was posted to the spreadsheet. To get around this issue I would like to do the following:

1. Instead of writing each measurement to proberesults.txt, I would like the o200 subroutine to return the value of #<_z> for each measurement such that I can capture them and write a single line with all 5 measurements; i.e. (LOG,#<LF>,#<RF>,#<LR>,#<RR>,#<C>)

I capture #<_z> in a local variable, #<result> = #<_z>, then return it with:
o200 endsub [#<result>].

I've tried to assign the return value with:

#<LF> = o200 call p1,p2,p3,p4

and

o200 call p1,p2,p3,p4
#<LF> = #<_value>

and

#<LF> = [#<_value>]

All of these generate errors when I load the program file into LCNC.

What is the correct syntax for assigning return values from an oWord routine?


Kind regards,

Please Log in to join the conversation.

More
1 year 22 hours ago #337506 by Aciera

Please Log in to join the conversation.

More
1 year 20 hours ago #337532 by scsmith1451
Hellow Aciera,

That was the document that I was following when attempting to use the return values. I have attempted to use:

o200 call .....
#<LF> = #<_value>

but, that generates an error when the code is loaded into LCNC.

Still stuck on the assignment of the return value to a local named variable.

Kind Regards

Please Log in to join the conversation.

More
1 year 19 hours ago #337539 by MaHa
how to call:
o<subroutineX1> call [4.1] [3] [12]

returnvalue:
o<subroutineX1> endsub [#<FW>]
M2


returned value #<FW> as  #<_value>
(debug,#<_value>)

if   #<_value>  is needed for further processing, its required to save to a parameter, next subroutine return will overwrite  #<_value> with new returnvalue

 

Please Log in to join the conversation.

More
11 months 4 weeks ago #337598 by scsmith1451
MaHa;

I tried that syntax several times and every time I would load the code a validation error would be raised.

Out of frustration, I deleted all of the code and re-typed it. This time the code loaded without error and ran perfectly.

Thanks for the encouragement.

Regards,

Please Log in to join the conversation.

Time to create page: 0.082 seconds
Powered by Kunena Forum