Random Number Generator in PM573.

Hello,

I am trying to simulat one project and try to generate rendom value between range.

Please suggest me any function/Function block/formula.


Add New Comment


Nirav   

asked 8 days ago
Closed



Best Answer

1

Hi

AFAIK the random number is not a function available in Codesys...

Flavio Mussolin   

answered 8 days ago


 


By Nirav on 12/6/2017 | Like (0) | Report

Sir, I if know any equation or formula?


Add New Comment


Answers

1

Hi

AFAIK the random number is not a function available in Codesys...

Flavio Mussolin   

answered 8 days ago


 


By Nirav on 12/6/2017 | Like (0) | Report

Sir, I if know any equation or formula?


Add New Comment


1

I'm not sure if this helps, but library functions sometimes use a simple linear congruential generator for pseudo random numbers:

y" = (ay' + c) mod m

Check the Internet for details.

Thomas Kruse   

answered 8 days ago


 


Add New Comment


1

If you're trying to simulate a varying signal, then then an evenly spaced random number doesnt really work very well - you're better to use a gaussian RNG because this gives you a random number where the next number in the sequence is "sort of" similar to the previous one. This way you get a value that wanders randomly up and down.

However, RNG's arent really required to simulate anything usefull. You can get usefull results by just adding a +/- 0.5% of range sine wave to to the simulated signal value.

If you just want something simple and dont care that its predicatable ....

i = 7 * i `mod` 11

--- you can seed "i" with any value but the ms of current time works well.

https://cdsmith.wordpress.com/2011/10/10/build-your-own-s...

once you have a simple RNG you can make a gaussian RNG ( if you really want to go to the trouble)

http://www.design.caltech.edu/erik/Misc/Gaussian.html

Rob Lyon   

answered 8 days ago


 


Add New Comment


1

Hi, maybe you should try the OSCAT Basic library, there are some functions available to calculate pseudo-random numbers (RDM, RDM2, RDMDW).


 


Library: http://www.oscat.de/component/jdownloads/summary/2-oscat-basic/3-oscat-basic-333.html




Documentation: http://www.oscat.de/component/jdownloads/summary/2-oscat-basic/9-oscat-basic333-en.html


 


Good luck!

soppido   

answered 8 days ago


 


By Nirav on 12/8/2017 | Like (0) | Report

Excellent Sir


Add New Comment



Get weekly AKS updates


Partner Exclusive Webinars

 

> – Login to the partner portal to register



Points Redemption Program - Redeem your points for ABB training, Bluetooth speakers and mugs. Terms and conditions >


Earn points when you refer a friend
AKS Referral Program is "Live" - Learn more



AKS Experts


avatar
Ask Flavio Mussolin   

Rank: 4

ABB AVP, Senior Electronic and Automation Engineer with over 30 years of experience in the field of process automation automotive, pharmaceutical, hollow glass, steel and rolling.


avatar
Ask Govindaraj   

Rank: 10

Working in ABB India Operation Center. Have Project engineering and commissioning experience in ABB 800xA, Freelance, AC500.


avatar
Ask kstoilov   

Rank: 15

Control System Engineer: 800xA, Compact 800, AC500, AC31-50, Advant Master, Simatic, AC&DC Drives 11 years worked for ABB - Control Systems


avatar
Ask Harsha.D   

Rank: 6

Tech.Support,software and commisioning engineer with Proficient knowledge in 800xA and its products, RNRP,Networking in general.


avatar
Ask MMM   

Rank: 5

ABB PA CT Technical Support


avatar
Ask nikismith   

Rank: 270

I have been a part of the Recording & Control Factory team for 17 years in total, having spent a number of years as a repairs technician withi the manufacturing department, but being in my current role for 9 years now.


avatar
Ask Rob Lyon   

Rank: 3

info@lymac.co.nz I'm an independent DCS software and commissioning engineer with extensive experience in 800xA and other ABB products. I've worked in almost every corner of the world and still haven't seen it all.


avatar
Ask Dieter Henkel   

Rank: 23


avatar
Ask Sumit Gargav   

Rank: 2

I have worked with Freelance in majority, with 800xA FD and Melody system partly. Also had opportunity to work with Protocols - HART,Profibus,FF & Modbus.


avatar
Ask WvanWees   

Rank: 7

I'm a senior service engineer working for ABB in The Netherlands.


avatar
Ask Stefan Stromqvist   

Rank: 1

I joined ABB in the year of 1994 and has since 1999 been working as a Service & Support Engineer at BU Control Technologies in Västerås, Sweden. My areas of expertise are: 800xA Base, 800xA for Advant Master, Information Management, operating systems, RNRP and Ethernet comms/networking in general.