variable addressing in Database Siemens

blima

Member
Join Date
Aug 2010
Location
Lisbon
Posts
96
Hello!

I have a database DB1, in S7-1500 PLC with several strings, each with constant size of 64 chars, where I have to send a specify text by e-mail, when some condition is fulfill. As example:
The database has:
Alarm_1 String of 64 chars text: “switch in manual position”
Alarm_2 String of 64 chars text: “Motor01 overload”
Alarm_3 String of 64 chars text: “switch in auto position”
Alarm_4 String of 64 chars text: “Motor01 running”

So how can I have a pointer to point to the alarm text and pass it to a variable, string of 64chars, that will be sent by e-mail?

Thanks,
Bruno
 
Before we get into the relevant part of your question, in a Siemens PLC, DB means Data Block, not database. Just FYI, not actually important.



If you set up the alarms as an array[1..4] of string[64], that will allow you to put code in the PLC that references string[alarmnumber], where alarmnumber is a tag containing which alarm you actually want to use. This is called indirect addressing.


For the other part, use the TMAIL_C instruction to send emails. See support site example below. https://support.industry.siemens.com/cs/us/en/view/46817803
 
Before we get into the relevant part of your question, in a Siemens PLC, DB means Data Block, not database. Just FYI, not actually important.



If you set up the alarms as an array[1..4] of string[64], that will allow you to put code in the PLC that references string[alarmnumber], where alarmnumber is a tag containing which alarm you actually want to use. This is called indirect addressing.


For the other part, use the TMAIL_C instruction to send emails. See support site example below. https://support.industry.siemens.com/cs/us/en/view/46817803


Thanks for the reply!
It had helped me to develop the program!

I have attached a demo project if someone comes across this type of question:

https://drive.google.com/file/d/1A1oZC0sUjSAFQwQECX6Y5-1NJ42s4sXu/view?usp=sharing

Regards,
Bruno
 

Similar Topics

Good Day All I am in the process of creating a Vijeo Designer (Magelis HMI) replica of a Wonderware project for control out in the field. On the...
Replies
0
Views
1,217
So I have need to display volume and run times on my screens for some equpiment. I recently got some help from support but things are still not...
Replies
8
Views
11,476
Hello, I want add a new analog output module (6ES5 470-7LC12) in S5-115U central rack with variable slot addressing. There are not free...
Replies
2
Views
3,874
Hello, Considering the M340 as a Modbus slave, and another device attempting to access internal memory of the M340 using the standard holding...
Replies
2
Views
6,486
Hello, I'm trying to set up a Wago 750-842 to an OPC server in order to read and write to a variable in the PLC, from the computer hosting the...
Replies
10
Views
7,402
Back
Top Bottom