Hi guys. can you tell me which operator to use to get the value of the argument shown in the picture?
Hi guys. can you tell me which operator to use to get the value of the argument shown in the picture?
GET_TPE_PRM is the command to parse passed in arguments from a TP call.
Example of its use from some code of mine in my conversion thread:
--Should be an int from 1-3.
GET_TPE_PRM(1, data_type, int_value, real_value, str_value, STATUS)
--Validate what was passed.
IF (data_type=1) AND (STATUS=0) THEN
--Argument is an int.
IF (int_value<1) OR (int_value>3) THEN
--Invalid argument 2, not in range.
--Clear and home user screen.
WRITE(CHR(128))
WRITE(CHR(137))
--Force the user screen.
FORCE_SPMENU(TP_PANEL , SPI_TPUSER , 1)
WRITE('Invalid Argument 1. Must be an integer.',CR)
WRITE('Valid Arguments are: 1 to 3',CR)
WRITE('Mode 1: Convert all to JPOS',CR)
WRITE('Mode 2: Convert all to LPOS',CR)
WRITE('Mode 3: Convert LPOS to JPOS',CR)
WRITE('and JPOS to LPOS',CR)
ABORT
ENDIF
--Argument 2 is ok.
conv_type=int_value
ELSE
--Invalid argument 2, not an integer, or the GET_TPE_PRM failed.
--Clear and home user screen.
WRITE(CHR(128))
WRITE(CHR(137))
--Force the user screen.
FORCE_SPMENU(TP_PANEL , SPI_TPUSER , 1)
WRITE('Invalid Argument 1. Must be an integer.',CR)
WRITE('Valid Arguments are: 1 to 3',CR)
WRITE('Mode 1: Convert all to JPOS',CR)
WRITE('Mode 2: Convert all to LPOS',CR)
WRITE('Mode 3: Convert LPOS to JPOS',CR)
WRITE('and JPOS to LPOS',CR)
ABORT
ENDIF
Display More
GET_TPE_PRM is the command to parse passed in arguments from a TP call.
Example of its use from some code of mine in my conversion thread:
Thank you very much. everything worked out. really not without dancing with a tambourine
if anyone needs a program on this topic, keep it and use it. program on KAREL. is designed to shift points by specified coordinates by the value of the argument, the argument is taken from the program call. (if you have questions about the program, write here, I will try to answer).
Thanks to everyone who helped figure it out.
PROGRAM TEST_KAR_12
%ENVIRONMENT REGOPE
%NOLOCKGROUP
%ALPHABETIZE
%COMMENT = 'ALL_POS_ARG'
%ENVIRONMENT TPE
%ENVIRONMENT BYNAM
%INCLUDE klevtpe
CONST
MAX_AXS = 9
VAR
to_prog: STRING[30]
open_id: INTEGER
status: INTEGER
indx_pos: INTEGER
num_axs : INTEGER
group_no: INTEGER
posn_type: INTEGER
org_xyz : XYZWPREXT
new_xyz : XYZWPREXT
num_pos : INTEGER
r_val: REAL
i_val: INTEGER
r_flg :BOOLEAN
pos_num: INTEGER
param_no : INTEGER
data_type : INTEGER
int_value : INTEGER
real_value : REAL
sens_name : STRING[40]
BEGIN
GET_TPE_PRM (1,2,int_value,real_value,sens_name,STATUS)
to_prog = 'TEST_TP_1'
OPEN_TPE (to_prog, TPE_RWACC, TPE_RDREJ, open_id, status)
group_no = 1
AVL_POS_NUM (open_id, pos_num, status)
num_pos = pos_num
FOR indx_pos = 1 TO num_pos-1 DO
GET_POS_TYP (open_id, indx_pos, group_no, posn_type, num_axs, status)
WRITE('get_pos_typ status', status,CR)
SELECT posn_type OF
CASE (pt_rxyzwpr):
org_xyz = GET_POS_TPE (open_id, indx_pos, status)
new_xyz = org_xyz
new_xyz.x = org_xyz.x + int_value
new_xyz.y = org_xyz.y + 0
new_xyz.z = org_xyz.z + 0
new_xyz.w = org_xyz.w + 0
new_xyz.p = org_xyz.p + 0
new_xyz.r = org_xyz.r + 0
new_xyz.ext1 = org_xyz.ext1 + 0
new_xyz.ext2 = org_xyz.ext2 + 0
new_xyz.ext3 = org_xyz.ext3 - int_value
SET_EPOS_TPE (open_id, indx_pos, new_xyz, status)
ENDSELECT
ENDFOR
CLOSE_TPE (open_id, status)
END TEST_KAR_12
Display More
hello were you able to solve the problem of moving the extended axes with karel or using a table with continuous rotation. ??