show the entry list
ProTool -- Creating HMI configurations -- Creating pictures
Configuring headers of OP3 pictures in ProTool V5.2 /SP2
Programming the "Set_Bit" function by pressing a button on Windows-based devices
Picture change on the TP170A as tag function
CPU functions for S7-300 with OP7/OP17
Entering an S5TIME" variable in ProTool/Pro to provide values for a timer in the SIMATIC controller
Showing an "S5TIME" variable from a SIMATIC logic control with ProTool/Pro
Configuring the TAB order ProTool
Subsequent insertion of pictures in the configuration
Graying in the OP display of bitmap graphics
Description of the default name "PIC_xx" for a ProTool/Pro screen
Can I also program function keys in the message image?
Special characters and language-specific characters
How can you register unknown ActiveX objects on a PC and then incorporate them in ProTool/Pro?
Settings required for implementation of the ProTool function "Start Program"
Display of help texts for a certain image object on a Touch Panel
How can you start specific items in the Control Panel directly from the Runtime on an operator panel?
How do you implement the "Clean Screen" function for cleaning the touch screen on Mobile Panel 170?
How do you configure screen selection on a line or graphics operator panel via controller job 51?
How do you configure screen selection on a Windows-based operator panel via controller job 51?
How can you make a screen selection on an OP3 via the controller?
How can you make a screen selection on a Windows-based operator panel via the controller without using a controller job?
How can you make a screen selection on a Windows-based operator panel by entering a screen number?
How can the display for the danger and warning area of an analog display be made in color?
How can you optimize the response time when changing screens via the controller?
How do you monitor and control tags on panels on which the status/control object is not available?
Showing an "S5TIME" variable from a SIMATIC logic control with ProTool/Pro
Part number:

QUESTION:
How can I show an "S5TIME" type variable from a SIMATIC controller, separated into hours, minutes, seconds and milliseconds, with ProTool/Pro?

ANSWER:
More information on the subjects of S5 timer and using scripts can be found in the following articles:

  • "Entering a S5TIME variable with Protool/Pro", Entry-ID 9125571  
  • "Entering ProTool/Pro  S5 timer values directly", Entry-ID 947095.

The controller timestamp is present as a variable of the "S5TIME" type (e.g. S5T#1H_34M_30S_0MS) in the logic control.
The value of the variable is read from the controller and processed in Protool/Pro. The time value then displays in hours, minutes, seconds and milliseconds.

The attached project includes four scripts that read in as input parameters a variable of the "WORD" type declaring an "S5TIME". The feedback value of the functions is a variable showing the time either in hours, minutes, seconds or milliseconds.

These scripts should be used as follows:

  1. You define 4 variables (e.g. "HH", "MM", "SS" and "MS").
  2. You link these variables with 4 output fields for displaying the time in hours, minutes, seconds or milliseconds.
  3. You define a variable of the "WORD" type (e.g. "S5T"), which takes the "S5TIME" value from the controller
  4. Now you define a function in the Properties of the "S5T" variable, which executes when the value changes. This means you start the four functions for calculating the time values in hours, minutes, seconds and milliseconds respectively

How the scripts work:

The system first checks which base time is entered for the "S5Time" variable (see Entry ID 56243) and sets a multiplier accordingly. The script then defines the time value in binary coded decimal format (BCD). This value is multiplied by the previously defined multiplier. The result is the time value in milliseconds. This value is the uniform basis taken for the remaining calculations.

The hours, minutes, seconds and milliseconds are then determined according to this millisecond value.

Source text of the script for milliseconds:

Dim base time, total time, buffer, hour, minute, second

If S5TimeIn < 4096 Then
Base time=10
ElseIf S5TimeIn < 8192 Then
Base time =100
ElseIf S5TimeIn < 12288 Then
Base time =1000
Else
Base time=10000
End If

Buffer = S5TimeIn And 4095
Total time = Fix(buffer/256)*100
Buffer = Buffer And 255
Total time = Total time+Fix(buffer/16)*10
Buffer = Buffer And 15
Total time = Total time+buffer

Total time = Total time*Base time

Hour = Fix(total time/3600000)
Total time = Total time - Hour*3600000
Minute = Fix(Total time/60000)
Total time = Total time - Minute*60000
Second = Fix(Total time/1000)
Total time = Total time - Second*1000
S5Time_ms = Total time

Downloading the four scripts:
The download contains the four scripts described above. Copy the " pro___0l.exe" file to a separate directory and then start the file with a double click.

  pro___0l.exe ( 39 KB )  

Important:
The sample programs are selected solutions to queries about complex tasks developed by Customer Support. We must also point out that it is not possible in the current state of the technology to exclude all errors in software programs under all conditions of use. The sample programs were prepared according to the best of our knowledge. However, we cannot accept any liability beyond the standard guarantee for Class C software in accordance with our General Terms of Sale for Software Products for Automation and Drive Technology".

Keywords:
Object-oriented programming, Time conversion, Time value display


 Entry ID:9123496   Date:2002-09-04 
I regard this article....as helpfulas not helpful                                 
mySupport
My Documentation Manager 
Newsletter 
CAx-Download-Manager 
Support Request
To this entry
Print
Create PDF 
Send to a friend
QuickLinks
Compatibility tool 
Help
Online Help
Guided Tour