Really new at this so be kind.I took an exsisting working program and want to add to it.I copied the exsisting program and continued the logic. it looks like this
IE shotm1p1=10
shotm1p2=13
Now I want to add
shotm1p4= 5
Later in the program I have
if $in[5] and not $in[6] and not $[31] then
shotn=shotm1p1
$flag[21]=true
endif
if not $in[5] and $in[6] and not $in[31] then
shotn=shotmIp2
$flag[22]=true
endif
I want to add
if not $in{5} and not $in[6] and $in[31]then
shotn=shotm1p4
$flag[23]=true
When I do this I get a both sides of the value assignment are not compatable
How do I do this then? What does this mean?
Thanks all
Alarm Message "both sides of the value assignment are not compatable
- 9566317
- Thread is marked as Resolved.
-
-
This error usually occurs when you try to assign a value to a variable that that variable cannot accept. For example, you cannot set a BOOL variable to a numeric value, or vice versa.
What are all these variables? Where are they declared, what are they declared as?
-
Thank you for the reply. You actually made me wonder about this a lot more.
These variables are used in the program to do a "Pour Off" out of a cup.
We change the number after shotm1p1= ? to pour differant amounts
I am not sure where to look to see where they are tored in the variables.
I am back to looking at the book about Variables.
Any ideas as to what I am looking for or where?
Thank you again -
Thank you again,
I found where to put in the variables in the DAT file.
On the top line was the original numbers so I added to them and the alarms are gone.
Still leaves a newbie wondering why there and why they would not go in when typing in the program
in the src program side. -
KSS is not like a Microsoft programming environment. The programmer is 100% responsible for declaring variables and handling them correctly.
Temporary variables can be declared at the top of any program routine inside an .SRC file, and have their scope limited to that routine.
Tempoaray variables with module-wide scope can be declared in the .DAT file for that module. If the variable declaration includes an "=" assignment, that variable becomes persistent -- the most recent value of that variable will be remembered regardless of where the program pointer is, and even if the robot is rebooted.
Variables declared in $CONFIG.DAT follow the same rules as for a module .DAT file, except that any variable declared in $CONFIG.DAT is "global" for the entire system -- all modules can access it. In later versions of KSS (4.6+, I believe) variables in the .DAT files of individual modules can be made Global by using the DECL GLOBAL declaration in place of simply DECL.
KRL does not include anything equivalent to the "void" type declaration in C.
-
Quote
KRL does not include anything equivalent to the "void" type declaration in C.Awww... Your growing up
-
...Dude, I studied ANSI C back when you were still thrashing parking garages. It's .NET that gives me conniptions.
-
apparently spellcheck does as well
-
Create an account or sign in to comment
You need to be a member in order to leave a comment