Do we have static variables in Inform III?
If not, how can I retain values of some variables between jobs without using any global variables.
Thanks in advance!
Do we have static variables in Inform III?
If not, how can I retain values of some variables between jobs without using any global variables.
Thanks in advance!
Is there a particular reason why you just wouldn't use global variables???
The only other method i can think of is to use local variables within each job and then use the job argument feature. Job A would pass the value of a local variable into job B. When job B is done it can return a value back to job A.
RoboGuru
Because I have to write a program which will be using a sensor system. The robot will be getting some values from the sensor, doing some calculation and task and then again repeating the cycle. I won't like to use the global variables because my routine is going to overwrite any stored values and the customer might be uncomfortable with that.
Can you tell me more about the job argument? In which manual I will find the details about it?
Thanks!
What controller are you using ? Job arguments are only available on DX-100 controller.
You could maybe also use a macro job as well for this. Macro jobs are available on all controllers and also support arguments.
RoboGuru
"The only other method i can think of is to use local variables within each job and then use the job argument feature. Job A would pass the value of a local variable into job B. When job B is done it can return a value back to job A."
Can you explain, how the value in Job B be will be returned to Job A if we would be exchanging local variables i.e. LI000?
I have tried incrementing a local variable, LI000 in Job B. After I am back to Job A, the value of local variable remain the same.
I have DX100 controller and it supports a max. of 8 arguments.
In job b, you,will use the GETARG instruction to read the incoming value from job A.
In job b you will have to define a local var before GETARG is ble to be used.
When job b is done , use the RET command to return your variable back to job A.
I'm pretty sure that's how it's done.
It doesn't work for me. That's how I am writing two jobs. Any idea?
Job A
NOP
SET LI000 1
SET LI001 2
SET LI002 3
CALL:JOB B
END
Job B
NOP
GETARG LI000 IARG#(1)
GETARG LI001 IARG#(2)
GETARG LI002 IARG#(3)
INC LI000
RET (tried also RET LI000)
END
Now, the value in LI000 must be 2 but it is still 1!
Destination job side:
1. Create new job.
2. Select [DISPLAY] -> [JOB HEADER] in pull down menu.
3. Set local variable on JOB HEADER screen.
4. Select [DISPLAY] -> [ARGUMENT INFO] in pull down menu.
5. Set argument information you want in ARGUMENT INFO screen.
6. After that, select [EXECUTE] and finish setting argument.
7. Set GETARG instruction to receive argument.
Call job side:
1. Insert CALL instruction and edit argument information. You can set comment and variable type to argument information.
Return value:
Destination job side:
1. Insert RET instruction and set variable type of return value.
Call job side:
1. Insert GETS instruction and set variable type and $RV tab.
e.g.)
Following jobs are receiving 2 arguments and adding these argument in destination job and return result value to call job.
Arguments are 1 and 2, and return value will be 3 in B000.
//NAME TEST000
NOP
CALL JOB:TEST001 (1, 2)
GETS B000 $RV
END
//NAME TEST001
NOP
GETARG LB000 IARG#(1)
GETARG LB001 IARG#(2)
ADD LB000 LB001
RET LB000
END
what is the $RV? i cann undestand how it works but have not seen in in a manual (i think...)
$RV : Return Variable
Used for moving data between jobs with argument function
robot Guru: It is working. Though I can only change the value of one variable so it works like a function.
potis: I had the same thought. Motoman has made it like a fortress, you find things if you are lucky. I remember that day when I had almost believed that Motoman does not provide the function for tool calibration. Not only specific functions but even those which are visible in teach pendent are not defined anywhere in manual like various instructions in control and arithmetic sections.
Has anyone knows if I can set an individual bit of a byte without using usual approach with OR?