Forum Migration Notice
We're transitioning to a more modern community platform by the end of this year. Learn about the upcoming changes and what to expect.
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.6K RobotStudio
- 401 UpFeed
- 21 Tutorials
- 15 RobotApps
- 306 PowerPacs
- 407 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.9K Robot Controller
- 365 IRC5
- 84 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 854 RAPID Programming
- 37 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 110 Collaborative Robots
- 5 Job listings