Verify string s7 1200

rQx

Lifetime Supporting Member
Join Date
Oct 2010
Location
Trelleborg
Posts
1,051
Hi!

I have a string with 10 letters. I can edit the string in my HMI.
Now I want my plc to get a signal if there is something written in my string, and not a signal when the string is empty. Somekind of compare, I was thinking that I could compare the length byte of the string, but it couldn't be done. How do I do it?
 
Hello

For Step7 in the standart library, under IEC functions there is a standart function FC38 STRNG_I which returns 0 for empty strings and a non-zero value for non-empty strings. I think this is what you are looking for. I dont have TIA installed on my computer right now so I can't check, please check if there are any IEC standart functions in TIA.
 
String length

Have you tried the LEN instruction?

- Extended instructions
- String + Char
- LEN
 

Similar Topics

One of the parts that I work on is wrote on with a laser. The laser burns on a 2D Data Matrix and some human-readable text. The barcode is then...
Replies
5
Views
2,191
Greetings, I am currently working on a bit of code reset a work cell after a specific fault. It will be the scanning of a supervisors barcode...
Replies
5
Views
3,336
First off, I'm a hobbyist-level programmer, and this program isn't controlling anything anything that could even remotely be considered "life...
Replies
18
Views
513
Hi, We are thinking of implementing a light to our safety system that indicates that a machine is in a ceratian more dangerous state then normal...
Replies
12
Views
1,976
Hi, I'm working on a project with an Allen-Bradley PLC, so we are using Studio5000. I have a bunch of things that communicate through ethernet/Ip...
Replies
2
Views
1,248
Back
Top Bottom