SCL language programming to generate random numbers

Publisher:和谐共融Latest update time:2022-11-12 Source: elecfansKeywords:SCL Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Today I will talk to you about the Siemens SCL language programming series Lecture 32 - Generating Random Numbers.

We use the read system time RD_SYS, nanoseconds as the seed, and use the standardized instructions to calculate the percentage.


Then use the scaling command to generate a random number between the maximum and minimum values.

The interface parameters are as follows:

67bef59a-6108-11ed-8abf-dac502259ad0.png

The SCL code is as follows:

680f1390-6108-11ed-8abf-dac502259ad0.png

Calling procedure:

683e6104-6108-11ed-8abf-dac502259ad0.png


Keywords:SCL Reference address:SCL language programming to generate random numbers

Previous article:Power and control electronics technology for electric drive systems
Next article:Analysis of basic knowledge of frequency converter

Recommended ReadingLatest update time:2024-11-16 17:52

SIEMENS TIA Portal SCL: FOR: Execute in a counting loop
illustrate Use the "Execute in count loop" instruction to repeat the program loop until the running variable is no longer within the specified value range. Program loops can also be nested. Within a program loop, you can write other program loops that contain other run variables. The instruction
[Embedded]
Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号