Group Digital Input value as a declarated variable
8mooseq
✭
Hello,
i'm working on my own project and i get some troubles.
The main idea in my project is to get some randomness so i used Random option using SmartComponent tool to generate random number in defined range.I used Converter, made necessary connections, crossed SC and system signals, and in result value of Group Digital Output is my random number.
Unfortunately i need this value to bo declareted as a variable in RAPID - when i doing this i have info that my signal is not constant expression and cannot be declareted.
Is there any posibility to declare this as a variable?
If isn't, how can i use Random function in other way?
Thanks in advance for your help,
Mikołaj
i'm working on my own project and i get some troubles.
The main idea in my project is to get some randomness so i used Random option using SmartComponent tool to generate random number in defined range.I used Converter, made necessary connections, crossed SC and system signals, and in result value of Group Digital Output is my random number.
Unfortunately i need this value to bo declareted as a variable in RAPID - when i doing this i have info that my signal is not constant expression and cannot be declareted.
Is there any posibility to declare this as a variable?
If isn't, how can i use Random function in other way?
Thanks in advance for your help,
Mikołaj
0
Comments
-
Hello,
You can define a persistent numeric data and write that numeric data continuously in background task.
Background task
PERS num nRandom:=0;
WHILE TRUE DO
nRandom := GOutputDnum(goRandom);
WaitTime 0.1;
ENDWHILE
You can use nRandom variable anywhere you want at motion task.
BR.
Erdem
0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 800 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings