$MNUFRAME[1,x] where x is the uframe number
sorry for my misleading question statement. I mean the current position using userframe coordination instead of the position of userframe.
$MNUFRAME[1,x] where x is the uframe number
sorry for my misleading question statement. I mean the current position using userframe coordination instead of the position of userframe.
hi Guys,
I am looking for a system variable that given the userframe position(x,y,z). does any expert happen to know the answer?
(I mean the current position using userframe coordination instead of the position of userframe.)
best regards,
Chen
I don't know anything about powermill but I would suggest making moves continuous (CNT 100) as much as possible.
thanks for your suggestion. however, the CNT100 has been applied for all points. thus, it is not related to the issue.
Sounds like a a powermill issue.
Post the code it produced.You should see if there is a way to make the motion smoother, maybe an option in the powermill software.
hi HawkME,
thank you for your reply.
could you explain more about how to make the motion smoother?
currently, i haven't found any function in powermill can simulate the weaving movement.
regards,
Chen
Is it possible your robot is approaching a singularity? Are J4 and J6 lining up with each other?
i have checked the singularity through powermill, and it is not approaching a singularity. a straightforward indication is that the more points in the program the more breaks happened. but cannot find the solid reason fro that.
hi guys,
I met a problem when trying to use sine weaving schedule during welding. it found that at some joint position the robot cannot weave properly. it feels like the robot has some local breaks. does anyone happen to know the reason for this? and how to avoid or predict this improper weave beforehand?
for more detailed information:
1. my .ls file is created by powermill which is using linear movement to weld a circle together with a fanuc positioner(the positioner keep rotating and robot not move but only weave on spot). there are 540 points in a loop.
2. besides, if using circular movement in TP program, there is no problem at all, even thought the joint position is more or less same.
best regards,
Chen
thank you, just notice that there is a ASCII character codes table in appendix of the manual
See post #14 in this thread. That code uses the spaces in your .dt file as delimiters to split the string into separate reals and store them to a real array.
there exists both space and tab between values in my .dt file, your code is applicable for searching index of space, but it is not workable with tab.
do you have a clue about searching the index of tab?
I think it may be because JPOS is actually an array of 9 reals not 6, and you are not giving it enough data. Try to set [7] [8] [9] to 0 see if it works (haven tried).
indeed, it works, thanks
hello, Guys,
i met an error when i was trying to convert real array into jointpos, it shows "invalid ar val for build in". do you have any idea about what might be the reason?
my code is give as below:
PROGRAM data
VAR
i:INTEGER
jnt:JOINTPOS
status1:INTEGER
jpos:ARRAY[6] OF REAL
BEGIN
jpos[1]=3.836
jpos[2]=7.189
jpos[3]=-24.204
jpos[4]=26.705
jpos[5]=-69.769
jpos[6]=75.901
CNV_REL_JPOS(jpos,jnt,status1)
END data
it seems that the AP only workable for MC: drive instead of UD1:
Well unify it, instead of sending it like this, send it like:
10179.8970 00007.1890 10024.2040 00026.7050 10069.7700 00075.9010
That way you will always have the same length, the first digit will show you weather its + or -, if its 0 its + if its 1 its -
For example the 10024.2040, starts with 1 so its -, and then u convert the rest to a number CNV_STR_REAL('0024.2040', result) and then just multiply by -1 and woalla. 0000.0000 u have 4 digits on either side, add more if u need more.
my input .dt file is generated by Data Monitor option, which i cannot unify it beforehand. is it possible to unify it within Karel code? and it still need to read out the value, which is become a probelm again.
Just read it as strings and do string manipulation to extract the data that you need from each row and then assign it to elements in your array
for instance, my data string is given as below:
1 100 .200 8 -179.897 7.189 -24.204 26.705 -69.770 75.901
as far as i know, sub_str command can extract sub_string, however, the start and sub_string length has to be specified. in my case, both are random value. do you know if there is any better way to extract sub_string?
Display MoreI am trying to write a Karel program that will read all existing lines in a .dt file.
Currently my .dt file has 3 lines, simply:
And I want to read all 3 lines with KAREL, this is my KAREL code:
Code Display MorePROGRAM ReadingFromFile CONST RW = 'RW' RO = 'RO' FILENAME = 'TEST.dt' VAR testFile: FILE status: INTEGER tempString: STRING[126] fileName: STRING[126] BEGIN OPEN FILE testFile(RO, FILENAME) REPEAT READ testFile(tempString, CR) WRITE(tempString, CR) status = IO_STATUS(testFile) UNTIL status <> 0 END ReadingFromFile
It is almost working, but it is reading only the first line, when it attempts to read the second line I get the error:
Line 19 is the line with the WRITE statement, so on the second iteration of the loop, no data was read and tempString is empty, (im assuming), why is that?
What is the correct way to read all lines from a file?
I Might have a part of solution for reading data of the last line. An extra empty line can be added in the end of .dt file, then if you use for loop with same iterations, the last line become readable without showing error.
However, do you guys know how to append an extra line in the .dt file?
Seems like, Append myfile(cr)does not work
thanks for the reply, it works properly now.
btw, it is good to know that we have similar target, i am trying to read a .dt file into an array of real.
do you have experince about how to read .dt file into an array?
hello guys,
have you tried to change the definition of Var from curline: string[40] to curline: string[80]?
it shows error ???-598 when i built the KAREL file.
do you happen to know what is the reason for that?
regards,
Chen
hi TitusLepic,
your program is correct for loading the .dt file.
it turns out that my file's path was not accessible. after changing the file path, the program works perfectly.
thank you for your help,
regards,
Chen
Sounds like you're probably getting an error when you're trying to read the file. Did you change the filepath to point to your dt file?
add this line between lines 17 & 18, it will show what the error is:
WRITE TPERROR('error: ', STATUS,CR)
Hi PnsStarter,
Thank you for your reply.
POST_ERR works well after adding an extra line to define the status(status=IO_STATUS(myfile)),
it found that this definition was missing, which is the reason for causing "uninitialized" error.
regards,
Chen
Display MoreHi,
with copy andy paste the code above can't work.
STATUS would be uninitialized.
...
EOF = FALSE
REPEAT
READ myfile(curLine)
STATUS = IO_STATUS(myfile)
IF STATUS = 0 THEN
WRITE TPDISPLAY(curLine,cr)
ELSE
WRITE TPERROR('error: ', STATUS,CR)
EOF = TRUE
ENDIF
UNTIL EOF
CLOSE FILE myfile
....
!!
WRITE TPERROR('error: ', STATUS,CR)
!!
but this is not useful.
try:
POST_ERR(STATUS,'',0,2)
Syntax: POST_ERR(error_code, parameter, cause_code, severity)
...
the file was loaded successfully, running the program give no error remark. however, the user screen shows nothing.
after added the extra line between 17&18, an error 'uninitialized value' appeared.
if it is possible, could you show the screenshot of what the result in your user screen looks like after run the karel program? and provide a .dt file which works properly.
thank you for your help, really appreciate it.
Chen
Sounds like you're probably getting an error when you're trying to read the file. Did you change the filepath to point to your dt file?
add this line between lines 17 & 18, it will show what the error is:
WRITE TPERROR('error: ', STATUS,CR)
Good morning TitusLepic,
thank you for the reply.
i used your program to read my .dt file, unfortunately, it does not show any number or string in the TPdisplay, the USER screen.
my .dt file is generated by data monitor, the template is given as below:
DATA MONITOR REPORT
Number Tick Time J1
1 250 .500 -150.524
2 500 1.000 -176.253
3 750 1.500 -162.752
... ... ... ...
do you happen to know what might be the reason why the program does not work?
regards,
Chen
Here's a short karel program I wrote when I was trying to figure out how to read from .DT files. It reads the file line by line and prints the line to the user screen.
Code Display MorePROGRAM RWTEST CONST filepath = 'MC:TEST.DT' VAR myfile : FILE curLine : STRING[40] EOF : BOOLEAN BEGIN WRITE TPDISPLAY(CHR(128),CHR(137)) OPEN FILE myfile('RO',filepath) curLine = '' EOF = FALSE REPEAT READ myfile(curLine) IF IO_STATUS(myfile) = 0 THEN WRITE TPDISPLAY(curLine,cr) ELSE EOF = TRUE ENDIF UNTIL EOF CLOSE FILE myfile END RWTEST