Hello everyone,
I am new to writing some program on KAREL. When robot in auto mode i changed to unsim mode but i get some fault
Does anyone know about someting UNSIM with KAREL?
Hello everyone,
I am new to writing some program on KAREL. When robot in auto mode i changed to unsim mode but i get some fault
Does anyone know about someting UNSIM with KAREL?
Hello
The UNSIMULATE command is a KCL command and can not be used directly in the Karel program.
You must then go through the KCL interpreter.
I put you the program below that is directly complilable.
The request is stored in the Request variable of type STRING and is called directly in the KCL function.
PROGRAM unsim_all
%NOLOCKGROUP
%NOPAUSE = ERROR+COMMAND+TPENABLE
%NOABORT = ERROR+COMMAND
%NOBUSYLAMP
%NOPAUSESHFT
%INCLUDE kliotyps
VAR
STATUS: INTEGER
Request: STRING[40]
BEGIN
Request = 'UNSIMULATE ALL'
IF ((OPIN[8] = ON) AND (OPIN[9] = ON)) THEN
KCL(Request, STATUS)
ENDIF
END unsim_all
Display More
I did not have time to test the code so do not hesitate to test it yourself.
Good luck
QuotePROGRAM unsim
VAR
STATUS : INTEGER
BEGIN
KCL('unsim all', STATUS)
END unsim
So make a new file in Karel, copy paste this, save the program. Build the program, it will come in the programlist as unsim.pc
Than with macro, call it with the desired DI you want.
Need to mention, it only works when no other program is active.
I've done this with over 20 robots and it works fine..
Thank you for your reply.
I will try both of them and i will share the result
Both of them program is running.
But How can i unsimulate only DI? I tried with "for" loop it wasn't worked
In order to unsimulate certain input/output you can use CLR_PORT_SIM. This is a KAREL command, not KCL.