Jump to content
drr

Search empty string in Data Table

Recommended Posts

I have a Samba sm43-j-r22. 

I need to search in Data Table a row that has a column (of type string) with an empty value.

I have tried using the function "Data Tables Find Row" with the "Start address of value to find" with an MI operand with value equals to 0, because I think that an empty string has it first byte equals to null. But It wasn't succesful.

How can I acomplish this?

Share this post


Link to post
Share on other sites

I had to do this a few years ago and couldn't find a way to do with the string.

 

I finally added and extra column into the data table which was a MI and searched for it.   0 Meant that it had an empty string field  1 meant that the string field had data in it.

You'll have to make sure that when you get a new PLC you write a blank DT into it as often there is garbage in the DT which will mess with the above solution.

Share this post


Link to post
Share on other sites

Yes, I've  tested with 0, I think that there is a bug when searching for empty strings...

Cheers, and have a Happy new year also !

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×