Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Siemens S7-400 PID Reset data format 2

Status
Not open for further replies.

Andy32821

Industrial
Joined
Aug 24, 2003
Messages
39
Location
US


I am to writing a floating point number for PID “reset time” from a SCADA HMI to a data block register in a S7-400 processor simatic PLC. Contrary to some published data I cannot get the PID block to read milliseconds. The PID block seems to insist that the reset and rate times be in siemens’ “time format” data type before the PID block will read them.

Can I force the PID block to accept milliseconds?

Is there a math block that will convert decimal into time format?
 
Dear Andy32821,

it's worth trying to ask ad.support@siemens.com Don't forget to specify CPU model and version, block number of PID block. The more specific you are, the better.

You can also try to look through their database (for conversion block):

 
Hi Andy,

Look in Standard Library/IEC Function Blocks for FC40 TIM_S5TI. It'll convert TIME datatype into S5TIME.
 
jacekd,
in this case, can word containing tag containing number of millisecons be used as input for TIM_S5TI? I guess no.

S5Time is simply BCD. Once upon a time I had to convert seconds to S5Time (S5-155 CPU948 though)


Code:
Name :INT->S5T        Convert integer seconds to s5t
 
     :DUF             integer to bcd
     :L   KH 0FFF     only 3 digits needed
     :AW              apply binary mask
     :L   KH 2000     "2" means seconds
     :OW              apply binary mask
     :BE
 
Thanks Guys, I ended up changing the HMI to interger and using ladder in the plc to convert it to time format. Andy
 
Dear ipupkin,
You're right. It's not possible to use word at a input which is dword.
However try this:
L ?W x
T ?D y
(where ? stands for: I,Q,M,DB or DI and x,y - is a address)
This will copy your word (consisting of miliseconds) into dword (wow! data type TIME has been created) which you can use as input of FC40.

Regards,

Jacek

Do it right or don't do it at all.
 
A TIME data type is stored as a signed integer number of milliseconds in 2's complement format. This is not S5Time format as some of the other comments have suggested.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top