i just lost how i can use the programming language AS. can make a blink function to blink a few lights. how can i best do this? i have a robot RS20
kawasaki AS flashing function
-
jeffcoll -
November 20, 2020 at 10:37 PM -
Thread is Unresolved
-
-
Welcome to the forum...........
I would recommend to attend a Kawasaki Distributors AS Programming Course.
This forum is no substitute for official training.
Members are free to provide pre-written code to assist others, but beware code provided is not necessarily a global template that can be simply copied.
AS Programming has many commands available.....'best way' is very subjective as what is best for one person, is not necessarily best for others.
If the program works in the exact way you intend and require, then it is valid.....irrespective of what anyone tells you.
Therefore a program simply copied from an internet forum, may not necessarily work for you.
Exploring the AS Manual commands and trying various iterations is a necessity in learning and also to become a more efficient and effective programmer.
Have a look at the AS Programming Manual for the following (there are more, but I'm not writing them all down):
Controlling a signal is relatively easy and there are various commands available, a couple are below:
- SIGNAL
- PULSE
- DLYSIG
You then have the conditional argument/expression evaluation commands:
- IF/GOTO label
- IF/END
- IF/ELSE/END
You then have condition argument control commands such as:
- FOR/END
- WHILE/DO/END
- DO/UNTIL
- CASE/OF/VALUE/ANY/END
You then have the PC (Process Control) area where you can create asynchronous programs and using control commands to use them:
- PCEXECUTE
- PCABORT
- PCSCAN
Put these together in various iterations and you can easily construct simple/complex code and test them using PC Commands
A simple 1sec signal on/off could be written as below, but this may not be the best way for the intended application, but works as it's intended.
Code.PROGRAM heartbeat.pc() 1 PCSCAN 1 2 IF SIG(2256) THEN 3 SIGNAL -2256 4 ELSE 5 SIGNAL 2256 6 END .END
Hope this helps........