I dont get why i'm getting uninitialized data On register 3 i have a value of 5 for sure and in pr5 i have a comment "pick point"
I keep reading the manual and i dont get it and it's so simple
I dont get why i'm getting uninitialized data On register 3 i have a value of 5 for sure and in pr5 i have a comment "pick point"
I keep reading the manual and i dont get it and it's so simple
Would you be able to post the code, in text format?
Hi
I initialized the variables, still does not work
I had sothing similar running for testing, then I "clean" the code and it's not working, and it;s so simple
PROGRAM PRcomment
VAR
status: INTEGER
pos_cmt: STRING[30]
pr_nr:INTEGER
register_no :INTEGER
real_flag :BOOLEAN
int_value :INTEGER
real_value :REAL
-- SR[1] will manage the comments names for the registers
BEGIN
status=1
pr_nr=1
register_no=1
real_flag=TRUE
int_value =1
real_value =1
pos_cmt = 'aaa'
-- Read value from register 3, flag it if it is integer or real
GET_REG(3,real_flag,int_value,real_value,status)
-- Read comment of an specific position register
GET_PREG_CMT(int_value, pos_cmt, status)
-- Write comment from PR to an specific string register
SET_STR_REG(1,pos_cmt,status)
END PRcomment
Odd. I compiled your code, and it works fine on my machine. I tested it with your values and a few others.
Maybe try deleting your code and the vr file it leaves, then recompile and see if it works.
I deleted, then compiled again and it works
Weird, because I thought that i did in the last hour of my life that i never getting back
Thanks
Look like your register is empty or 0.
Put a value in it see what happen.