You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old August 13th, 2019, 02:47 PM   #16
willxfmr
Lifetime Supporting Member
United States

willxfmr is offline
 
willxfmr's Avatar
 
Join Date: Nov 2013
Location: Wisconsin
Posts: 379
Quote:
Originally Posted by Aabeck View Post
Any way of the forum auto-locking a thread after x years? Or months?
The filter for auto locking zombie threads already exists. Just look at the original post date, and don't read anything older than you want as the filtered time. No programming required.

Bubba.
__________________
“Now will come the nay-sayers with all the reasons why you shouldn't do this. Some of them are teachers, and some of us are doers. Besides, you have got to let the smoke out of this equipment every now and then, or it starts to clog up the chimney.”
~Lancie1
  Reply With Quote
Old August 13th, 2019, 06:51 PM   #17
BachPhi
Member
United States

BachPhi is offline
 
Join Date: Dec 2007
Location: Los Alamos
Posts: 316
Why locking? For completeness, I'd like to see a translation of that into Rockwell Structured Text
  Reply With Quote
Old August 13th, 2019, 08:05 PM   #18
ASF
Lifetime Supporting Member
Australia

ASF is offline
 
Join Date: Jun 2012
Location: Australia
Posts: 2,928
Quote:
Originally Posted by BachPhi View Post
Why locking? For completeness, I'd like to see a translation of that into Rockwell Structured Text
Go on, then!
  Reply With Quote
Old August 13th, 2019, 10:27 PM   #19
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: Vancouver, WA, US
Posts: 6,922
Quote:
Originally Posted by BachPhi View Post
Why locking? For completeness, I'd like to see a translation of that into Rockwell Structured Text
Code:
(*
	RNG calculates random numbers from 0 to 1.
	RNG requires two in_out variables to maintain state.
*)

FUNCTION RNG : REAL
	VAR_IN_OUT
		m_z : DWORD;
		m_w : DWORD;
	END_VAR
	VAR
		u: DINT;
	 END_VAR
	m_z:=DINT_TO_DWORD(36969*DWORD_TO_DINT(m_z AND 16#FFFF)+DWORD_TO_DINT(SHR(m_z,16)));
	m_w:=DINT_TO_DWORD(18000*DWORD_TO_DINT(m_w AND 16#FFFF)+DWORD_TO_DINT(SHR(m_w,16)));
	u :=  DWORD_TO_DINT( SHL(m_z,16))+DWORD_TO_DINT(m_w);
	RNG :=DINT_TO_REAL(u+1)*2.328306435454494E-10+0.5;
END_FUNCTION

// 	http://www.codeproject.com/KB/recipes/SimpleRNG.aspx
I wrote this long ago. Since then the ST specification for converting between types has been loosen up a bit so all the DINT_TO_DWORD and DWORD_TO_DINT are not required.

It would be better if m_z and m_z were part of a function block.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old August 14th, 2019, 06:01 AM   #20
geniusintraining
Lifetime Supporting Member + Moderator
United States

geniusintraining is offline
 
geniusintraining's Avatar
 
Join Date: Jun 2005
Location: SC
Posts: 6,387
Quote:
Originally Posted by Aabeck View Post
Any way of the forum auto-locking a thread after x years? Or months?
I dont have a problem with 'old threads' if someone has something to add to them, xyntec felt they had something to add to the thread and bring up the topic again and now Peter also added to it, so it was good to reopen.

Yes there are some that should not be reopened but this was not one also in a day or two they will be out of sight and out of mind.

If its spam it gets deleted by the mods and as long as no one replies to the thread it goes back in the file and back to the date it was last replied too.
__________________
www.PLCCable.com PLC Communication Cables, PLC Trainers, Fluke Meters, MicroLogix, ControlLogix, Siemens, Allen Bradley and more... all your automation needs... ((NEW)) After Market 1784-U2DHP Allen Bradley USB to DH+ and Gateways
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
S7 Random Number Generator RRobbins LIVE PLC Questions And Answers 14 July 8th, 2016 07:36 AM
Usless but maybe fun excercise ndzied1 LIVE PLC Questions And Answers 6 May 15th, 2006 06:28 AM
PLC 5/04 random number generator seat14 LIVE PLC Questions And Answers 2 December 10th, 2005 11:29 PM
Random number Shahed LIVE PLC Questions And Answers 4 December 3rd, 2005 03:25 AM
Random number generator for PLC5 Contr_Conn LIVE PLC Questions And Answers 11 September 8th, 2004 01:57 AM


All times are GMT -5. The time now is 02:32 PM.


.