How do you dynamically modify static message texts of the TD200 by way of embedded ASCII data?
The TD200 (up to firmware version V2.1) does not offer by default embedded data in ASCII format. However, since the TD200 loads stored static messages only during runtime, dynamic messages can be generated by changing these given texts.
This procedure can also be used for the TD200C or TD200 with firmware version 3.0. For TD200C and TD200 V3.0, however, alarms with embedded strings can be configured with the TD200 wizard of STEP 7 Micro/Win V4.0 - see Entry-ID: 19340264.
Description of a sample configuration for the TD200
At the end of this entry you can download the described sample program as a STEP 7 Micro/Win project.
Use the TD200 wizard in STEP 7 Micro/Win under "Tools > TD200 Wizard..." to configure a single alarm of 20 characters in length. Enter "Water pump:" as message text . Quit the wizard with "Finish" and the given configuration will be stored in the data block.
Open the data block to view the source code generated by the TD200 wizard.
The configured message "Message 1" starts at VB24, for example, and occupies the following 19 bytes. The message is activated when bit V14.7 is set.
Fig. 1: DB1 with TD200 data
Count the number of ASCII characters of the message up to the point at which you want to show the dynamic texts.
"Water pump:" = 11 characters
+ 1 space = 12 characters
=> Offset = 12 bytes
The dynamic text can start as of VB24 + 12 bytes, thus as of VB36.
The message must not exceed a total of 20 bytes or 20 characters.
Specify the possible dynamic texts in DB1 after configuration of TD200. These texts will be copied from the self selected memory marker into the message as of VB36. In this example the "ON" string is stored as of VB500 and the "OFF" string as of VB510.
Fig. 2: Specification of the dynamic data
In the main program you program activation of the message with the corresponding dynamic text.
Bit V400.0 is a memory marker chosen by the user. Depending on this bit, the pump is displayed as on or off in the message, in other words the respective string ("ON" / "OFF") is copied into the memory as of VB36. In both cases 3 bytes must be copied in order to overwrite the entire memory of the preceding message.
Fig. 3: Main program with message activation routine
Message "Water pump: ON"
The message is activated (V14.7=1) and V400.0 is set.
Fig. 4: Activation of the message "Water pump: ON"
Fig. 5: Display on the TD200
Message "Water pump: OFF"
The message is activated (V14.7=1) and V400.0 is not set.
Fig. 6: Activation of the message "Water pump: OFF"
Fig. 7: Display on the TD200
The STEP 7 Micro/WIN sample program as archive file
Copy the "TD200_Messages_Ascii.exe" file into a separate directory and then start the file with a double-click. The STEP 7 Micro/WIN project is unpacked. You can then open and process the project with STEP 7 Micro/WIN V126.96.36.199 or higher.
TD200_Messages_Ascii.exe ( 30 KB )