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.4K RobotStudio
- 384 UpFeed
- 15 Tutorials
- 12 RobotApps
- 290 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 241 ScreenMaker
- 2.7K Robot Controller
- 283 IRC5
- 44 OmniCore
- 6 RCS (Realistic Controller Simulation)
- 3 RobotStudio AR Viewer
- 746 RAPID Programming
- 15 Wizard Easy Programming
- 110 Collaborative Robots
- 3 Job listings