How to log the TCP speed every 0.01sec without using Multitask ()?
Are there any way to do it smartly?
I've already found 2 ways to log the TCP speed.
1. Use [Signal Analyzer Online] of RobotStudio by monitoring the System AO called [TCP Speed].
2. Use [Multitask] option of IRC5 and create 2 tasks; one is the program of robot movements, and other is the logging program showing below.
--
I've already found 2 ways to log the TCP speed.
1. Use [Signal Analyzer Online] of RobotStudio by monitoring the System AO called [TCP Speed].
2. Use [Multitask] option of IRC5 and create 2 tasks; one is the program of robot movements, and other is the logging program showing below.
--
MODULE MAINMODULE
VAR iodev logfile;
VAR clock clkv;
! Logging TCP Speed from System Analog Output every 5 [ms] using multitasking
PROC main()
ClkReset clkv;
ClkStart clkv;
! Create log file named "TCPSPEEDLOG_[DATE][TIME].csv"
Open "HOME:" \File:="TCPSPEEDLOG_"+StrPart(CDate(),1,4)+StrPart(CDate(),6,2)+StrPart(CDate(),9,2)+StrPart(CTime(),1,2)+StrPart(CTime(),4,2)+StrPart(CTime(),7,2)+".csv", logfile \Write;
Write logfile, "TCP Speed Log";
Write logfile, CDate()+","+CTime();
Write logfile, "";
Write logfile, "Time [s],TCP Speed [mm/s],TCP Speed Reference [mm/s]";
! Stop iteration when TASK "T_ROB1" is terminated by checking with DO112.
WHILE DO112=0 DO
Write logfile, ValToStr(ClkRead(clkv\HighRes))+","+ValToStr(AOutput(TCP_Speed)*1000)+","+ValToStr(AOutput(TCP_Speed_Reference)*1000);
WaitTime 0.01;
ENDWHILE
Close logfile;
TPWrite "FINISHED!";
ClkStop clkv;
ClkReset clkv;
ENDPROC
ENDMODULE
--
--
Post edited by Hikaru_KIMURA on
0
Answers
-
Look up trap/interrupt procedures.
0
Categories
- All Categories
- 5.5K RobotStudio
- 394 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 309 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings