March 25, 2019, 02:19:59 PM
Robotforum | Industrial Robots Community

 check if a variable is not initialized

Author Topic:  check if a variable is not initialized  (Read 170 times)

0 Members and 2 Guests are viewing this topic.

March 13, 2019, 10:49:33 AM
Read 170 times
Offline

4u



I could not find information about how to check a variable is not initialized (invalid) in IF BLOCK in expert programming manual.

Is there a way to do it in IF BLOCK something like that

IF (X == NULL) THEN
; do something
ENDIF

Today at 02:19:59 PM
Reply #1

Advertisement

Guest

March 13, 2019, 12:22:16 PM
Reply #1
Offline

panic mode

Global Moderator
IF VARSTATE("X")<>#INITIALIZED THEN


ENDIF
1) http://www.robot-forum.com/robotforum/kuka-robot-forum/read-first/
2) if you want reply about robot, post it in forum
3) read 1 and 2

March 13, 2019, 04:11:46 PM
Reply #2
Offline

SkyeFire

Global Moderator
As Panic says, the VARSTATE system function will do this.  The trick is that the variable name must be put into quote marks.

There's another trick, for more recent KSS versions, that uses ON_ERROR_PROCEED.  If your robot has the library MsgLib, you can look inside that for many working examples.

March 15, 2019, 08:00:42 AM
Reply #3
Offline

4u


Thanks for the answers. Helped me a lot. I appreciate it. Thanks


Share via facebook Share via linkedin Share via pinterest Share via reddit Share via twitter